From cc12012ac4b19b2748a338bdc96d0b4902a56c7d Mon Sep 17 00:00:00 2001 From: Filip Danisko Date: Tue, 4 Aug 2026 22:43:00 +0200 Subject: [PATCH] chore(deps): consolidate dependency updates --- .github/dependabot.yml | 12 + .github/workflows/ci.yml | 24 +- .github/workflows/deploy-railway.yml | 10 +- .github/workflows/release.yml | 20 +- .github/workflows/security.yml | 8 +- Dockerfile | 6 +- Wiki/changelog/cli.md | 12 + Wiki/features/operations.md | 11 +- package.json | 2 +- .../cmd/openknowledge/viewer_assets/viewer.js | 1049 ++++++++++------- packages/cli/go.mod | 12 +- packages/cli/go.sum | 34 +- .../cli/internal/okf/project_config_test.go | 4 +- packages/npm/THIRD_PARTY_NOTICES.md | 6 +- packages/npm/package.json | 2 +- packages/web/package.json | 10 +- pnpm-lock.yaml | 566 ++++----- 17 files changed, 1006 insertions(+), 782 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a5795f6..bf2dafb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,9 @@ updates: day: "monday" time: "05:00" timezone: "Etc/UTC" + groups: + npm-dependencies: + patterns: ["*"] - package-ecosystem: "gomod" directory: "/packages/cli" @@ -16,6 +19,9 @@ updates: day: "monday" time: "05:15" timezone: "Etc/UTC" + groups: + go-dependencies: + patterns: ["*"] - package-ecosystem: "github-actions" directory: "/" @@ -24,6 +30,9 @@ updates: day: "monday" time: "05:30" timezone: "Etc/UTC" + groups: + github-actions: + patterns: ["*"] - package-ecosystem: "docker" directory: "/" @@ -32,3 +41,6 @@ updates: day: "monday" time: "05:45" timezone: "Etc/UTC" + groups: + docker-images: + patterns: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d194a6..f9628fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,20 +19,20 @@ jobs: timeout-minutes: 30 steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: 10 - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 cache: pnpm @@ -86,10 +86,10 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod @@ -99,23 +99,23 @@ jobs: - name: Build CLI run: go build ./packages/cli/cmd/openknowledge - node-18: - name: Node 18 compatibility + node-20: + name: Node 20 compatibility runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: 10 - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: - node-version: 18 + node-version: 20 cache: pnpm - name: Install dependencies diff --git a/.github/workflows/deploy-railway.yml b/.github/workflows/deploy-railway.yml index 54db656..17b3189 100644 --- a/.github/workflows/deploy-railway.yml +++ b/.github/workflows/deploy-railway.yml @@ -16,20 +16,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: 10 - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 cache: pnpm @@ -49,7 +49,7 @@ jobs: container: ghcr.io/railwayapp/cli:4.65.0@sha256:103deb7580a11af6c414146ff63ff2357bf7b89fcda71a5e9818fade0129b859 steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Require Railway configuration shell: sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2f97da..4916004 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: npm_tag: ${{ steps.release.outputs.npm_tag }} steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 @@ -72,17 +72,17 @@ jobs: echo "npm_tag=$npm_tag" >> "$GITHUB_OUTPUT" - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: 10 - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 cache: pnpm @@ -133,7 +133,7 @@ jobs: run: pnpm test:packed-npm - name: Build release snapshot - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 + uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3 with: distribution: goreleaser version: v2.17.0 @@ -169,7 +169,7 @@ jobs: release_sha: ${{ steps.release_commit.outputs.release_sha }} steps: - name: Checkout verified source commit - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.sha }} fetch-depth: 0 @@ -205,7 +205,7 @@ jobs: attestations: write steps: - name: Checkout verified release commit - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ needs.commit_release.outputs.release_sha }} fetch-depth: 0 @@ -237,7 +237,7 @@ jobs: git checkout --detach "$tag" - name: Run GoReleaser - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 + uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3 with: distribution: goreleaser version: v2.17.0 @@ -258,12 +258,12 @@ jobs: id-token: write steps: - name: Checkout release tag - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ needs.verify.outputs.tag }} - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 registry-url: https://registry.npmjs.org diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 21f6a52..630b9ac 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -33,11 +33,11 @@ jobs: build-mode: none steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Go if: matrix.language == 'go' - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod @@ -64,10 +64,10 @@ jobs: timeout-minutes: 30 steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: packages/cli/go.mod diff --git a/Dockerfile b/Dockerfile index 101bd86..2f7ca61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ FROM golang:1.26.5-bookworm AS build +COPY --from=node:20-bookworm-slim /usr/local/ /usr/local/ + RUN apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates nodejs npm \ + && apt-get install -y --no-install-recommends ca-certificates \ && npm install -g pnpm@10 \ && rm -rf /var/lib/apt/lists/* @@ -15,7 +17,7 @@ RUN pnpm install --frozen-lockfile --ignore-scripts COPY . . RUN pnpm build:web -FROM node:22-bookworm-slim +FROM node:26-bookworm-slim WORKDIR /app diff --git a/Wiki/changelog/cli.md b/Wiki/changelog/cli.md index cc4b7e1..6dfcc50 100644 --- a/Wiki/changelog/cli.md +++ b/Wiki/changelog/cli.md @@ -13,6 +13,18 @@ page records release-level changes. ## Unreleased +### 2026-08-04 — Dependency refresh and Node 20 minimum version + +- The published npm wrapper now requires Node 20 or later. +- Web development and build commands now require Node 20. Updated web tooling + dependencies require this minimum version. +- CI tests the npm wrapper and web package on Node 20. +- Invalid TOML configuration now uses the current parser diagnostics. +- Source: `packages/npm/package.json`, `packages/web/package.json`, + `packages/cli/internal/okf/project_config_test.go`, + `.github/workflows/ci.yml`, `pnpm-lock.yaml`. +- Docs: `Wiki/features/operations.md`. + ### 2026-08-04 — Windows CLI portability - `connect` now reads canonical Windows `file://` URLs for manifests and diff --git a/Wiki/features/operations.md b/Wiki/features/operations.md index 5117d04..0da081a 100644 --- a/Wiki/features/operations.md +++ b/Wiki/features/operations.md @@ -3,7 +3,7 @@ type: Feature Documentation title: CLI Operations description: Develop, test, publish, and release the Open Knowledge CLI. tags: [openknowledge, cli, operations, release] -timestamp: 2026-07-28T00:00:00Z +timestamp: 2026-08-04T00:00:00Z --- # CLI Operations @@ -21,6 +21,9 @@ The root `package.json` owns the release version and workspace commands. ## Local development +Use Node 20 or later for workspace development and web builds. +Updated web tooling dependencies require this minimum version. + ```sh pnpm install --frozen-lockfile pnpm test @@ -70,8 +73,10 @@ The workflow does these tasks: 8. Validate `Wiki/` with the built binary. 9. Fail when generation changes tracked files. 10. Run CLI tests and builds on Linux, macOS, and Windows. -11. Verify npm and web behavior on Node 18. -12. Verify an installed packed artifact on Node 18. +11. Verify npm and web behavior on Node 20. +12. Verify an installed packed artifact on Node 20. + +The published npm wrapper requires Node 20 or later. Require the `CI / verify` check in branch protection. diff --git a/package.json b/package.json index 7c704d1..214a769 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "build": "pnpm build:web && pnpm build:cli" }, "devDependencies": { - "playwright": "1.61.1" + "playwright": "1.62.1" } } diff --git a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js index 1fc1f88..db630a9 100644 --- a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js +++ b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js @@ -1,8 +1,8 @@ -var Dyt=Object.defineProperty;var Myt=(Ns,ro,bp)=>ro in Ns?Dyt(Ns,ro,{enumerable:!0,configurable:!0,writable:!0,value:bp}):Ns[ro]=bp;var Hr=(Ns,ro,bp)=>Myt(Ns,typeof ro!="symbol"?ro+"":ro,bp);(function(){"use strict";var vm,bm,xm,Tm,wm,Cm,km,Em,Sm,Am,_m,Rm,Lm,Im,c6,lp,Dm,Mm,Nm,Om,$m,Pm,Ms,Bm,Fm,zm,Gm,qm,Vm,Wm,Um,Hm,Ym,Xm,Km,jm,Zm,Qm,Jm,e1,t1,r1,n1,i1,a1,s1,o1,l1,c1,u1,h1,d1,f1,p1,g1,m1,y1,v1,b1,x1,T1,w1,C1,k1,E1,S1,A1,_1,R1,L1,I1,D1,M1,N1,O1,$1,cp,P1,B1,F1,z1,G1,q1,V1,W1,U1,H1,Y1,X1,up,K1,j1,Z1,Q1,J1,ey,ty,ry,ny,iy,ay,Bh,sy,oy,ly,cy,uy,hy,dy,fy,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,ky,Ey,Sy,Ay,_y,Ry,Ly,Iy,Dy,My,Ny,Oy,$y,Py,By,Fy,zy,Gy,qy,Vy,Wy,Uy,Hy,Yy,Xy,Ky,jy,Zy,Qy,Jy,ev,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,kv,Ev,Sv,Av,_v,Rv,Lv,Iv,Dv,Mv,Nv,Ov,$v,Pv,Bv,Fv,zv,Gv,qv,Vv,Wv,Fh,hp,Uv,Hv,Yv,xu,Xv,h2e,d2e,Kv,jv,Zv,Qv;function Ns(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ro={exports:{}},bp=ro.exports,lB;function ube(){return lB||(lB=1,(function(t,e){(function(r,n){t.exports=n()})(bp,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var R=["th","st","nd","rd"],N=A%100;return"["+A+(R[(N-20)%10]||R[N]||R[0])+"]"}},b=function(A,R,N){var M=String(A);return!M||M.length>=R?A:""+Array(R+1-M.length).join(N)+A},w={s:b,z:function(A){var R=-A.utcOffset(),N=Math.abs(R),M=Math.floor(N/60),I=N%60;return(R<=0?"+":"-")+b(M,2,"0")+":"+b(I,2,"0")},m:function A(R,N){if(R.date()1)return A(P[0])}else{var B=R.name;S[B]=R,I=B}return!M&&I&&(k=I),I||!M&&k},O=function(A,R){if(_(A))return A.clone();var N=typeof R=="object"?R:{};return N.date=A,N.args=arguments,new z(N)},D=w;D.l=L,D.i=_,D.w=function(A,R){return O(A,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=(function(){function A(N){this.$L=L(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[C]=!0}var R=A.prototype;return R.parse=function(N){this.$d=(function(M){var I=M.date,$=M.utc;if(I===null)return new Date(NaN);if(D.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var P=I.match(y);if(P){var B=P[2]-1||0,q=(P[7]||"0").substring(0,3);return $?new Date(Date.UTC(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,q)):new Date(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,q)}}return new Date(I)})(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return D},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(N,M){var I=O(N);return this.startOf(M)<=I&&I<=this.endOf(M)},R.isAfter=function(N,M){return O(N)cB(t,"name",{value:e,configurable:!0}),Ew=(t,e)=>{for(var r in e)cB(t,r,{get:e[r],enumerable:!0})},uc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ae={trace:T((...t)=>{},"trace"),debug:T((...t)=>{},"debug"),info:T((...t)=>{},"info"),warn:T((...t)=>{},"warn"),error:T((...t)=>{},"error"),fatal:T((...t)=>{},"fatal")},T6=T(function(t="fatal"){let e=uc.fatal;typeof t=="string"?t.toLowerCase()in uc&&(e=uc[t]):typeof t=="number"&&(e=t),ae.trace=()=>{},ae.debug=()=>{},ae.info=()=>{},ae.warn=()=>{},ae.error=()=>{},ae.fatal=()=>{},e<=uc.fatal&&(ae.fatal=console.error?console.error.bind(console,no("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",no("FATAL"))),e<=uc.error&&(ae.error=console.error?console.error.bind(console,no("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",no("ERROR"))),e<=uc.warn&&(ae.warn=console.warn?console.warn.bind(console,no("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",no("WARN"))),e<=uc.info&&(ae.info=console.info?console.info.bind(console,no("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",no("INFO"))),e<=uc.debug&&(ae.debug=console.debug?console.debug.bind(console,no("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",no("DEBUG"))),e<=uc.trace&&(ae.trace=console.debug?console.debug.bind(console,no("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",no("TRACE")))},"setLogLevel"),no=T(t=>`%c${Ui().format("ss.SSS")} : ${t} : `,"format");const Sw={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return Sw.hue2rgb(a,i,t+1/3)*255;case"g":return Sw.hue2rgb(a,i,t)*255;case"b":return Sw.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},wu={};for(let t=0;t<=255;t++)wu[t]=Sr.unit.dec2hex(t);const ka={ALL:0,RGB:1,HSL:2};let dbe=class{constructor(){this.type=ka.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ka.ALL}is(e){return this.type===e}};class fbe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new dbe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ka.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Sr.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Sr.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Sr.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Sr.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Sr.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Sr.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Sr.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Sr.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Sr.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Sr.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Sr.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Sr.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ka.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ka.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ka.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ka.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ka.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ka.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Aw=new fbe({r:0,g:0,b:0,a:0},"transparent"),xp={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(xp.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Aw.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${wu[Math.round(e)]}${wu[Math.round(r)]}${wu[Math.round(n)]}${wu[Math.round(i*255)]}`:`#${wu[Math.round(e)]}${wu[Math.round(r)]}${wu[Math.round(n)]}`}},qh={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(qh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Sr.channel.clamp.h(parseFloat(r)*.9);case"rad":return Sr.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Sr.channel.clamp.h(parseFloat(r)*360)}}return Sr.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(qh.re);if(!r)return;const[,n,i,a,s,o]=r;return Aw.set({h:qh._hue2deg(n),s:Sr.channel.clamp.s(parseFloat(i)),l:Sr.channel.clamp.l(parseFloat(a)),a:s?Sr.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Sr.lang.round(e)}, ${Sr.lang.round(r)}%, ${Sr.lang.round(n)}%, ${i})`:`hsl(${Sr.lang.round(e)}, ${Sr.lang.round(r)}%, ${Sr.lang.round(n)}%)`}},o2={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=o2.colors[t];if(e)return xp.parse(e)},stringify:t=>{const e=xp.stringify(t);for(const r in o2.colors)if(o2.colors[r]===e)return r}},l2={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(l2.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Aw.set({r:Sr.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Sr.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Sr.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Sr.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Sr.lang.round(e)}, ${Sr.lang.round(r)}, ${Sr.lang.round(n)}, ${Sr.lang.round(i)})`:`rgb(${Sr.lang.round(e)}, ${Sr.lang.round(r)}, ${Sr.lang.round(n)})`}},So={format:{keyword:o2,hex:xp,rgb:l2,rgba:l2,hsl:qh,hsla:qh},parse:t=>{if(typeof t!="string")return t;const e=xp.parse(t)||l2.parse(t)||qh.parse(t)||o2.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ka.HSL)||t.data.r===void 0?qh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?l2.stringify(t):xp.stringify(t)},uB=(t,e)=>{const r=So.parse(t);for(const n in e)r[n]=Sr.channel.clamp[n](e[n]);return So.stringify(r)},Ao=(t,e,r=0,n=1)=>{if(typeof t!="number")return uB(t,{a:e});const i=Aw.set({r:Sr.channel.clamp.r(t),g:Sr.channel.clamp.g(e),b:Sr.channel.clamp.b(r),a:Sr.channel.clamp.a(n)});return So.stringify(i)},w6=(t,e)=>Sr.lang.round(So.parse(t)[e]),pbe=t=>{const{r:e,g:r,b:n}=So.parse(t),i=.2126*Sr.channel.toLinear(e)+.7152*Sr.channel.toLinear(r)+.0722*Sr.channel.toLinear(n);return Sr.lang.round(i)},gbe=t=>pbe(t)>=.5,Fa=t=>!gbe(t),C6=(t,e,r)=>{const n=So.parse(t),i=n[e],a=Sr.channel.clamp[e](i+r);return i!==a&&(n[e]=a),So.stringify(n)},at=(t,e)=>C6(t,"l",e),st=(t,e)=>C6(t,"l",-e),hB=(t,e)=>C6(t,"a",-e),ue=(t,e)=>{const r=So.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return uB(t,n)},mbe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=So.parse(t),{r:o,g:l,b:u,a:h}=So.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,x=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return Ao(v,x,b,w)},je=(t,e=100)=>{const r=So.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,mbe(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function dB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:yi(BigInt.prototype.toString),xB=typeof Symbol>"u"?null:yi(Symbol.prototype.toString),Hi=yi(Object.prototype.hasOwnProperty),h2=yi(Object.prototype.toString),Yi=yi(RegExp.prototype.test),Vh=Lbe(TypeError);function yi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:c2;if(pB&&pB(t,null),!Cu(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(wbe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function Ibe(t){for(let e=0;e/g),Bbe=oa(/\${[\w\W]*/g),Fbe=oa(/^data-[\-\w.\u00B7-\uFFFF]+$/),zbe=oa(/^aria-[\-\w]+$/),EB=oa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gbe=oa(/^(?:\w+script|data):/i),qbe=oa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vbe=oa(/^html$/i),Wbe=oa(/^[a-z][.\w]*(-[.\w]+)+$/i),SB=oa(/<[/\w!]/g),AB=oa(/<[/\w]/g),Ube=oa(/<\/no(script|embed|frames)/i),Hbe=oa(/\/>/i),Os={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ybe=function(){return typeof window>"u"?null:window},Xbe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},_B=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ku=function(e,r,n,i){return Hi(e,r)&&Cu(e[r])?Yr(i.base?za(i.base):{},e[r],i.transform):n};function RB(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ybe();const e=Ot=>RB(Ot);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==Os.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=ll(f,"cloneNode"),g=ll(f,"remove"),m=ll(f,"nextSibling"),y=ll(f,"childNodes"),v=ll(f,"parentNode"),x=ll(f,"shadowRoot"),b=ll(f,"attributes"),w=s&&s.prototype?ll(s.prototype,"nodeType"):null,k=s&&s.prototype?ll(s.prototype,"nodeName"):null;if(typeof a=="function"){const Ot=r.createElement("template");Ot.content&&Ot.content.ownerDocument&&(r=Ot.content.ownerDocument)}let S,C="",_,L=!1,O=0;const D=function(){if(O>0)throw Vh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(_e){D(),O++;try{return S.createHTML(_e)}finally{O--}},F=function(_e){D(),O++;try{return S.createScriptURL(_e)}finally{O--}},A=function(){return L||(_=Xbe(d,i),L=!0),_},R=r,N=R.implementation,M=R.createNodeIterator,I=R.createDocumentFragment,$=R.getElementsByTagName,P=n.importNode;let B=_B();e.isSupported=typeof fB=="function"&&typeof v=="function"&&N&&N.createHTMLDocument!==void 0;const q=$be,V=Pbe,X=Bbe,W=Fbe,ie=zbe,K=Gbe,se=qbe,te=Wbe;let Z=EB,ee=null;const ne=Yr({},[...TB,...A6,..._6,...R6,...wB]);let oe=null;const fe=Yr({},[...CB,...L6,...kB,..._w]);let Ae=Object.seal(Tp(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Re=null,Ge=null;const Ce=Object.seal(Tp(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,Fe=!0,ye=!1,He=!0,xe=!1,Ve=!0,Je=!1,nt=!1,tt=null,Ze=null,Ee=!1,Se=!1,Y=!1,ce=!1,j=!0,pe=!1;const re="user-content-";let Pe=!0,ve=!1,Ue={},Me=null;const qe=Yr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Le=null;const Ke=Yr({},["audio","video","img","source","image","track"]);let De=null;const it=Yr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",we="http://www.w3.org/1999/xhtml";let Et=we,yt=!1,ot=null;const Dt=Yr({},[Te,ct,we],S6),vt=sa(["mi","mo","mn","ms","mtext"]);let ut=Yr({},vt);const le=sa(["annotation-xml"]);let At=Yr({},le);const dt=Yr({},["title","style","font","a","script"]);let ht=null;const St=["application/xhtml+xml","text/html"],Nr="text/html";let me=null,et=null;const lt=r.createElement("form"),Rt=function(_e){return _e instanceof RegExp||_e instanceof Function},Ft=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===_e)return;(!_e||typeof _e!="object")&&(_e={}),_e=za(_e),ht=St.indexOf(_e.PARSER_MEDIA_TYPE)===-1?Nr:_e.PARSER_MEDIA_TYPE,me=ht==="application/xhtml+xml"?S6:c2,ee=ku(_e,"ALLOWED_TAGS",ne,{transform:me}),oe=ku(_e,"ALLOWED_ATTR",fe,{transform:me}),ot=ku(_e,"ALLOWED_NAMESPACES",Dt,{transform:S6}),De=ku(_e,"ADD_URI_SAFE_ATTR",it,{transform:me,base:it}),Le=ku(_e,"ADD_DATA_URI_TAGS",Ke,{transform:me,base:Ke}),Me=ku(_e,"FORBID_CONTENTS",qe,{transform:me}),Re=ku(_e,"FORBID_TAGS",za({}),{transform:me}),Ge=ku(_e,"FORBID_ATTR",za({}),{transform:me}),Ue=Hi(_e,"USE_PROFILES")?_e.USE_PROFILES&&typeof _e.USE_PROFILES=="object"?za(_e.USE_PROFILES):_e.USE_PROFILES:!1,be=_e.ALLOW_ARIA_ATTR!==!1,Fe=_e.ALLOW_DATA_ATTR!==!1,ye=_e.ALLOW_UNKNOWN_PROTOCOLS||!1,He=_e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=_e.SAFE_FOR_TEMPLATES||!1,Ve=_e.SAFE_FOR_XML!==!1,Je=_e.WHOLE_DOCUMENT||!1,Se=_e.RETURN_DOM||!1,Y=_e.RETURN_DOM_FRAGMENT||!1,ce=_e.RETURN_TRUSTED_TYPE||!1,Ee=_e.FORCE_BODY||!1,j=_e.SANITIZE_DOM!==!1,pe=_e.SANITIZE_NAMED_PROPS||!1,Pe=_e.KEEP_CONTENT!==!1,ve=_e.IN_PLACE||!1,Z=Mbe(_e.ALLOWED_URI_REGEXP)?_e.ALLOWED_URI_REGEXP:EB,Et=typeof _e.NAMESPACE=="string"?_e.NAMESPACE:we,ut=Hi(_e,"MATHML_TEXT_INTEGRATION_POINTS")&&_e.MATHML_TEXT_INTEGRATION_POINTS&&typeof _e.MATHML_TEXT_INTEGRATION_POINTS=="object"?za(_e.MATHML_TEXT_INTEGRATION_POINTS):Yr({},vt),At=Hi(_e,"HTML_INTEGRATION_POINTS")&&_e.HTML_INTEGRATION_POINTS&&typeof _e.HTML_INTEGRATION_POINTS=="object"?za(_e.HTML_INTEGRATION_POINTS):Yr({},le);const Qe=Hi(_e,"CUSTOM_ELEMENT_HANDLING")&&_e.CUSTOM_ELEMENT_HANDLING&&typeof _e.CUSTOM_ELEMENT_HANDLING=="object"?za(_e.CUSTOM_ELEMENT_HANDLING):Tp(null);if(Ae=Tp(null),Hi(Qe,"tagNameCheck")&&Rt(Qe.tagNameCheck)&&(Ae.tagNameCheck=Qe.tagNameCheck),Hi(Qe,"attributeNameCheck")&&Rt(Qe.attributeNameCheck)&&(Ae.attributeNameCheck=Qe.attributeNameCheck),Hi(Qe,"allowCustomizedBuiltInElements")&&typeof Qe.allowCustomizedBuiltInElements=="boolean"&&(Ae.allowCustomizedBuiltInElements=Qe.allowCustomizedBuiltInElements),oa(Ae),xe&&(Fe=!1),Y&&(Se=!0),Ue&&(ee=Yr({},wB),oe=Tp(null),Ue.html===!0&&(Yr(ee,TB),Yr(oe,CB)),Ue.svg===!0&&(Yr(ee,A6),Yr(oe,L6),Yr(oe,_w)),Ue.svgFilters===!0&&(Yr(ee,_6),Yr(oe,L6),Yr(oe,_w)),Ue.mathMl===!0&&(Yr(ee,R6),Yr(oe,kB),Yr(oe,_w))),Ce.tagCheck=null,Ce.attributeCheck=null,Hi(_e,"ADD_TAGS")&&(typeof _e.ADD_TAGS=="function"?Ce.tagCheck=_e.ADD_TAGS:Cu(_e.ADD_TAGS)&&(ee===ne&&(ee=za(ee)),Yr(ee,_e.ADD_TAGS,me))),Hi(_e,"ADD_ATTR")&&(typeof _e.ADD_ATTR=="function"?Ce.attributeCheck=_e.ADD_ATTR:Cu(_e.ADD_ATTR)&&(oe===fe&&(oe=za(oe)),Yr(oe,_e.ADD_ATTR,me))),Hi(_e,"ADD_URI_SAFE_ATTR")&&Cu(_e.ADD_URI_SAFE_ATTR)&&Yr(De,_e.ADD_URI_SAFE_ATTR,me),Hi(_e,"FORBID_CONTENTS")&&Cu(_e.FORBID_CONTENTS)&&(Me===qe&&(Me=za(Me)),Yr(Me,_e.FORBID_CONTENTS,me)),Hi(_e,"ADD_FORBID_CONTENTS")&&Cu(_e.ADD_FORBID_CONTENTS)&&(Me===qe&&(Me=za(Me)),Yr(Me,_e.ADD_FORBID_CONTENTS,me)),Pe&&(ee["#text"]=!0),Je&&Yr(ee,["html","head","body"]),ee.table&&(Yr(ee,["tbody"]),delete Re.tbody),_e.TRUSTED_TYPES_POLICY){if(typeof _e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const xt=S;S=_e.TRUSTED_TYPES_POLICY;try{C=z("")}catch(Vt){throw S=xt,Vt}}else _e.TRUSTED_TYPES_POLICY===null?(S=void 0,C=""):(S===void 0&&(S=A()),S&&typeof C=="string"&&(C=z("")));sa&&sa(_e),et=_e},or=Yr({},[...A6,..._6,...Nbe]),ir=Yr({},[...R6,...Obe]),xr=function(_e,Qe,xt){return Qe.namespaceURI===we?_e==="svg":Qe.namespaceURI===Te?_e==="svg"&&(xt==="annotation-xml"||ut[xt]):!!or[_e]},sr=function(_e,Qe,xt){return Qe.namespaceURI===we?_e==="math":Qe.namespaceURI===ct?_e==="math"&&At[xt]:!!ir[_e]},Rr=function(_e,Qe,xt){return Qe.namespaceURI===ct&&!At[xt]||Qe.namespaceURI===Te&&!ut[xt]?!1:!ir[_e]&&(dt[_e]||!or[_e])},Jt=function(_e){let Qe=v(_e);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:Et,tagName:"template"});const xt=c2(_e.tagName),Vt=c2(Qe.tagName);return ot[_e.namespaceURI]?_e.namespaceURI===ct?xr(xt,Qe,Vt):_e.namespaceURI===Te?sr(xt,Qe,Vt):_e.namespaceURI===we?Rr(xt,Qe,Vt):!!(ht==="application/xhtml+xml"&&ot[_e.namespaceURI]):!1},Ir=function(_e){Cp(e.removed,{element:_e});try{v(_e).removeChild(_e)}catch{if(g(_e),!v(_e))throw Vh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ln=function(_e){Pa(_e);const Qe=y(_e);if(Qe){const Vt=[];wp(Qe,dr=>{Cp(Vt,dr)}),wp(Vt,dr=>{try{g(dr)}catch{}})}const xt=b(_e);if(xt)for(let Vt=xt.length-1;Vt>=0;--Vt){const dr=xt[Vt],fr=dr&&dr.name;if(typeof fr=="string")try{_e.removeAttribute(fr)}catch{}}},Or=function(_e,Qe){try{Cp(e.removed,{attribute:Qe.getAttributeNode(_e),from:Qe})}catch{Cp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(_e),_e==="is")if(Se||Y)try{Ir(Qe)}catch{}else try{Qe.setAttribute(_e,"")}catch{}},Ca=function(_e){const Qe=b(_e);if(Qe)for(let xt=Qe.length-1;xt>=0;--xt){const Vt=Qe[xt],dr=Vt&&Vt.name;if(!(typeof dr!="string"||oe[me(dr)]))try{_e.removeAttribute(dr)}catch{}}},Pa=function(_e){const Qe=[_e];for(;Qe.length>0;){const xt=Qe.pop();(w?w(xt):xt.nodeType)===Os.element&&Ca(xt);const dr=y(xt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Qe.push(dr[fr])}},Wi=function(_e){if(!Ve)return;const Qe=[_e];for(;Qe.length>0;){const xt=Qe.pop(),Vt=w?w(xt):xt.nodeType;if(Vt===Os.processingInstruction||Vt===Os.comment&&Yi(AB,xt.data)){try{g(xt)}catch{}continue}if(Vt===Os.element){const fr=xt,mn=me(k?k(xt):xt.nodeName);try{fr.hasAttribute&&fr.hasAttribute("patchsrc")&&fr.removeAttribute("patchsrc"),fr.hasAttribute&&fr.hasAttribute("for")&&mn!=="label"&&mn!=="output"&&fr.removeAttribute("for")}catch{}}const dr=y(xt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Qe.push(dr[fr])}},_i=function(_e){let Qe=null,xt=null;if(Ee)_e=""+_e;else{const fr=yB(_e,/^[\r\n\t ]+/);xt=fr&&fr[0]}ht==="application/xhtml+xml"&&Et===we&&(_e=''+_e+"");const Vt=S?z(_e):_e;if(Et===we)try{Qe=new h().parseFromString(Vt,ht)}catch{}if(!Qe||!Qe.documentElement){Qe=N.createDocument(Et,"template",null);try{Qe.documentElement.innerHTML=yt?C:Vt}catch{}}const dr=Qe.body||Qe.documentElement;return _e&&xt&&dr.insertBefore(r.createTextNode(xt),dr.childNodes[0]||null),Et===we?$.call(Qe,Je?"html":"body")[0]:Je?Qe.documentElement:dr},$t=function(_e){return M.call(_e.ownerDocument||_e,_e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},bt=function(_e){return _e=u2(_e,q," "),_e=u2(_e,V," "),_e=u2(_e,X," "),_e},Bt=function(_e){var Qe;_e.normalize();const xt=M.call(_e.ownerDocument||_e,_e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vt=xt.nextNode();for(;Vt;)Vt.data=bt(Vt.data),Vt=xt.nextNode();const dr=(Qe=_e.querySelectorAll)===null||Qe===void 0?void 0:Qe.call(_e,"template");dr&&wp(dr,fr=>{pr(fr.content)&&Bt(fr.content)})},Tt=function(_e){const Qe=k?k(_e):null;return typeof Qe!="string"||me(Qe)!=="form"?!1:typeof _e.nodeName!="string"||typeof _e.textContent!="string"||typeof _e.removeChild!="function"||_e.attributes!==b(_e)||typeof _e.removeAttribute!="function"||typeof _e.setAttribute!="function"||typeof _e.namespaceURI!="string"||typeof _e.insertBefore!="function"||typeof _e.hasChildNodes!="function"||_e.nodeType!==w(_e)||_e.childNodes!==y(_e)},pr=function(_e){if(!w||typeof _e!="object"||_e===null)return!1;try{return w(_e)===Os.documentFragment}catch{return!1}},ke=function(_e){if(!w||typeof _e!="object"||_e===null)return!1;try{return typeof w(_e)=="number"}catch{return!1}};function Ri(Ot,_e,Qe){Ot.length!==0&&wp(Ot,xt=>{xt.call(e,_e,Qe,et)})}const Ne=function(_e,Qe){return!!(Ve&&_e.hasChildNodes()&&!ke(_e.firstElementChild)&&Yi(SB,_e.textContent)&&Yi(SB,_e.innerHTML)||Ve&&_e.namespaceURI===we&&Qe==="style"&&ke(_e.firstElementChild)||_e.nodeType===Os.processingInstruction||Ve&&_e.nodeType===Os.comment&&Yi(AB,_e.data))},In=function(_e,Qe){if(!Re[Qe]&&Tu(Qe)&&(Ae.tagNameCheck instanceof RegExp&&Yi(Ae.tagNameCheck,Qe)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(Qe)))return!1;if(Pe&&!Me[Qe]){const xt=v(_e),Vt=y(_e);if(Vt&&xt){const dr=Vt.length;for(let fr=dr-1;fr>=0;--fr){const mn=ve?Vt[fr]:p(Vt[fr],!0);xt.insertBefore(mn,m(_e))}}}return Ir(_e),!0},dp=function(_e,Qe){if(Ri(B.beforeSanitizeElements,_e,null),_e!==Qe&&v(_e)===null)return!0;if(Tt(_e))return Ir(_e),!0;const xt=me(k?k(_e):_e.nodeName);if(Ri(B.uponSanitizeElement,_e,{tagName:xt,allowedTags:ee}),_e!==Qe&&v(_e)===null)return!0;if(Ne(_e,xt))return Ir(_e),!0;if(Re[xt]||!(Ce.tagCheck instanceof Function&&Ce.tagCheck(xt))&&!ee[xt]){const dr=In(_e,xt);return dr===!1&&Ri(B.afterSanitizeElements,_e,null),dr}if((w?w(_e):_e.nodeType)===Os.element&&!Jt(_e)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Yi(Ube,_e.innerHTML))return Ir(_e),!0;if(xe&&_e.nodeType===Os.text){const dr=bt(_e.textContent);_e.textContent!==dr&&(Cp(e.removed,{element:_e.cloneNode()}),_e.textContent=dr)}return Ri(B.afterSanitizeElements,_e,null),!1},Jv=function(_e,Qe,xt){if(Ge[Qe]||Ve&&Qe==="patchsrc"||Ve&&Qe==="for"&&_e!=="label"&&_e!=="output"||j&&(Qe==="id"||Qe==="name")&&(xt in r||xt in lt))return!1;const Vt=oe[Qe]||Ce.attributeCheck instanceof Function&&Ce.attributeCheck(Qe,_e);if(!(Fe&&Yi(W,Qe))){if(!(be&&Yi(ie,Qe))){if(Vt){if(!De[Qe]){if(!Yi(Z,u2(xt,se,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&_e!=="script"&&vB(xt,"data:")===0&&Le[_e])){if(!(ye&&!Yi(K,u2(xt,se,"")))){if(xt)return!1}}}}}else if(!(Tu(_e)&&(Ae.tagNameCheck instanceof RegExp&&Yi(Ae.tagNameCheck,_e)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(_e))&&(Ae.attributeNameCheck instanceof RegExp&&Yi(Ae.attributeNameCheck,Qe)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(Qe,_e))||Qe==="is"&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&Yi(Ae.tagNameCheck,xt)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(xt))))return!1}}return!0},e2=Yr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Tu=function(_e){return!e2[c2(_e)]&&Yi(te,_e)},zn=function(_e,Qe,xt,Vt){if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!xt)switch(d.getAttributeType(_e,Qe)){case"TrustedHTML":return z(Vt);case"TrustedScriptURL":return F(Vt)}return Vt},il=function(_e,Qe,xt,Vt){try{xt?_e.setAttributeNS(xt,Qe,Vt):_e.setAttribute(Qe,Vt),Tt(_e)?Ir(_e):mB(e.removed)}catch{Or(Qe,_e)}},sc=function(_e){Ri(B.beforeSanitizeAttributes,_e,null);const Qe=_e.attributes;if(!Qe||Tt(_e))return;const xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let Vt=Qe.length;const dr=me(_e.nodeName);for(;Vt--;){const fr=Qe[Vt],mn=fr.name,yn=fr.namespaceURI,Ba=fr.value,Kr=me(mn),aa=Ba;let Jr=mn==="value"?aa:Abe(aa);if(xt.attrName=Kr,xt.attrValue=Jr,xt.keepAttr=!0,xt.forceKeepAttr=void 0,Ri(B.uponSanitizeAttribute,_e,xt),Jr=xt.attrValue,pe&&(Kr==="id"||Kr==="name")&&vB(Jr,re)!==0&&(Or(mn,_e),Jr=re+Jr),Ve&&Yi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Jr)){Or(mn,_e);continue}if(Kr==="attributename"&&yB(Jr,"href")){Or(mn,_e);continue}if(!xt.forceKeepAttr){if(!xt.keepAttr){Or(mn,_e);continue}if(!He&&Yi(Hbe,Jr)){Or(mn,_e);continue}if(xe&&(Jr=bt(Jr)),!Jv(dr,Kr,Jr)){Or(mn,_e);continue}Jr=zn(dr,Kr,yn,Jr),Jr!==aa&&il(_e,mn,yn,Jr)}}Ri(B.afterSanitizeAttributes,_e,null)},oc=function(_e){let Qe=null;const xt=$t(_e);for(Ri(B.beforeSanitizeShadowDOM,_e,null);Qe=xt.nextNode();)if(Ri(B.uponSanitizeShadowNode,Qe,null),dp(Qe,_e),sc(Qe),pr(Qe.content)&&oc(Qe.content),(w?w(Qe):Qe.nodeType)===Os.element){const dr=x(Qe);pr(dr)&&(fp(dr),oc(dr))}Ri(B.afterSanitizeShadowDOM,_e,null)},fp=function(_e){const Qe=[{node:_e,shadow:null}];for(;Qe.length>0;){const xt=Qe.pop();if(xt.shadow){oc(xt.shadow);continue}const Vt=xt.node,fr=(w?w(Vt):Vt.nodeType)===Os.element,mn=y(Vt);if(mn)for(let yn=mn.length-1;yn>=0;--yn)Qe.push({node:mn[yn],shadow:null});if(fr){const yn=k?k(Vt):null;if(typeof yn=="string"&&me(yn)==="template"){const Ba=Vt.content;pr(Ba)&&Qe.push({node:Ba,shadow:null})}}if(fr){const yn=x(Vt);pr(yn)&&Qe.push({node:null,shadow:yn},{node:yn,shadow:null})}}};return e.sanitize=function(Ot){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,xt=null,Vt=null,dr=null;if(yt=!Ot,yt&&(Ot=""),typeof Ot!="string"&&!ke(Ot)&&(Ot=Dbe(Ot),typeof Ot!="string"))throw Vh("dirty is not a string, aborting");if(!e.isSupported)return Ot;nt?(ee=tt,oe=Ze):Ft(_e),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(ee=za(ee)),B.uponSanitizeAttribute.length>0&&(oe=za(oe)),e.removed=[];const fr=ve&&typeof Ot!="string"&&ke(Ot);if(fr){Wi(Ot);const Kr=k?k(Ot):Ot.nodeName;if(typeof Kr=="string"){const aa=me(Kr);if(!ee[aa]||Re[aa])throw ln(Ot),Vh("root node is forbidden and cannot be sanitized in-place")}if(Tt(Ot))throw ln(Ot),Vh("root node is clobbered and cannot be sanitized in-place");try{fp(Ot)}catch(aa){throw ln(Ot),aa}}else if(ke(Ot))Qe=_i(""),xt=Qe.ownerDocument.importNode(Ot,!0),xt.nodeType===Os.element&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?Qe=xt:Qe.appendChild(xt),fp(xt);else{if(!Se&&!xe&&!Je&&Ot.indexOf("<")===-1)return S&&ce?z(Ot):Ot;if(Qe=_i(Ot),!Qe)return Se?null:ce?C:""}Qe&&Ee&&Ir(Qe.firstChild);const mn=fr?Ot:Qe,yn=$t(mn);try{for(;Vt=yn.nextNode();)dp(Vt,mn),sc(Vt),pr(Vt.content)&&oc(Vt.content)}catch(Kr){throw fr&&(ln(Ot),wp(e.removed,aa=>{aa.element&&Pa(aa.element)})),Kr}if(fr)return wp(e.removed,Kr=>{Kr.element&&Pa(Kr.element)}),xe&&Bt(Ot),Ot;if(Se){if(xe&&Bt(Qe),Y)for(dr=I.call(Qe.ownerDocument);Qe.firstChild;)dr.appendChild(Qe.firstChild);else dr=Qe;return(oe.shadowroot||oe.shadowrootmode)&&(dr=P.call(n,dr,!0)),dr}let Ba=Je?Qe.outerHTML:Qe.innerHTML;return Je&&ee["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Yi(Vbe,Qe.ownerDocument.doctype.name)&&(Ba=" -`+Ba),xe&&(Ba=bt(Ba)),S&&ce?z(Ba):Ba},e.setConfig=function(){let Ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ot),nt=!0,tt=ee,Ze=oe},e.clearConfig=function(){et=null,nt=!1,tt=null,Ze=null,S=_,C=""},e.isValidAttribute=function(Ot,_e,Qe){et||Ft({});const xt=me(Ot),Vt=me(_e);return Jv(xt,Vt,Qe)},e.addHook=function(Ot,_e){typeof _e=="function"&&Hi(B,Ot)&&Cp(B[Ot],_e)},e.removeHook=function(Ot,_e){if(Hi(B,Ot)){if(_e!==void 0){const Qe=Ebe(B[Ot],_e);return Qe===-1?void 0:Sbe(B[Ot],Qe,1)[0]}return mB(B[Ot])}},e.removeHooks=function(Ot){Hi(B,Ot)&&(B[Ot]=[])},e.removeAllHooks=function(){B=_B()},e}var Eu=RB(),LB=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,d2=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Kbe=/\s*%%.*\n/gm,IB=(vm=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},T(vm,"UnknownDiagramError"),vm),Wh={},I6=T(function(t,e){t=t.replace(LB,"").replace(d2,"").replace(Kbe,` -`);for(const[r,{detector:n}]of Object.entries(Wh))if(n(t,e))return r;throw new IB(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),D6=T((...t)=>{for(const{id:e,detector:r,loader:n}of t)DB(e,r,n)},"registerLazyLoadedDiagrams"),DB=T((t,e,r)=>{Wh[t]&&ae.warn(`Detector with key ${t} already exists. Overwriting.`),Wh[t]={detector:e,loader:r},ae.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),jbe=T(t=>Wh[t].loader,"getDiagramLoader"),M6=T((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>M6(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=M6(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),li=M6,cl="#ffffff",ul="#f2f2f2",wr=T((t,e)=>e?ue(t,{s:-40,l:10}):ue(t,{s:-40,l:-10}),"mkBorder"),Zbe=(bm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,D,z,F,A,R,N,M,I,$;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10)):(this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330}),this.darkMode)for(let P=0;P{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(bm,"Theme"),bm),Qbe=T(t=>{const e=new Zbe;return e.calculate(t),e},"getThemeVariables"),Jbe=(xm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(je("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Ao(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ao(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,D,z,F,A,R,N,M,I;this.secondBkg=at(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=at(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=at(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=je(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ue(this.primaryColor,{h:64}),this.fillType3=ue(this.secondaryColor,{h:64}),this.fillType4=ue(this.primaryColor,{h:-64}),this.fillType5=ue(this.secondaryColor,{h:-64}),this.fillType6=ue(this.primaryColor,{h:128}),this.fillType7=ue(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330});for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(xm,"Theme"),xm),exe=T(t=>{const e=new Jbe;return e.calculate(t),e},"getThemeVariables"),txe=(Tm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ue(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ao(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,D,z,F,A,R,N,M,I;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Tm,"Theme"),Tm),kp=T(t=>{const e=new txe;return e.calculate(t),e},"getThemeVariables"),rxe=(wm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=at("#cde498",10),this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.primaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,D,z,F,A,R,N,M,I;this.actorBorder=st(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(wm,"Theme"),wm),nxe=T(t=>{const e=new rxe;return e.calculate(t),e},"getThemeVariables"),ixe=(Cm=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,D,z,F,A,R,N,M,I;this.secondBkg=at(this.contrast,55),this.border2=this.contrast,this.actorBorder=at(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Cm,"Theme"),Cm),axe=T(t=>{const e=new ixe;return e.calculate(t),e},"getThemeVariables"),sxe=(km=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ue(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||ue(e,{h:30}),this.cScale4=this.cScale4||ue(e,{h:60}),this.cScale5=this.cScale5||ue(e,{h:90}),this.cScale6=this.cScale6||ue(e,{h:120}),this.cScale7=this.cScale7||ue(e,{h:150}),this.cScale8=this.cScale8||ue(e,{h:210,l:150}),this.cScale9=this.cScale9||ue(e,{h:270}),this.cScale10=this.cScale10||ue(e,{h:300}),this.cScale11=this.cScale11||ue(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(km,"Theme"),km),oxe=T(t=>{const e=new sxe;return e.calculate(t),e},"getThemeVariables"),lxe=(Em=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(je("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Em,"Theme"),Em),cxe=T(t=>{const e=new lxe;return e.calculate(t),e},"getThemeVariables"),uxe=(Sm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=wr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ue(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Sm,"Theme"),Sm),hxe=T(t=>{const e=new uxe;return e.calculate(t),e},"getThemeVariables"),dxe=(Am=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(je("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ue(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Am,"Theme"),Am),fxe=T(t=>{const e=new dxe;return e.calculate(t),e},"getThemeVariables"),pxe=(_m=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=wr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ue(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(_m,"Theme"),_m),gxe=T(t=>{const e=new pxe;return e.calculate(t),e},"getThemeVariables"),mxe=(Rm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=ue(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=wr(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(je("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||wr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||wr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||wr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||wr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor),this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Rm,"Theme"),Rm),yxe=T(t=>{const e=new mxe;return e.calculate(t),e},"getThemeVariables"),hc={base:{getThemeVariables:Qbe},dark:{getThemeVariables:exe},default:{getThemeVariables:kp},forest:{getThemeVariables:nxe},neutral:{getThemeVariables:axe},neo:{getThemeVariables:oxe},"neo-dark":{getThemeVariables:cxe},redux:{getThemeVariables:hxe},"redux-dark":{getThemeVariables:fxe},"redux-color":{getThemeVariables:gxe},"redux-dark-color":{getThemeVariables:yxe}},Ga={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},MB={...Ga,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:hc.default.getThemeVariables(),sequence:{...Ga.sequence,messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:T(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:T(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Ga.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ga.c4,useWidth:void 0,personFont:T(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ga.flowchart,inheritDir:!1},external_personFont:T(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:T(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:T(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:T(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:T(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:T(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:T(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:T(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:T(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:T(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:T(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:T(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:T(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:T(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:T(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:T(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:T(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:T(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:T(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:T(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ga.pie,useWidth:984},xyChart:{...Ga.xyChart,useWidth:void 0},requirement:{...Ga.requirement,useWidth:void 0},packet:{...Ga.packet},eventmodeling:{...Ga.eventmodeling},treeView:{...Ga.treeView,useWidth:void 0},radar:{...Ga.radar},ishikawa:{...Ga.ishikawa},sankey:{...Ga.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Ga.venn}},NB=T((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...NB(t[n],"")]:[...r,e+n],[]),"keyify"),vxe=new Set(NB(MB,"")),Fr=MB,Rw=T(t=>{if(ae.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Rw(e));return}for(const e of Object.keys(t)){if(ae.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!vxe.has(e)||t[e]==null){ae.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){if(e==="nodeColors"){const n=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const i of Object.keys(t[e]))(typeof t[e][i]!="string"||!n.test(t[e][i]))&&(ae.debug("sanitize deleting invalid color:",i,t[e][i]),delete t[e][i])}else ae.debug("sanitizing object",e),Rw(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ae.debug("sanitizing css option",e),t[e]=OB(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ae.debug("After sanitization",t)}},"sanitizeDirective"),OB=T(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),gs=li({},Ep),Lw,Uh=[],f2=li({},Ep),Iw=T((t,e)=>{let r=li({},t),n={};for(const i of e)BB(i),n=li(n,i);if(r=li(r,n),n.theme&&n.theme in hc){const i=li({},Lw),a=li(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in hc&&(r.themeVariables=hc[r.theme].getThemeVariables(a))}return f2=r,GB(f2),f2},"updateCurrentConfig"),bxe=T(t=>(gs=li({},Ep),gs=li(gs,t),t.theme&&hc[t.theme]&&(gs.themeVariables=hc[t.theme].getThemeVariables(t.themeVariables)),Iw(gs,Uh),gs),"setSiteConfig"),xxe=T(t=>{Lw=li({},t)},"saveConfigFromInitialize"),Txe=T(t=>(gs=li(gs,t),Iw(gs,Uh),gs),"updateSiteConfig"),$B=T(()=>li({},gs),"getSiteConfig"),PB=T(t=>(GB(t),li(f2,t),lr()),"setConfig"),lr=T(()=>li({},f2),"getConfig"),BB=T(t=>{t&&(["secure",...gs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ae.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&BB(t[e])}))},"sanitize"),wxe=T(t=>{var e;Rw(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Uh.push(t),Iw(gs,Uh)},"addDirective"),Dw=T((t=gs)=>{Uh=[],Iw(t,Uh)},"reset"),Cxe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},FB={},zB=T(t=>{FB[t]||(ae.warn(Cxe[t]),FB[t]=!0)},"issueWarning"),GB=T(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&zB("LAZY_LOAD_DEPRECATED")},"checkConfig"),kxe=T(()=>{let t={};Lw&&(t=li(t,Lw));for(const e of Uh)t=li(t,e);return t},"getUserDefinedConfig"),cn=T(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&zB("FLOWCHART_HTML_LABELS_DEPRECATED"),dc(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),Sp=//gi,Exe=T(t=>t?UB(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Sxe=(()=>{let t=!1;return()=>{t||(qB(),t=!0)}})();function qB(){const t="data-temp-href-target";Eu.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Eu.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}T(qB,"setupDompurifyHooks");var VB=T(t=>(Sxe(),Eu.sanitize(t)),"removeScript"),WB=T((t,e)=>{if(cn(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=VB(t):r!=="loose"&&(t=UB(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Lxe(t))}return t},"sanitizeMore"),qr=T((t,e)=>t&&(e.dompurifyConfig?t=Eu.sanitize(WB(t,e),e.dompurifyConfig).toString():t=Eu.sanitize(WB(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Axe=T((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),_xe=T(t=>Sp.test(t),"hasBreaks"),Rxe=T(t=>t.split(Sp),"splitBreaks"),Lxe=T(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),UB=T(t=>t.replace(Sp,"#br#"),"breakToPlaceholder"),Mw=T(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Ixe=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Dxe=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Su=T(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Mxe=T((t,e)=>{const r=N6(t,"~"),n=N6(e,"~");return r===1&&n===1},"shouldCombineSets"),Nxe=T(t=>{const e=N6(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),HB=T(()=>window.MathMLElement!==void 0,"isMathMLSupported"),O6=/\$\$(.*)\$\$/g,ci=T(t=>{var e;return(((e=t.match(O6))==null?void 0:e.length)??0)>0},"hasKatex"),p2=T(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await Nw(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),Oxe=T(async(t,e)=>{if(!ci(t))return t;if(!(HB()||e.legacyMathML||e.forceLegacyMathML))return t.replace(O6,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>jLe),n=e.forceLegacyMathML||!HB()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Sp).map(i=>ci(i)?`
${i}
`:`
${i}
`).join("").replace(O6,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Nw=T(async(t,e)=>qr(await Oxe(t,e),e),"renderKatexSanitized"),It={getRows:Exe,sanitizeText:qr,sanitizeTextOrArray:Axe,hasBreaks:_xe,splitBreaks:Rxe,lineBreakRegex:Sp,removeScript:VB,getUrl:Mw,evaluate:dc,getMax:Ixe,getMin:Dxe},$xe=T(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Pxe=T(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),vi=T(function(t,e,r,n){const i=Pxe(e,r,n);$xe(t,i)},"configureSvgSize"),Ap=T(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ae.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ae.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ae.info(`Calculated bounds: ${o}x${l}`),vi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Ow={};function $6(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}T($6,"cssStyleSheetToString");var Bxe=T((t,e,r,n)=>{let i="";return t in Ow&&Ow[t]?i=Ow[t]({...r,svgId:n}):ae.warn(`No theme found for ${t}`),` & { +var t4t=Object.defineProperty;var r4t=(th,b,Bc)=>b in th?t4t(th,b,{enumerable:!0,configurable:!0,writable:!0,value:Bc}):th[b]=Bc;var un=(th,b,Bc)=>r4t(th,typeof b!="symbol"?b+"":b,Bc);(function(){"use strict";var f1,p1,g1,m1,y1,v1,b1,x1,T1,w1,C1,S1,k1,E1,O6,Zp,A1,_1,R1,L1,I1,M1,no,D1,N1,O1,$1,P1,B1,F1,z1,G1,W1,q1,V1,U1,H1,Y1,X1,j1,K1,Z1,Q1,J1,ey,ty,ry,ny,iy,ay,sy,oy,ly,cy,uy,hy,dy,fy,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,Sy,ky,Ey,Ay,_y,Ry,Ly,Iy,Qp,My,Dy,Ny,Oy,$y,Py,By,Fy,zy,Gy,Wy,qy,Jp,Vy,Uy,Hy,Yy,Xy,jy,Ky,Zy,Qy,Jy,ev,Td,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,Sv,kv,Ev,Av,_v,Rv,Lv,Iv,Mv,Dv,Nv,Ov,$v,Pv,Bv,Fv,zv,Gv,Wv,qv,Vv,Uv,Hv,Yv,Xv,jv,Kv,Zv,Qv,Jv,e2,t2,r2,n2,i2,a2,s2,o2,l2,c2,u2,h2,d2,f2,p2,g2,m2,y2,v2,b2,x2,T2,w2,C2,S2,k2,E2,A2,_2,R2,L2,I2,M2,D2,N2,O2,$2,P2,B2,F2,wd,e0,z2,G2,W2,eh,q2,V2,U2,H2,Y2,X2,j2;var th=Object.defineProperty,b=(t,e)=>th(t,"name",{value:e,configurable:!0}),Bc=(t,e)=>{for(var r in e)th(t,r,{get:e[r],enumerable:!0})};function kd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kC={exports:{}},A4e=kC.exports,rG;function _4e(){return rG||(rG=1,(function(t,e){(function(r,n){t.exports=n()})(A4e,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var R=["th","st","nd","rd"],O=_%100;return"["+_+(R[(O-20)%10]||R[O]||R[0])+"]"}},x=function(_,R,O){var D=String(_);return!D||D.length>=R?_:""+Array(R+1-D.length).join(O)+_},w={s:x,z:function(_){var R=-_.utcOffset(),O=Math.abs(R),D=Math.floor(O/60),N=O%60;return(R<=0?"+":"-")+x(D,2,"0")+":"+x(N,2,"0")},m:function _(R,O){if(R.date()1)return _(F[0])}else{var G=R.name;k[G]=R,N=G}return!D&&N&&(C=N),N||!D&&C},M=function(_,R){if(E(_))return _.clone();var O=typeof R=="object"?R:{};return O.date=_,O.args=arguments,new P(O)},I=w;I.l=L,I.i=E,I.w=function(_,R){return M(_,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var P=(function(){function _(O){this.$L=L(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[S]=!0}var R=_.prototype;return R.parse=function(O){this.$d=(function(D){var N=D.date,B=D.utc;if(N===null)return new Date(NaN);if(I.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var F=N.match(y);if(F){var G=F[2]-1||0,z=(F[7]||"0").substring(0,3);return B?new Date(Date.UTC(F[1],G,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)):new Date(F[1],G,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)}}return new Date(N)})(O),this.init()},R.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},R.$utils=function(){return I},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(O,D){var N=M(O);return this.startOf(D)<=N&&N<=this.endOf(D)},R.isAfter=function(O,D){return M(O){},"trace"),debug:b((...t)=>{},"debug"),info:b((...t)=>{},"info"),warn:b((...t)=>{},"warn"),error:b((...t)=>{},"error"),fatal:b((...t)=>{},"fatal")},Y6=b(function(t="fatal"){let e=Fc.fatal;typeof t=="string"?t.toLowerCase()in Fc&&(e=Fc[t]):typeof t=="number"&&(e=t),he.trace=()=>{},he.debug=()=>{},he.info=()=>{},he.warn=()=>{},he.error=()=>{},he.fatal=()=>{},e<=Fc.fatal&&(he.fatal=console.error?console.error.bind(console,_o("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",_o("FATAL"))),e<=Fc.error&&(he.error=console.error?console.error.bind(console,_o("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",_o("ERROR"))),e<=Fc.warn&&(he.warn=console.warn?console.warn.bind(console,_o("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",_o("WARN"))),e<=Fc.info&&(he.info=console.info?console.info.bind(console,_o("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",_o("INFO"))),e<=Fc.debug&&(he.debug=console.debug?console.debug.bind(console,_o("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_o("DEBUG"))),e<=Fc.trace&&(he.trace=console.debug?console.debug.bind(console,_o("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_o("TRACE")))},"setLogLevel"),_o=b(t=>`%c${ca().format("ss.SSS")} : ${t} : `,"format");const EC={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return EC.hue2rgb(a,i,t+1/3)*255;case"g":return EC.hue2rgb(a,i,t)*255;case"b":return EC.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},rh={};for(let t=0;t<=255;t++)rh[t]=$r.unit.dec2hex(t);const Ha={ALL:0,RGB:1,HSL:2};let L4e=class{constructor(){this.type=Ha.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Ha.ALL}is(e){return this.type===e}};class I4e{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new L4e}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Ha.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=$r.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=$r.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=$r.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=$r.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=$r.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=$r.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Ha.HSL)&&r!==void 0?r:(this._ensureHSL(),$r.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Ha.HSL)&&r!==void 0?r:(this._ensureHSL(),$r.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Ha.HSL)&&r!==void 0?r:(this._ensureHSL(),$r.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Ha.RGB)&&r!==void 0?r:(this._ensureRGB(),$r.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Ha.RGB)&&r!==void 0?r:(this._ensureRGB(),$r.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Ha.RGB)&&r!==void 0?r:(this._ensureRGB(),$r.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Ha.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Ha.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Ha.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Ha.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Ha.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Ha.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const AC=new I4e({r:0,g:0,b:0,a:0},"transparent"),s0={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(s0.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return AC.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${rh[Math.round(e)]}${rh[Math.round(r)]}${rh[Math.round(n)]}${rh[Math.round(i*255)]}`:`#${rh[Math.round(e)]}${rh[Math.round(r)]}${rh[Math.round(n)]}`}},Ed={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Ed.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return $r.channel.clamp.h(parseFloat(r)*.9);case"rad":return $r.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return $r.channel.clamp.h(parseFloat(r)*360)}}return $r.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Ed.re);if(!r)return;const[,n,i,a,s,o]=r;return AC.set({h:Ed._hue2deg(n),s:$r.channel.clamp.s(parseFloat(i)),l:$r.channel.clamp.l(parseFloat(a)),a:s?$r.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${$r.lang.round(e)}, ${$r.lang.round(r)}%, ${$r.lang.round(n)}%, ${i})`:`hsl(${$r.lang.round(e)}, ${$r.lang.round(r)}%, ${$r.lang.round(n)}%)`}},rb={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=rb.colors[t];if(e)return s0.parse(e)},stringify:t=>{const e=s0.stringify(t);for(const r in rb.colors)if(rb.colors[r]===e)return r}},nb={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(nb.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return AC.set({r:$r.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:$r.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:$r.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?$r.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${$r.lang.round(e)}, ${$r.lang.round(r)}, ${$r.lang.round(n)}, ${$r.lang.round(i)})`:`rgb(${$r.lang.round(e)}, ${$r.lang.round(r)}, ${$r.lang.round(n)})`}},el={format:{keyword:rb,hex:s0,rgb:nb,rgba:nb,hsl:Ed,hsla:Ed},parse:t=>{if(typeof t!="string")return t;const e=s0.parse(t)||nb.parse(t)||Ed.parse(t)||rb.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Ha.HSL)||t.data.r===void 0?Ed.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?nb.stringify(t):s0.stringify(t)},nG=(t,e)=>{const r=el.parse(t);for(const n in e)r[n]=$r.channel.clamp[n](e[n]);return el.stringify(r)},tl=(t,e,r=0,n=1)=>{if(typeof t!="number")return nG(t,{a:e});const i=AC.set({r:$r.channel.clamp.r(t),g:$r.channel.clamp.g(e),b:$r.channel.clamp.b(r),a:$r.channel.clamp.a(n)});return el.stringify(i)},X6=(t,e)=>$r.lang.round(el.parse(t)[e]),M4e=t=>{const{r:e,g:r,b:n}=el.parse(t),i=.2126*$r.channel.toLinear(e)+.7152*$r.channel.toLinear(r)+.0722*$r.channel.toLinear(n);return $r.lang.round(i)},D4e=t=>M4e(t)>=.5,ls=t=>!D4e(t),j6=(t,e,r)=>{const n=el.parse(t),i=n[e],a=$r.channel.clamp[e](i+r);return i!==a&&(n[e]=a),el.stringify(n)},st=(t,e)=>j6(t,"l",e),ot=(t,e)=>j6(t,"l",-e),iG=(t,e)=>j6(t,"a",-e),be=(t,e)=>{const r=el.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return nG(t,n)},N4e=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=el.parse(t),{r:o,g:l,b:u,a:h}=el.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,x=a*m+u*y,w=s*d+h*(1-d);return tl(v,T,x,w)},et=(t,e=100)=>{const r=el.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,N4e(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function aG(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Fi(BigInt.prototype.toString),fG=typeof Symbol>"u"?null:Fi(Symbol.prototype.toString),ua=Fi(Object.prototype.hasOwnProperty),sb=Fi(Object.prototype.toString),ha=Fi(RegExp.prototype.test),Ad=X4e(TypeError);function Fi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:ib;if(oG&&oG(t,null),!nh(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(z4e(e)||(e[n]=a),i=a)}t[i]=!0}return t}function j4e(t){for(let e=0;e/g),rSe=Ra(/\${[\w\W]*/g),nSe=Ra(/^data-[\-\w.\u00B7-\uFFFF]+$/),iSe=Ra(/^aria-[\-\w]+$/),vG=Ra(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),aSe=Ra(/^(?:\w+script|data):/i),sSe=Ra(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oSe=Ra(/^html$/i),lSe=Ra(/^[a-z][.\w]*(-[.\w]+)+$/i),bG=Ra(/<[/\w!]/g),xG=Ra(/<[/\w]/g),cSe=Ra(/<\/no(script|embed|frames)/i),uSe=Ra(/\/>/i),ao={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},hSe=function(){return typeof window>"u"?null:window},dSe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},TG=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ih=function(e,r,n,i){return ua(e,r)&&nh(e[r])?hn(i.base?cs(i.base):{},e[r],i.transform):n};function wG(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hSe();const e=Bt=>wG(Bt);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==ao.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=$l(f,"cloneNode"),g=$l(f,"remove"),m=$l(f,"nextSibling"),y=$l(f,"childNodes"),v=$l(f,"parentNode"),T=$l(f,"shadowRoot"),x=$l(f,"attributes"),w=s&&s.prototype?$l(s.prototype,"nodeType"):null,C=s&&s.prototype?$l(s.prototype,"nodeName"):null;if(typeof a=="function"){const Bt=r.createElement("template");Bt.content&&Bt.content.ownerDocument&&(r=Bt.content.ownerDocument)}let k,S="",E,L=!1,M=0;const I=function(){if(M>0)throw Ad('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},P=function(Oe){I(),M++;try{return k.createHTML(Oe)}finally{M--}},$=function(Oe){I(),M++;try{return k.createScriptURL(Oe)}finally{M--}},_=function(){return L||(E=dSe(d,i),L=!0),E},R=r,O=R.implementation,D=R.createNodeIterator,N=R.createDocumentFragment,B=R.getElementsByTagName,F=n.importNode;let G=TG();e.isSupported=typeof sG=="function"&&typeof v=="function"&&O&&O.createHTMLDocument!==void 0;const z=eSe,W=tSe,V=rSe,H=nSe,te=iSe,Y=aSe,se=sSe,J=lSe;let Z=vG,ee=null;const re=hn({},[...pG,...J6,...e_,...t_,...gG]);let ge=null;const ae=hn({},[...mG,...r_,...yG,..._C]);let _e=Object.seal(o0(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Fe=null,qe=null;const ue=Object.seal(o0(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,Ce=!0,me=!1,$e=!0,we=!1,Le=!0,Ye=!1,ce=!1,ye=null,ke=null,le=!1,pe=!1,U=!1,oe=!1,Q=!0,fe=!1;const j="user-content-";let Be=!0,Se=!1,He={},De=null;const We=hn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ne=null;const Ze=hn({},["audio","video","img","source","image","track"]);let Pe=null;const nt=hn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ie="http://www.w3.org/1998/Math/MathML",pt="http://www.w3.org/2000/svg",Re="http://www.w3.org/1999/xhtml";let kt=Re,bt=!1,lt=null;const Nt=hn({},[Ie,pt,Re],Q6),Ct=_a(["mi","mo","mn","ms","mtext"]);let dt=hn({},Ct);const ve=_a(["annotation-xml"]);let _t=hn({},ve);const gt=hn({},["title","style","font","a","script"]);let ft=null;const Et=["application/xhtml+xml","text/html"],Nr="text/html";let Ae=null,tt=null;const ct=r.createElement("form"),Mt=function(Oe){return Oe instanceof RegExp||Oe instanceof Function},Wt=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===Oe)return;(!Oe||typeof Oe!="object")&&(Oe={}),Oe=cs(Oe),ft=Et.indexOf(Oe.PARSER_MEDIA_TYPE)===-1?Nr:Oe.PARSER_MEDIA_TYPE,Ae=ft==="application/xhtml+xml"?Q6:ib,ee=ih(Oe,"ALLOWED_TAGS",re,{transform:Ae}),ge=ih(Oe,"ALLOWED_ATTR",ae,{transform:Ae}),lt=ih(Oe,"ALLOWED_NAMESPACES",Nt,{transform:Q6}),Pe=ih(Oe,"ADD_URI_SAFE_ATTR",nt,{transform:Ae,base:nt}),Ne=ih(Oe,"ADD_DATA_URI_TAGS",Ze,{transform:Ae,base:Ze}),De=ih(Oe,"FORBID_CONTENTS",We,{transform:Ae}),Fe=ih(Oe,"FORBID_TAGS",cs({}),{transform:Ae}),qe=ih(Oe,"FORBID_ATTR",cs({}),{transform:Ae}),He=ua(Oe,"USE_PROFILES")?Oe.USE_PROFILES&&typeof Oe.USE_PROFILES=="object"?cs(Oe.USE_PROFILES):Oe.USE_PROFILES:!1,de=Oe.ALLOW_ARIA_ATTR!==!1,Ce=Oe.ALLOW_DATA_ATTR!==!1,me=Oe.ALLOW_UNKNOWN_PROTOCOLS||!1,$e=Oe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=Oe.SAFE_FOR_TEMPLATES||!1,Le=Oe.SAFE_FOR_XML!==!1,Ye=Oe.WHOLE_DOCUMENT||!1,pe=Oe.RETURN_DOM||!1,U=Oe.RETURN_DOM_FRAGMENT||!1,oe=Oe.RETURN_TRUSTED_TYPE||!1,le=Oe.FORCE_BODY||!1,Q=Oe.SANITIZE_DOM!==!1,fe=Oe.SANITIZE_NAMED_PROPS||!1,Be=Oe.KEEP_CONTENT!==!1,Se=Oe.IN_PLACE||!1,Z=Z4e(Oe.ALLOWED_URI_REGEXP)?Oe.ALLOWED_URI_REGEXP:vG,kt=typeof Oe.NAMESPACE=="string"?Oe.NAMESPACE:Re,dt=ua(Oe,"MATHML_TEXT_INTEGRATION_POINTS")&&Oe.MATHML_TEXT_INTEGRATION_POINTS&&typeof Oe.MATHML_TEXT_INTEGRATION_POINTS=="object"?cs(Oe.MATHML_TEXT_INTEGRATION_POINTS):hn({},Ct),_t=ua(Oe,"HTML_INTEGRATION_POINTS")&&Oe.HTML_INTEGRATION_POINTS&&typeof Oe.HTML_INTEGRATION_POINTS=="object"?cs(Oe.HTML_INTEGRATION_POINTS):hn({},ve);const rt=ua(Oe,"CUSTOM_ELEMENT_HANDLING")&&Oe.CUSTOM_ELEMENT_HANDLING&&typeof Oe.CUSTOM_ELEMENT_HANDLING=="object"?cs(Oe.CUSTOM_ELEMENT_HANDLING):o0(null);if(_e=o0(null),ua(rt,"tagNameCheck")&&Mt(rt.tagNameCheck)&&(_e.tagNameCheck=rt.tagNameCheck),ua(rt,"attributeNameCheck")&&Mt(rt.attributeNameCheck)&&(_e.attributeNameCheck=rt.attributeNameCheck),ua(rt,"allowCustomizedBuiltInElements")&&typeof rt.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=rt.allowCustomizedBuiltInElements),Ra(_e),we&&(Ce=!1),U&&(pe=!0),He&&(ee=hn({},gG),ge=o0(null),He.html===!0&&(hn(ee,pG),hn(ge,mG)),He.svg===!0&&(hn(ee,J6),hn(ge,r_),hn(ge,_C)),He.svgFilters===!0&&(hn(ee,e_),hn(ge,r_),hn(ge,_C)),He.mathMl===!0&&(hn(ee,t_),hn(ge,yG),hn(ge,_C))),ue.tagCheck=null,ue.attributeCheck=null,ua(Oe,"ADD_TAGS")&&(typeof Oe.ADD_TAGS=="function"?ue.tagCheck=Oe.ADD_TAGS:nh(Oe.ADD_TAGS)&&(ee===re&&(ee=cs(ee)),hn(ee,Oe.ADD_TAGS,Ae))),ua(Oe,"ADD_ATTR")&&(typeof Oe.ADD_ATTR=="function"?ue.attributeCheck=Oe.ADD_ATTR:nh(Oe.ADD_ATTR)&&(ge===ae&&(ge=cs(ge)),hn(ge,Oe.ADD_ATTR,Ae))),ua(Oe,"ADD_URI_SAFE_ATTR")&&nh(Oe.ADD_URI_SAFE_ATTR)&&hn(Pe,Oe.ADD_URI_SAFE_ATTR,Ae),ua(Oe,"FORBID_CONTENTS")&&nh(Oe.FORBID_CONTENTS)&&(De===We&&(De=cs(De)),hn(De,Oe.FORBID_CONTENTS,Ae)),ua(Oe,"ADD_FORBID_CONTENTS")&&nh(Oe.ADD_FORBID_CONTENTS)&&(De===We&&(De=cs(De)),hn(De,Oe.ADD_FORBID_CONTENTS,Ae)),Be&&(ee["#text"]=!0),Ye&&hn(ee,["html","head","body"]),ee.table&&(hn(ee,["tbody"]),delete Fe.tbody),Oe.TRUSTED_TYPES_POLICY){if(typeof Oe.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ad('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Oe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ad('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const St=k;k=Oe.TRUSTED_TYPES_POLICY;try{S=P("")}catch(Ut){throw k=St,Ut}}else Oe.TRUSTED_TYPES_POLICY===null?(k=void 0,S=""):(k===void 0&&(k=_()),k&&typeof S=="string"&&(S=P("")));_a&&_a(Oe),tt=Oe},gr=hn({},[...J6,...e_,...Q4e]),lr=hn({},[...t_,...J4e]),Tr=function(Oe,rt,St){return rt.namespaceURI===Re?Oe==="svg":rt.namespaceURI===Ie?Oe==="svg"&&(St==="annotation-xml"||dt[St]):!!gr[Oe]},fr=function(Oe,rt,St){return rt.namespaceURI===Re?Oe==="math":rt.namespaceURI===pt?Oe==="math"&&_t[St]:!!lr[Oe]},Or=function(Oe,rt,St){return rt.namespaceURI===pt&&!_t[St]||rt.namespaceURI===Ie&&!dt[St]?!1:!lr[Oe]&&(gt[Oe]||!gr[Oe])},ir=function(Oe){let rt=v(Oe);(!rt||!rt.tagName)&&(rt={namespaceURI:kt,tagName:"template"});const St=ib(Oe.tagName),Ut=ib(rt.tagName);return lt[Oe.namespaceURI]?Oe.namespaceURI===pt?Tr(St,rt,Ut):Oe.namespaceURI===Ie?fr(St,rt,Ut):Oe.namespaceURI===Re?Or(St,rt,Ut):!!(ft==="application/xhtml+xml"&<[Oe.namespaceURI]):!1},cr=function(Oe){c0(e.removed,{element:Oe});try{v(Oe).removeChild(Oe)}catch{if(g(Oe),!v(Oe))throw Ad("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vr=function(Oe){zt(Oe);const rt=y(Oe);if(rt){const Ut=[];l0(rt,er=>{c0(Ut,er)}),l0(Ut,er=>{try{g(er)}catch{}})}const St=x(Oe);if(St)for(let Ut=St.length-1;Ut>=0;--Ut){const er=St[Ut],xr=er&&er.name;if(typeof xr=="string")try{Oe.removeAttribute(xr)}catch{}}},at=function(Oe,rt){try{c0(e.removed,{attribute:rt.getAttributeNode(Oe),from:rt})}catch{c0(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Oe),Oe==="is")if(pe||U)try{cr(rt)}catch{}else try{rt.setAttribute(Oe,"")}catch{}},vt=function(Oe){const rt=x(Oe);if(rt)for(let St=rt.length-1;St>=0;--St){const Ut=rt[St],er=Ut&&Ut.name;if(!(typeof er!="string"||ge[Ae(er)]))try{Oe.removeAttribute(er)}catch{}}},zt=function(Oe){const rt=[Oe];for(;rt.length>0;){const St=rt.pop();(w?w(St):St.nodeType)===ao.element&&vt(St);const er=y(St);if(er)for(let xr=er.length-1;xr>=0;--xr)rt.push(er[xr])}},br=function(Oe){if(!Le)return;const rt=[Oe];for(;rt.length>0;){const St=rt.pop(),Ut=w?w(St):St.nodeType;if(Ut===ao.processingInstruction||Ut===ao.comment&&ha(xG,St.data)){try{g(St)}catch{}continue}if(Ut===ao.element){const xr=St,Dn=Ae(C?C(St):St.nodeName);try{xr.hasAttribute&&xr.hasAttribute("patchsrc")&&xr.removeAttribute("patchsrc"),xr.hasAttribute&&xr.hasAttribute("for")&&Dn!=="label"&&Dn!=="output"&&xr.removeAttribute("for")}catch{}}const er=y(St);if(er)for(let xr=er.length-1;xr>=0;--xr)rt.push(er[xr])}},Wr=function(Oe){let rt=null,St=null;if(le)Oe=""+Oe;else{const xr=uG(Oe,/^[\r\n\t ]+/);St=xr&&xr[0]}ft==="application/xhtml+xml"&&kt===Re&&(Oe=''+Oe+"");const Ut=k?P(Oe):Oe;if(kt===Re)try{rt=new h().parseFromString(Ut,ft)}catch{}if(!rt||!rt.documentElement){rt=O.createDocument(kt,"template",null);try{rt.documentElement.innerHTML=bt?S:Ut}catch{}}const er=rt.body||rt.documentElement;return Oe&&St&&er.insertBefore(r.createTextNode(St),er.childNodes[0]||null),kt===Re?B.call(rt,Ye?"html":"body")[0]:Ye?rt.documentElement:er},xt=function(Oe){return D.call(Oe.ownerDocument||Oe,Oe,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ht=function(Oe){return Oe=ab(Oe,z," "),Oe=ab(Oe,W," "),Oe=ab(Oe,V," "),Oe},Rt=function(Oe){var rt;Oe.normalize();const St=D.call(Oe.ownerDocument||Oe,Oe,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Ut=St.nextNode();for(;Ut;)Ut.data=ht(Ut.data),Ut=St.nextNode();const er=(rt=Oe.querySelectorAll)===null||rt===void 0?void 0:rt.call(Oe,"template");er&&l0(er,xr=>{Kt(xr.content)&&Rt(xr.content)})},ut=function(Oe){const rt=C?C(Oe):null;return typeof rt!="string"||Ae(rt)!=="form"?!1:typeof Oe.nodeName!="string"||typeof Oe.textContent!="string"||typeof Oe.removeChild!="function"||Oe.attributes!==x(Oe)||typeof Oe.removeAttribute!="function"||typeof Oe.setAttribute!="function"||typeof Oe.namespaceURI!="string"||typeof Oe.insertBefore!="function"||typeof Oe.hasChildNodes!="function"||Oe.nodeType!==w(Oe)||Oe.childNodes!==y(Oe)},Kt=function(Oe){if(!w||typeof Oe!="object"||Oe===null)return!1;try{return w(Oe)===ao.documentFragment}catch{return!1}},Me=function(Oe){if(!w||typeof Oe!="object"||Oe===null)return!1;try{return typeof w(Oe)=="number"}catch{return!1}};function Yr(Bt,Oe,rt){Bt.length!==0&&l0(Bt,St=>{St.call(e,Oe,rt,tt)})}const ze=function(Oe,rt){return!!(Le&&Oe.hasChildNodes()&&!Me(Oe.firstElementChild)&&ha(bG,Oe.textContent)&&ha(bG,Oe.innerHTML)||Le&&Oe.namespaceURI===Re&&rt==="style"&&Me(Oe.firstElementChild)||Oe.nodeType===ao.processingInstruction||Le&&Oe.nodeType===ao.comment&&ha(xG,Oe.data))},Fr=function(Oe,rt){if(!Fe[rt]&&cn(rt)&&(_e.tagNameCheck instanceof RegExp&&ha(_e.tagNameCheck,rt)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(rt)))return!1;if(Be&&!De[rt]){const St=v(Oe),Ut=y(Oe);if(Ut&&St){const er=Ut.length;for(let xr=er-1;xr>=0;--xr){const Dn=Se?Ut[xr]:p(Ut[xr],!0);St.insertBefore(Dn,m(Oe))}}}return cr(Oe),!0},nn=function(Oe,rt){if(Yr(G.beforeSanitizeElements,Oe,null),Oe!==rt&&v(Oe)===null)return!0;if(ut(Oe))return cr(Oe),!0;const St=Ae(C?C(Oe):Oe.nodeName);if(Yr(G.uponSanitizeElement,Oe,{tagName:St,allowedTags:ee}),Oe!==rt&&v(Oe)===null)return!0;if(ze(Oe,St))return cr(Oe),!0;if(Fe[St]||!(ue.tagCheck instanceof Function&&ue.tagCheck(St))&&!ee[St]){const er=Fr(Oe,St);return er===!1&&Yr(G.afterSanitizeElements,Oe,null),er}if((w?w(Oe):Oe.nodeType)===ao.element&&!ir(Oe)||(St==="noscript"||St==="noembed"||St==="noframes")&&ha(cSe,Oe.innerHTML))return cr(Oe),!0;if(we&&Oe.nodeType===ao.text){const er=ht(Oe.textContent);Oe.textContent!==er&&(c0(e.removed,{element:Oe.cloneNode()}),Oe.textContent=er)}return Yr(G.afterSanitizeElements,Oe,null),!1},_i=function(Oe,rt,St){if(qe[rt]||Le&&rt==="patchsrc"||Le&&rt==="for"&&Oe!=="label"&&Oe!=="output"||Q&&(rt==="id"||rt==="name")&&(St in r||St in ct))return!1;const Ut=ge[rt]||ue.attributeCheck instanceof Function&&ue.attributeCheck(rt,Oe);if(!(Ce&&ha(H,rt))){if(!(de&&ha(te,rt))){if(Ut){if(!Pe[rt]){if(!ha(Z,ab(St,se,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Oe!=="script"&&hG(St,"data:")===0&&Ne[Oe])){if(!(me&&!ha(Y,ab(St,se,"")))){if(St)return!1}}}}}else if(!(cn(Oe)&&(_e.tagNameCheck instanceof RegExp&&ha(_e.tagNameCheck,Oe)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Oe))&&(_e.attributeNameCheck instanceof RegExp&&ha(_e.attributeNameCheck,rt)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(rt,Oe))||rt==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&ha(_e.tagNameCheck,St)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(St))))return!1}}return!0},ln=hn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),cn=function(Oe){return!ln[ib(Oe)]&&ha(J,Oe)},Xr=function(Oe,rt,St,Ut){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!St)switch(d.getAttributeType(Oe,rt)){case"TrustedHTML":return P(Ut);case"TrustedScriptURL":return $(Ut)}return Ut},Ea=function(Oe,rt,St,Ut){try{St?Oe.setAttributeNS(St,rt,Ut):Oe.setAttribute(rt,Ut),ut(Oe)?cr(Oe):cG(e.removed)}catch{at(rt,Oe)}},Bs=function(Oe){Yr(G.beforeSanitizeAttributes,Oe,null);const rt=Oe.attributes;if(!rt||ut(Oe))return;const St={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let Ut=rt.length;const er=Ae(Oe.nodeName);for(;Ut--;){const xr=rt[Ut],Dn=xr.name,Nn=xr.namespaceURI,os=xr.value,fn=Ae(Dn),Aa=os;let bn=Dn==="value"?Aa:U4e(Aa);if(St.attrName=fn,St.attrValue=bn,St.keepAttr=!0,St.forceKeepAttr=void 0,Yr(G.uponSanitizeAttribute,Oe,St),bn=St.attrValue,fe&&(fn==="id"||fn==="name")&&hG(bn,j)!==0&&(at(Dn,Oe),bn=j+bn),Le&&ha(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,bn)){at(Dn,Oe);continue}if(fn==="attributename"&&uG(bn,"href")){at(Dn,Oe);continue}if(!St.forceKeepAttr){if(!St.keepAttr){at(Dn,Oe);continue}if(!$e&&ha(uSe,bn)){at(Dn,Oe);continue}if(we&&(bn=ht(bn)),!_i(er,fn,bn)){at(Dn,Oe);continue}bn=Xr(er,fn,Nn,bn),bn!==Aa&&Ea(Oe,Dn,Nn,bn)}}Yr(G.afterSanitizeAttributes,Oe,null)},io=function(Oe){let rt=null;const St=xt(Oe);for(Yr(G.beforeSanitizeShadowDOM,Oe,null);rt=St.nextNode();)if(Yr(G.uponSanitizeShadowNode,rt,null),nn(rt,Oe),Bs(rt),Kt(rt.content)&&io(rt.content),(w?w(rt):rt.nodeType)===ao.element){const er=T(rt);Kt(er)&&(Oc(er),io(er))}Yr(G.afterSanitizeShadowDOM,Oe,null)},Oc=function(Oe){const rt=[{node:Oe,shadow:null}];for(;rt.length>0;){const St=rt.pop();if(St.shadow){io(St.shadow);continue}const Ut=St.node,xr=(w?w(Ut):Ut.nodeType)===ao.element,Dn=y(Ut);if(Dn)for(let Nn=Dn.length-1;Nn>=0;--Nn)rt.push({node:Dn[Nn],shadow:null});if(xr){const Nn=C?C(Ut):null;if(typeof Nn=="string"&&Ae(Nn)==="template"){const os=Ut.content;Kt(os)&&rt.push({node:os,shadow:null})}}if(xr){const Nn=T(Ut);Kt(Nn)&&rt.push({node:null,shadow:Nn},{node:Nn,shadow:null})}}};return e.sanitize=function(Bt){let Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,St=null,Ut=null,er=null;if(bt=!Bt,bt&&(Bt=""),typeof Bt!="string"&&!Me(Bt)&&(Bt=K4e(Bt),typeof Bt!="string"))throw Ad("dirty is not a string, aborting");if(!e.isSupported)return Bt;ce?(ee=ye,ge=ke):Wt(Oe),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ee=cs(ee)),G.uponSanitizeAttribute.length>0&&(ge=cs(ge)),e.removed=[];const xr=Se&&typeof Bt!="string"&&Me(Bt);if(xr){br(Bt);const fn=C?C(Bt):Bt.nodeName;if(typeof fn=="string"){const Aa=Ae(fn);if(!ee[Aa]||Fe[Aa])throw Vr(Bt),Ad("root node is forbidden and cannot be sanitized in-place")}if(ut(Bt))throw Vr(Bt),Ad("root node is clobbered and cannot be sanitized in-place");try{Oc(Bt)}catch(Aa){throw Vr(Bt),Aa}}else if(Me(Bt))rt=Wr(""),St=rt.ownerDocument.importNode(Bt,!0),St.nodeType===ao.element&&St.nodeName==="BODY"||St.nodeName==="HTML"?rt=St:rt.appendChild(St),Oc(St);else{if(!pe&&!we&&!Ye&&Bt.indexOf("<")===-1)return k&&oe?P(Bt):Bt;if(rt=Wr(Bt),!rt)return pe?null:oe?S:""}rt&&le&&cr(rt.firstChild);const Dn=xr?Bt:rt,Nn=xt(Dn);try{for(;Ut=Nn.nextNode();)nn(Ut,Dn),Bs(Ut),Kt(Ut.content)&&io(Ut.content)}catch(fn){throw xr&&(Vr(Bt),l0(e.removed,Aa=>{Aa.element&&zt(Aa.element)})),fn}if(xr)return l0(e.removed,fn=>{fn.element&&zt(fn.element)}),we&&Rt(Bt),Bt;if(pe){if(we&&Rt(rt),U)for(er=N.call(rt.ownerDocument);rt.firstChild;)er.appendChild(rt.firstChild);else er=rt;return(ge.shadowroot||ge.shadowrootmode)&&(er=F.call(n,er,!0)),er}let os=Ye?rt.outerHTML:rt.innerHTML;return Ye&&ee["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&ha(oSe,rt.ownerDocument.doctype.name)&&(os=" +`+os),we&&(os=ht(os)),k&&oe?P(os):os},e.setConfig=function(){let Bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wt(Bt),ce=!0,ye=ee,ke=ge},e.clearConfig=function(){tt=null,ce=!1,ye=null,ke=null,k=E,S=""},e.isValidAttribute=function(Bt,Oe,rt){tt||Wt({});const St=Ae(Bt),Ut=Ae(Oe);return _i(St,Ut,rt)},e.addHook=function(Bt,Oe){typeof Oe=="function"&&ua(G,Bt)&&c0(G[Bt],Oe)},e.removeHook=function(Bt,Oe){if(ua(G,Bt)){if(Oe!==void 0){const rt=q4e(G[Bt],Oe);return rt===-1?void 0:V4e(G[Bt],rt,1)[0]}return cG(G[Bt])}},e.removeHooks=function(Bt){ua(G,Bt)&&(G[Bt]=[])},e.removeAllHooks=function(){G=TG()},e}var zc=wG(),n_=b((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>n_(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=n_(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),Ri=n_,Pl="#ffffff",Bl="#f2f2f2",Lr=b((t,e)=>e?be(t,{s:-40,l:10}):be(t,{s:-40,l:-10}),"mkBorder"),fSe=(f1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w,C,k,S,E,L,M,I,P,$,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge,ae;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||ot(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let _e=0;_e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(f1,"Theme"),f1),pSe=b(t=>{const e=new fSe;return e.calculate(t),e},"getThemeVariables"),gSe=(p1=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=tl(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=ot("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ot(this.sectionBkgColor,10),this.taskBorderColor=tl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=tl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w,C,k,S,E,L,M,I,P,$,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge;this.secondBkg=st(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=st(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=st(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=et(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=be(this.primaryColor,{h:64}),this.fillType3=be(this.secondaryColor,{h:64}),this.fillType4=be(this.primaryColor,{h:-64}),this.fillType5=be(this.secondaryColor,{h:-64}),this.fillType6=be(this.primaryColor,{h:128}),this.fillType7=be(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330});for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(p1,"Theme"),p1),mSe=b(t=>{const e=new gSe;return e.calculate(t),e},"getThemeVariables"),ySe=(g1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=be(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=tl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w,C,k,S,E,L,M,I,P,$,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let ae=0;ae{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(g1,"Theme"),g1),Gc=b(t=>{const e=new ySe;return e.calculate(t),e},"getThemeVariables"),vSe=(m1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=st("#cde498",10),this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.primaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w,C,k,S,E,L,M,I,P,$,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge;this.actorBorder=ot(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(m1,"Theme"),m1),bSe=b(t=>{const e=new vSe;return e.calculate(t),e},"getThemeVariables"),xSe=(y1=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w,C,k,S,E,L,M,I,P,$,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge;this.secondBkg=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(y1,"Theme"),y1),TSe=b(t=>{const e=new xSe;return e.calculate(t),e},"getThemeVariables"),wSe=(v1=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=be(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||be(e,{h:30}),this.cScale4=this.cScale4||be(e,{h:60}),this.cScale5=this.cScale5||be(e,{h:90}),this.cScale6=this.cScale6||be(e,{h:120}),this.cScale7=this.cScale7||be(e,{h:150}),this.cScale8=this.cScale8||be(e,{h:210,l:150}),this.cScale9=this.cScale9||be(e,{h:270}),this.cScale10=this.cScale10||be(e,{h:300}),this.cScale11=this.cScale11||be(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(v1,"Theme"),v1),CSe=b(t=>{const e=new wSe;return e.calculate(t),e},"getThemeVariables"),SSe=(b1=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=tl(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(b1,"Theme"),b1),kSe=b(t=>{const e=new SSe;return e.calculate(t),e},"getThemeVariables"),ESe=(x1=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Lr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=be(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(x1,"Theme"),x1),ASe=b(t=>{const e=new ESe;return e.calculate(t),e},"getThemeVariables"),_Se=(T1=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=tl(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(T1,"Theme"),T1),RSe=b(t=>{const e=new _Se;return e.calculate(t),e},"getThemeVariables"),LSe=(w1=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Lr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=be(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(w1,"Theme"),w1),ISe=b(t=>{const e=new LSe;return e.calculate(t),e},"getThemeVariables"),MSe=(C1=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Lr(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=tl(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Lr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Lr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Lr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Lr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},b(C1,"Theme"),C1),DSe=b(t=>{const e=new MSe;return e.calculate(t),e},"getThemeVariables"),Wc={base:{getThemeVariables:pSe},dark:{getThemeVariables:mSe},default:{getThemeVariables:Gc},forest:{getThemeVariables:bSe},neutral:{getThemeVariables:TSe},neo:{getThemeVariables:CSe},"neo-dark":{getThemeVariables:kSe},redux:{getThemeVariables:ASe},"redux-dark":{getThemeVariables:RSe},"redux-color":{getThemeVariables:ISe},"redux-dark-color":{getThemeVariables:DSe}},La={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},CG={...La,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Wc.default.getThemeVariables(),sequence:{...La.sequence,messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:b(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:b(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...La.gantt,tickInterval:void 0,useWidth:void 0},c4:{...La.c4,useWidth:void 0,personFont:b(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...La.flowchart,inheritDir:!1},external_personFont:b(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:b(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:b(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:b(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:b(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:b(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:b(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:b(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:b(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:b(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:b(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:b(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:b(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:b(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:b(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:b(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:b(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:b(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:b(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:b(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...La.pie,useWidth:984},xyChart:{...La.xyChart,useWidth:void 0},requirement:{...La.requirement,useWidth:void 0},packet:{...La.packet},eventmodeling:{...La.eventmodeling},treeView:{...La.treeView,useWidth:void 0},radar:{...La.radar},railroad:{...La.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...La.ishikawa},sankey:{...La.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...La.venn},cynefin:{...La.cynefin}},SG=b((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...SG(t[n],"")]:[...r,e+n],[]),"keyify"),NSe=new Set(SG(CG,"")),jr=CG,OSe={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},$Se=b((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(he.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),RC=b(t=>{if(he.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>RC(e));return}for(const e of Object.keys(t)){if(he.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!NSe.has(e)||t[e]==null){he.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=OSe[e];n?$Se(t[e],n):(he.debug("sanitizing object",e),RC(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(he.debug("sanitizing css option",e),t[e]=kG(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}he.debug("After sanitization",t)}},"sanitizeDirective"),kG=b(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Fs=Ri({},u0),LC,_d=[],ob=Ri({},u0),IC=b((t,e)=>{let r=Ri({},t),n={};for(const i of e)_G(i),n=Ri(n,i);if(r=Ri(r,n),n.theme&&n.theme in Wc){const i=Ri({},LC),a=Ri(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Wc&&(r.themeVariables=Wc[r.theme].getThemeVariables(a))}return ob=r,IG(ob),ob},"updateCurrentConfig"),PSe=b(t=>(Fs=Ri({},u0),Fs=Ri(Fs,t),t.theme&&Wc[t.theme]&&(Fs.themeVariables=Wc[t.theme].getThemeVariables(t.themeVariables)),IC(Fs,_d),Fs),"setSiteConfig"),BSe=b(t=>{LC=Ri({},t)},"saveConfigFromInitialize"),FSe=b(t=>(Fs=Ri(Fs,t),IC(Fs,_d),Fs),"updateSiteConfig"),EG=b(()=>Ri({},Fs),"getSiteConfig"),AG=b(t=>(IG(t),Ri(ob,t),sr()),"setConfig"),sr=b(()=>Ri({},ob),"getConfig"),_G=b(t=>{t&&(["secure",...Fs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(he.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&_G(t[e])}))},"sanitize"),zSe=b(t=>{var e;RC(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),_d.push(t),IC(Fs,_d)},"addDirective"),MC=b((t=Fs)=>{_d=[],IC(t,_d)},"reset"),GSe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},RG={},LG=b(t=>{RG[t]||(he.warn(GSe[t]),RG[t]=!0)},"issueWarning"),IG=b(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&LG("LAZY_LOAD_DEPRECATED")},"checkConfig"),MG=b(()=>{let t={};LC&&(t=Ri(t,LC));for(const e of _d)t=Ri(t,e);return t},"getUserDefinedConfig"),An=b(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&LG("FLOWCHART_HTML_LABELS_DEPRECATED"),Fl(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),DG=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,lb=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,WSe=/\s*%%.*\n/gm,NG=(S1=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},b(S1,"UnknownDiagramError"),S1),Rd={},i_=b(function(t,e){t=t.replace(DG,"").replace(lb,"").replace(WSe,` +`);for(const[r,{detector:n}]of Object.entries(Rd))if(n(t,e))return r;throw new NG(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),a_=b((...t)=>{for(const{id:e,detector:r,loader:n}of t)OG(e,r,n)},"registerLazyLoadedDiagrams"),OG=b((t,e,r)=>{Rd[t]&&he.warn(`Detector with key ${t} already exists. Overwriting.`),Rd[t]={detector:e,loader:r},he.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),qSe=b(t=>Rd[t].loader,"getDiagramLoader"),h0=//gi,VSe=b(t=>t?FG(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),USe=(()=>{let t=!1;return()=>{t||($G(),t=!0)}})();function $G(){const t="data-temp-href-target";zc.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),zc.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}b($G,"setupDompurifyHooks");var PG=b(t=>(USe(),zc.sanitize(t)),"removeScript"),BG=b((t,e)=>{if(An(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=PG(t):r!=="loose"&&(t=FG(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=jSe(t))}return t},"sanitizeMore"),Qr=b((t,e)=>t&&(e.dompurifyConfig?t=zc.sanitize(BG(t,e),e.dompurifyConfig).toString():t=zc.sanitize(BG(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),HSe=b((t,e)=>typeof t=="string"?Qr(t,e):t.flat().map(r=>Qr(r,e)),"sanitizeTextOrArray"),YSe=b(t=>h0.test(t),"hasBreaks"),XSe=b(t=>t.split(h0),"splitBreaks"),jSe=b(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),FG=b(t=>t.replace(h0,"#br#"),"breakToPlaceholder"),DC=b(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),KSe=b(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),ZSe=b(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),ah=b(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),QSe=b((t,e)=>{const r=s_(t,"~"),n=s_(e,"~");return r===1&&n===1},"shouldCombineSets"),JSe=b(t=>{const e=s_(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),zG=b(()=>window.MathMLElement!==void 0,"isMathMLSupported"),o_=/\$\$(.*?)\$\$/g,Li=b(t=>{var e;return(((e=t.match(o_))==null?void 0:e.length)??0)>0},"hasKatex"),cb=b(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await NC(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),eke=b(async(t,e)=>{if(!Li(t))return t;if(!(zG()||e.legacyMathML||e.forceLegacyMathML))return t.replace(o_,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>DOe),n=e.forceLegacyMathML||!zG()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(h0).map(i=>Li(i)?`
${i}
`:`
${i}
`).join("").replace(o_,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),NC=b(async(t,e)=>Qr(await eke(t,e),e),"renderKatexSanitized"),$t={getRows:VSe,sanitizeText:Qr,sanitizeTextOrArray:HSe,hasBreaks:YSe,splitBreaks:XSe,lineBreakRegex:h0,removeScript:PG,getUrl:DC,evaluate:Fl,getMax:KSe,getMin:ZSe},tke=b(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),rke=b(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),bi=b(function(t,e,r,n){const i=rke(e,r,n);tke(t,i)},"configureSvgSize"),d0=b(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;he.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;he.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,he.info(`Calculated bounds: ${o}x${l}`),bi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),OC={};function l_(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}b(l_,"cssStyleSheetToString");var nke=b((t,e,r,n)=>{let i="";return t in OC&&OC[t]?i=OC[t]({...r,svgId:n}):he.warn(`No theme found for ${t}`),` & { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -84,6 +84,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } + [data-look="neo"].swimlane.cluster rect { + filter: none; + } [data-look="neo"].node path { @@ -120,49 +123,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),Fxe=T((t,e)=>{e!==void 0&&(Ow[t]=e)},"addStylesForDiagram"),zxe=Bxe,P6={};Ew(P6,{clear:()=>Dn,getAccDescription:()=>Vn,getAccTitle:()=>Gn,getDiagramTitle:()=>Nn,setAccDescription:()=>qn,setAccTitle:()=>Mn,setDiagramTitle:()=>Wn});var B6="",F6="",z6="",G6=T(t=>qr(t,lr()),"sanitizeText"),Dn=T(()=>{B6="",z6="",F6=""},"clear"),Mn=T(t=>{B6=G6(t).replace(/^\s+/g,"")},"setAccTitle"),Gn=T(()=>B6,"getAccTitle"),qn=T(t=>{z6=G6(t).replace(/\n\s+/g,` -`)},"setAccDescription"),Vn=T(()=>z6,"getAccDescription"),Wn=T(t=>{F6=G6(t)},"setDiagramTitle"),Nn=T(()=>F6,"getDiagramTitle"),YB=ae,Gxe=T6,$e=lr,q6=PB,XB=Ep,V6=T(t=>qr(t,$e()),"sanitizeText"),W6=Ap,qxe=T(()=>P6,"getCommonDb"),$w={},Pw=T((t,e,r)=>{var n;$w[t]&&YB.warn(`Diagram with id ${t} already registered. Overwriting.`),$w[t]=e,r&&DB(t,r),Fxe(t,e.styles),(n=e.injectUtils)==null||n.call(e,YB,Gxe,$e,V6,W6,qxe(),()=>{})},"registerDiagram"),U6=T(t=>{if(t in $w)return $w[t];throw new Vxe(t)},"getDiagram"),Vxe=(Lm=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},T(Lm,"DiagramNotFoundError"),Lm);function Bw(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Wxe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function H6(t){let e,r,n;t.length!==2?(e=Bw,r=(o,l)=>Bw(t(o),l),n=(o,l)=>t(o)-l):(e=t===Bw||t===Wxe?t:Uxe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function Uxe(){return 0}function Hxe(t){return t===null?NaN:+t}const Yxe=H6(Bw).right;H6(Hxe).center;class KB extends Map{constructor(e,r=jxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(jB(this,e))}has(e){return super.has(jB(this,e))}set(e,r){return super.set(Xxe(this,e),r)}delete(e){return super.delete(Kxe(this,e))}}function jB({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Xxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Kxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function jxe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Zxe=Math.sqrt(50),Qxe=Math.sqrt(10),Jxe=Math.sqrt(2);function Fw(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Zxe?10:a>=Qxe?5:a>=Jxe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function rTe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function nTe(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function lTe(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function cTe(){return!this.__axis}function QB(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===zw||t===Gw?-1:1,h=t===Gw||t===K6?"x":"y",d=t===zw||t===j6?aTe:sTe;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):iTe),y=Math.max(a,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?lTe:oTe)(e.copy(),l),k=p.selection?p.selection():p,S=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),_=C.exit(),L=C.enter().append("g").attr("class","tick"),O=C.select("line"),D=C.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(L),O=O.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),D=D.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===zw?"0em":t===j6?"0.71em":"0.32em")),p!==k&&(S=S.transition(p),C=C.transition(p),O=O.transition(p),D=D.transition(p),_=_.transition(p).attr("opacity",ZB).attr("transform",function(z){return isFinite(z=w(z))?d(z+l):this.getAttribute("transform")}),L.attr("opacity",ZB).attr("transform",function(z){var F=this.parentNode.__axis;return d((F&&isFinite(F=F(z))?F:w(z))+l)})),_.remove(),S.attr("d",t===Gw||t===K6?s?"M"+u*s+","+x+"H"+l+"V"+b+"H"+u*s:"M"+l+","+x+"V"+b:s?"M"+x+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+x+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(z){return d(w(z)+l)}),O.attr(h+"2",u*a),D.attr(h,u*y).text(m),k.filter(cTe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===K6?"start":t===Gw?"end":"middle"),k.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function uTe(t){return QB(zw,t)}function hTe(t){return QB(j6,t)}var dTe={value:()=>{}};function JB(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}qw.prototype=JB.prototype={constructor:qw,on:function(t,e){var r=this._,n=fTe(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),tF.hasOwnProperty(e)?{space:tF[e],local:t}:t}function gTe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Z6&&e.documentElement.namespaceURI===Z6?e.createElement(t):e.createElementNS(r,t)}}function mTe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function rF(t){var e=Vw(t);return(e.local?mTe:gTe)(e)}function yTe(){}function Q6(t){return t==null?yTe:function(){return this.querySelector(t)}}function vTe(t){typeof t!="function"&&(t=Q6(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function VTe(t){t||(t=WTe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function UTe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function HTe(){return Array.from(this)}function YTe(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?iwe:typeof e=="function"?swe:awe)(t,e,r??"")):_p(this.node(),t)}function _p(t,e){return t.style.getPropertyValue(e)||oF(t).getComputedStyle(t,null).getPropertyValue(e)}function lwe(t){return function(){delete this[t]}}function cwe(t,e){return function(){this[t]=e}}function uwe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function hwe(t,e){return arguments.length>1?this.each((e==null?lwe:typeof e=="function"?uwe:cwe)(t,e)):this.node()[t]}function lF(t){return t.trim().split(/^|\s+/)}function J6(t){return t.classList||new cF(t)}function cF(t){this._node=t,this._names=lF(t.getAttribute("class")||"")}cF.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function uF(t,e){for(var r=J6(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Fwe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Yw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Yw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Xwe.exec(t))?new Ea(e[1],e[2],e[3],1):(e=Kwe.exec(t))?new Ea(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=jwe.exec(t))?Yw(e[1],e[2],e[3],e[4]):(e=Zwe.exec(t))?Yw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qwe.exec(t))?TF(e[1],e[2]/100,e[3]/100,1):(e=Jwe.exec(t))?TF(e[1],e[2]/100,e[3]/100,e[4]):pF.hasOwnProperty(t)?yF(pF[t]):t==="transparent"?new Ea(NaN,NaN,NaN,0):null}function yF(t){return new Ea(t>>16&255,t>>8&255,t&255,1)}function Yw(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ea(t,e,r,n)}function vF(t){return t instanceof Hh||(t=Yh(t)),t?(t=t.rgb(),new Ea(t.r,t.g,t.b,t.opacity)):new Ea}function eA(t,e,r,n){return arguments.length===1?vF(t):new Ea(t,e,r,n??1)}function Ea(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}m2(Ea,eA,Uw(Hh,{brighter(t){return t=t==null?Hw:Math.pow(Hw,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y2:Math.pow(y2,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ea(Xh(this.r),Xh(this.g),Xh(this.b),Xw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bF,formatHex:bF,formatHex8:r4e,formatRgb:xF,toString:xF}));function bF(){return`#${Kh(this.r)}${Kh(this.g)}${Kh(this.b)}`}function r4e(){return`#${Kh(this.r)}${Kh(this.g)}${Kh(this.b)}${Kh((isNaN(this.opacity)?1:this.opacity)*255)}`}function xF(){const t=Xw(this.opacity);return`${t===1?"rgb(":"rgba("}${Xh(this.r)}, ${Xh(this.g)}, ${Xh(this.b)}${t===1?")":`, ${t})`}`}function Xw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Kh(t){return t=Xh(t),(t<16?"0":"")+t.toString(16)}function TF(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _o(t,e,r,n)}function wF(t){if(t instanceof _o)return new _o(t.h,t.s,t.l,t.opacity);if(t instanceof Hh||(t=Yh(t)),!t)return new _o;if(t instanceof _o)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new _o(s,o,l,t.opacity)}function n4e(t,e,r,n){return arguments.length===1?wF(t):new _o(t,e,r,n??1)}function _o(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}m2(_o,n4e,Uw(Hh,{brighter(t){return t=t==null?Hw:Math.pow(Hw,t),new _o(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y2:Math.pow(y2,t),new _o(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ea(tA(t>=240?t-240:t+120,i,n),tA(t,i,n),tA(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _o(CF(this.h),Kw(this.s),Kw(this.l),Xw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Xw(this.opacity);return`${t===1?"hsl(":"hsla("}${CF(this.h)}, ${Kw(this.s)*100}%, ${Kw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function CF(t){return t=(t||0)%360,t<0?t+360:t}function Kw(t){return Math.max(0,Math.min(1,t||0))}function tA(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const i4e=Math.PI/180,a4e=180/Math.PI,jw=18,kF=.96422,EF=1,SF=.82521,AF=4/29,Lp=6/29,_F=3*Lp*Lp,s4e=Lp*Lp*Lp;function RF(t){if(t instanceof dl)return new dl(t.l,t.a,t.b,t.opacity);if(t instanceof fc)return LF(t);t instanceof Ea||(t=vF(t));var e=aA(t.r),r=aA(t.g),n=aA(t.b),i=rA((.2225045*e+.7168786*r+.0606169*n)/EF),a,s;return e===r&&r===n?a=s=i:(a=rA((.4360747*e+.3850649*r+.1430804*n)/kF),s=rA((.0139322*e+.0971045*r+.7141733*n)/SF)),new dl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function o4e(t,e,r,n){return arguments.length===1?RF(t):new dl(t,e,r,n??1)}function dl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}m2(dl,o4e,Uw(Hh,{brighter(t){return new dl(this.l+jw*(t??1),this.a,this.b,this.opacity)},darker(t){return new dl(this.l-jw*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=kF*nA(e),t=EF*nA(t),r=SF*nA(r),new Ea(iA(3.1338561*e-1.6168667*t-.4906146*r),iA(-.9787684*e+1.9161415*t+.033454*r),iA(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function rA(t){return t>s4e?Math.pow(t,1/3):t/_F+AF}function nA(t){return t>Lp?t*t*t:_F*(t-AF)}function iA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function aA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function l4e(t){if(t instanceof fc)return new fc(t.h,t.c,t.l,t.opacity);if(t instanceof dl||(t=RF(t)),t.a===0&&t.b===0)return new fc(NaN,0()=>t;function IF(t,e){return function(r){return t+r*e}}function c4e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function u4e(t,e){var r=e-t;return r?IF(t,r>180||r<-180?r-360*Math.round(r/360):r):Zw(isNaN(t)?e:t)}function h4e(t){return(t=+t)==1?b2:function(e,r){return r-e?c4e(e,r,t):Zw(isNaN(e)?r:e)}}function b2(t,e){var r=e-t;return r?IF(t,r):Zw(isNaN(t)?e:t)}const Qw=(function t(e){var r=h4e(e);function n(i,a){var s=r((i=eA(i)).r,(a=eA(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=b2(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function d4e(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ro(n,i)})),r=lA.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Ro(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Ro(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Ro(u,d)},{i:m-2,x:Ro(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--Ip}function FF(){jh=(t4=C2.now())+r4,Ip=x2=0;try{A4e()}finally{Ip=0,R4e(),jh=0}}function _4e(){var t=C2.now(),e=t-t4;e>$F&&(r4-=e,t4=t)}function R4e(){for(var t,e=e4,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:e4=r);w2=t,dA(n)}function dA(t){if(!Ip){x2&&(x2=clearTimeout(x2));var e=t-jh;e>24?(t<1/0&&(x2=setTimeout(FF,t-C2.now()-r4)),T2&&(T2=clearInterval(T2))):(T2||(t4=C2.now(),T2=setInterval(_4e,$F)),Ip=1,PF(FF))}}function zF(t,e,r){var n=new n4;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var L4e=JB("start","end","cancel","interrupt"),I4e=[],GF=0,qF=1,fA=2,i4=3,VF=4,pA=5,a4=6;function s4(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;D4e(t,r,{name:e,index:n,group:i,on:L4e,tween:I4e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:GF})}function gA(t,e){var r=Lo(t,e);if(r.state>GF)throw new Error("too late; already scheduled");return r}function fl(t,e){var r=Lo(t,e);if(r.state>i4)throw new Error("too late; already running");return r}function Lo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function D4e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=BF(a,0,r.time);function a(u){r.state=qF,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==qF)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===i4)return zF(s);p.state===VF?(p.state=a4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hfA&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function cCe(t,e,r){var n,i,a=lCe(e)?gA:fl;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function uCe(t,e){var r=this._id;return arguments.length<2?Lo(this.node(),r).on.on(t):this.each(cCe(r,t,e))}function hCe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function dCe(){return this.on("end.remove",hCe(this._id))}function fCe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Q6(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return YF;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iZh)if(!(Math.abs(d*l-u*h)>Zh)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(f),b=a*Math.tan((yA-Math.acos((m+f-y)/(2*v*x)))/2),w=b/x,k=b/v;Math.abs(w-1)>Zh&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Zh||Math.abs(this._y1-h)>Zh)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%vA+vA),f>BCe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Zh&&this._append`A${n},${n},0,${+(f>=yA)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function GCe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function o4(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Dp(t){return t=o4(Math.abs(t)),t?t[1]:NaN}function qCe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function VCe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var WCe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l4(t){if(!(e=WCe.exec(t)))throw new Error("invalid format: "+t);var e;return new bA({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}l4.prototype=bA.prototype;function bA(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}bA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function UCe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var c4;function HCe(t,e){var r=o4(t,e);if(!r)return c4=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(c4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+o4(t,Math.max(0,e+a-1))[0]}function XF(t,e){var r=o4(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const KF={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:GCe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>XF(t*100,e),r:XF,s:HCe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jF(t){return t}var ZF=Array.prototype.map,QF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YCe(t){var e=t.grouping===void 0||t.thousands===void 0?jF:qCe(ZF.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?jF:VCe(ZF.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=l4(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,k=d.trim,S=d.type;S==="n"?(b=!0,S="g"):KF[S]||(w===void 0&&(w=12),k=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=KF[S],O=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function D(z){var F=C,A=_,R,N,M;if(S==="c")A=L(z)+A,z="";else{z=+z;var I=z<0||1/z<0;if(z=isNaN(z)?l:L(Math.abs(z),w),k&&(z=UCe(z)),I&&+z==0&&m!=="+"&&(I=!1),F=(I?m==="("?m:o:m==="-"||m==="("?"":m)+F,A=(S==="s"&&!isNaN(z)&&c4!==void 0?QF[8+c4/3]:"")+A+(I&&m==="("?")":""),O){for(R=-1,N=z.length;++RM||M>57){A=(M===46?i+z.slice(R+1):z.slice(R))+A,z=z.slice(0,R);break}}}b&&!v&&(z=e(z,1/0));var $=F.length+z.length+A.length,P=$>1)+F+z+A+P.slice($);break;default:z=P+F+z+A;break}return a(z)}return D.toString=function(){return d+""},D}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(Dp(f)/3)))*3,g=Math.pow(10,-p),m=u((d=l4(d),d.type="f",d),{suffix:QF[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var u4,Qh,JF;XCe({thousands:",",grouping:[3],currency:["$",""]});function XCe(t){return u4=YCe(t),Qh=u4.format,JF=u4.formatPrefix,u4}function KCe(t){return Math.max(0,-Dp(Math.abs(t)))}function jCe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dp(e)/3)))*3-Dp(Math.abs(t)))}function ZCe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Dp(e)-Dp(t))+1}function QCe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function JCe(){return this.eachAfter(QCe)}function e5e(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function t5e(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function r5e(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function a5e(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function s5e(t){for(var e=this,r=o5e(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function o5e(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function l5e(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function c5e(){return Array.from(this)}function u5e(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function h5e(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*d5e(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new h4(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(y5e)}function f5e(){return xA(this).eachBefore(m5e)}function p5e(t){return t.children}function g5e(t){return Array.isArray(t)?t[1]:null}function m5e(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function y5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function h4(t){this.data=t,this.depth=this.height=0,this.parent=null}h4.prototype=xA.prototype={constructor:h4,count:JCe,each:e5e,eachAfter:r5e,eachBefore:t5e,find:n5e,sum:i5e,sort:a5e,path:s5e,ancestors:l5e,descendants:c5e,leaves:u5e,links:h5e,copy:f5e,[Symbol.iterator]:d5e};function v5e(t){if(typeof t!="function")throw new Error;return t}function k2(){return 0}function E2(t){return function(){return t}}function b5e(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function x5e(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*k,b=Math.max(x/S,S/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(w5e);function E5e(){var t=k5e,e=!1,r=1,n=1,i=[0],a=k2,s=k2,o=k2,l=k2,u=k2;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(b5e),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function R5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?L5e:R5e,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Ro)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,A5e),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=b4e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Mp,h()):s!==Mp},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function nz(){return I5e()(Mp,Mp)}function D5e(t,e,r,n){var i=X6(t,e,r),a;switch(n=l4(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=jCe(i,s))&&(n.precision=a),JF(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=ZCe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=KCe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Qh(n)}function M5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return eTe(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return D5e(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=Y6(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Np(){var t=nz();return t.copy=function(){return rz(t,Np())},d4.apply(t,arguments),M5e(t)}function N5e(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uIi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(CA.setTime(+a),kA.setTime(+s),t(CA),t(kA),Math.floor(r(CA,kA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Op=Ii(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Op.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ii(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Op),Op.range;const mc=1e3,io=mc*60,yc=io*60,vc=yc*24,EA=vc*7,iz=vc*30,SA=vc*365,Au=Ii(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getUTCSeconds());Au.range;const S2=Ii(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mc)},(t,e)=>{t.setTime(+t+e*io)},(t,e)=>(e-t)/io,t=>t.getMinutes());S2.range,Ii(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*io)},(t,e)=>(e-t)/io,t=>t.getUTCMinutes()).range;const A2=Ii(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mc-t.getMinutes()*io)},(t,e)=>{t.setTime(+t+e*yc)},(t,e)=>(e-t)/yc,t=>t.getHours());A2.range,Ii(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*yc)},(t,e)=>(e-t)/yc,t=>t.getUTCHours()).range;const ed=Ii(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*io)/vc,t=>t.getDate()-1);ed.range;const AA=Ii(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vc,t=>t.getUTCDate()-1);AA.range,Ii(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vc,t=>Math.floor(t/vc)).range;function td(t){return Ii(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*io)/EA)}const _2=td(0),R2=td(1),az=td(2),sz=td(3),rd=td(4),oz=td(5),lz=td(6);_2.range,R2.range,az.range,sz.range,rd.range,oz.range,lz.range;function nd(t){return Ii(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/EA)}const cz=nd(0),f4=nd(1),O5e=nd(2),$5e=nd(3),$p=nd(4),P5e=nd(5),B5e=nd(6);cz.range,f4.range,O5e.range,$5e.range,$p.range,P5e.range,B5e.range;const L2=Ii(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());L2.range,Ii(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const bc=Ii(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());bc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ii(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),bc.range;const id=Ii(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());id.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ii(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),id.range;function F5e(t,e,r,n,i,a){const s=[[Au,1,mc],[Au,5,5*mc],[Au,15,15*mc],[Au,30,30*mc],[a,1,io],[a,5,5*io],[a,15,15*io],[a,30,30*io],[i,1,yc],[i,3,3*yc],[i,6,6*yc],[i,12,12*yc],[n,1,vc],[n,2,2*vc],[r,1,EA],[e,1,iz],[e,3,3*iz],[t,1,SA]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(X6(u/SA,h/SA,d));if(p===0)return Op.every(Math.max(X6(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(fe=RA(I2(ne.y,0,1)),Ae=fe.getUTCDay(),fe=Ae>4||Ae===0?f4.ceil(fe):f4(fe),fe=AA.offset(fe,(ne.V-1)*7),ne.y=fe.getUTCFullYear(),ne.m=fe.getUTCMonth(),ne.d=fe.getUTCDate()+(ne.w+6)%7):(fe=_A(I2(ne.y,0,1)),Ae=fe.getDay(),fe=Ae>4||Ae===0?R2.ceil(fe):R2(fe),fe=ed.offset(fe,(ne.V-1)*7),ne.y=fe.getFullYear(),ne.m=fe.getMonth(),ne.d=fe.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),Ae="Z"in ne?RA(I2(ne.y,0,1)).getUTCDay():_A(I2(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(Ae+5)%7:ne.w+ne.U*7-(Ae+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,RA(ne)):_A(ne)}}function _(te,Z,ee,ne){for(var oe=0,fe=Z.length,Ae=ee.length,Re,Ge;oe=Ae)return-1;if(Re=Z.charCodeAt(oe++),Re===37){if(Re=Z.charAt(oe++),Ge=k[Re in uz?Z.charAt(oe++):Re],!Ge||(ne=Ge(te,ee,ne))<0)return-1}else if(Re!=ee.charCodeAt(ne++))return-1}return ne}function L(te,Z,ee){var ne=u.exec(Z.slice(ee));return ne?(te.p=h.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function O(te,Z,ee){var ne=p.exec(Z.slice(ee));return ne?(te.w=g.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function D(te,Z,ee){var ne=d.exec(Z.slice(ee));return ne?(te.w=f.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function z(te,Z,ee){var ne=v.exec(Z.slice(ee));return ne?(te.m=x.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function F(te,Z,ee){var ne=m.exec(Z.slice(ee));return ne?(te.m=y.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function A(te,Z,ee){return _(te,e,Z,ee)}function R(te,Z,ee){return _(te,r,Z,ee)}function N(te,Z,ee){return _(te,n,Z,ee)}function M(te){return s[te.getDay()]}function I(te){return a[te.getDay()]}function $(te){return l[te.getMonth()]}function P(te){return o[te.getMonth()]}function B(te){return i[+(te.getHours()>=12)]}function q(te){return 1+~~(te.getMonth()/3)}function V(te){return s[te.getUTCDay()]}function X(te){return a[te.getUTCDay()]}function W(te){return l[te.getUTCMonth()]}function ie(te){return o[te.getUTCMonth()]}function K(te){return i[+(te.getUTCHours()>=12)]}function se(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var Z=S(te+="",b);return Z.toString=function(){return te},Z},parse:function(te){var Z=C(te+="",!1);return Z.toString=function(){return te},Z},utcFormat:function(te){var Z=S(te+="",w);return Z.toString=function(){return te},Z},utcParse:function(te){var Z=C(te+="",!0);return Z.toString=function(){return te},Z}}}var uz={"-":"",_:" ",0:"0"},Xi=/^\s*\d+/,V5e=/^%/,W5e=/[\\^$*+?|[\]().{}]/g;function en(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function H5e(t,e,r){var n=Xi.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Y5e(t,e,r){var n=Xi.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function X5e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function K5e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function j5e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function hz(t,e,r){var n=Xi.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function dz(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Z5e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Q5e(t,e,r){var n=Xi.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function J5e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function fz(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function e3e(t,e,r){var n=Xi.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function pz(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function t3e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function r3e(t,e,r){var n=Xi.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function n3e(t,e,r){var n=Xi.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function i3e(t,e,r){var n=Xi.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function a3e(t,e,r){var n=V5e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function s3e(t,e,r){var n=Xi.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function o3e(t,e,r){var n=Xi.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function gz(t,e){return en(t.getDate(),e,2)}function l3e(t,e){return en(t.getHours(),e,2)}function c3e(t,e){return en(t.getHours()%12||12,e,2)}function u3e(t,e){return en(1+ed.count(bc(t),t),e,3)}function mz(t,e){return en(t.getMilliseconds(),e,3)}function h3e(t,e){return mz(t,e)+"000"}function d3e(t,e){return en(t.getMonth()+1,e,2)}function f3e(t,e){return en(t.getMinutes(),e,2)}function p3e(t,e){return en(t.getSeconds(),e,2)}function g3e(t){var e=t.getDay();return e===0?7:e}function m3e(t,e){return en(_2.count(bc(t)-1,t),e,2)}function yz(t){var e=t.getDay();return e>=4||e===0?rd(t):rd.ceil(t)}function y3e(t,e){return t=yz(t),en(rd.count(bc(t),t)+(bc(t).getDay()===4),e,2)}function v3e(t){return t.getDay()}function b3e(t,e){return en(R2.count(bc(t)-1,t),e,2)}function x3e(t,e){return en(t.getFullYear()%100,e,2)}function T3e(t,e){return t=yz(t),en(t.getFullYear()%100,e,2)}function w3e(t,e){return en(t.getFullYear()%1e4,e,4)}function C3e(t,e){var r=t.getDay();return t=r>=4||r===0?rd(t):rd.ceil(t),en(t.getFullYear()%1e4,e,4)}function k3e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+en(e/60|0,"0",2)+en(e%60,"0",2)}function vz(t,e){return en(t.getUTCDate(),e,2)}function E3e(t,e){return en(t.getUTCHours(),e,2)}function S3e(t,e){return en(t.getUTCHours()%12||12,e,2)}function A3e(t,e){return en(1+AA.count(id(t),t),e,3)}function bz(t,e){return en(t.getUTCMilliseconds(),e,3)}function _3e(t,e){return bz(t,e)+"000"}function R3e(t,e){return en(t.getUTCMonth()+1,e,2)}function L3e(t,e){return en(t.getUTCMinutes(),e,2)}function I3e(t,e){return en(t.getUTCSeconds(),e,2)}function D3e(t){var e=t.getUTCDay();return e===0?7:e}function M3e(t,e){return en(cz.count(id(t)-1,t),e,2)}function xz(t){var e=t.getUTCDay();return e>=4||e===0?$p(t):$p.ceil(t)}function N3e(t,e){return t=xz(t),en($p.count(id(t),t)+(id(t).getUTCDay()===4),e,2)}function O3e(t){return t.getUTCDay()}function $3e(t,e){return en(f4.count(id(t)-1,t),e,2)}function P3e(t,e){return en(t.getUTCFullYear()%100,e,2)}function B3e(t,e){return t=xz(t),en(t.getUTCFullYear()%100,e,2)}function F3e(t,e){return en(t.getUTCFullYear()%1e4,e,4)}function z3e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?$p(t):$p.ceil(t),en(t.getUTCFullYear()%1e4,e,4)}function G3e(){return"+0000"}function Tz(){return"%"}function wz(t){return+t}function Cz(t){return Math.floor(+t/1e3)}var Pp,p4;q3e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function q3e(t){return Pp=q5e(t),p4=Pp.format,Pp.parse,Pp.utcFormat,Pp.utcParse,Pp}function V3e(t){return new Date(t)}function W3e(t){return t instanceof Date?+t:+new Date(+t)}function kz(t,e,r,n,i,a,s,o,l,u){var h=nz(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),w=u("%Y");function k(S){return(l(S)1?0:t<-1?N2:Math.acos(t)}function Sz(t){return t>=1?g4:t<=-1?-g4:Math.asin(t)}function Az(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new zCe(e)}function j3e(t){return t.innerRadius}function Z3e(t){return t.outerRadius}function Q3e(t){return t.startAngle}function J3e(t){return t.endAngle}function eke(t){return t&&t.padAngle}function tke(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fA*A+R*R&&(_=O,L=D),{cx:_,cy:L,x01:-h,y01:-d,x11:_*(i/k-1),y11:L*(i/k-1)}}function Fp(){var t=j3e,e=Z3e,r=ui(0),n=null,i=Q3e,a=J3e,s=eke,o=null,l=Az(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-g4,m=a.apply(this,arguments)-g4,y=Ez(m-g),v=m>g;if(o||(o=h=l()),pAa))o.moveTo(0,0);else if(y>m4-Aa)o.moveTo(p*ad(g),p*pl(g)),o.arc(0,0,p,g,m,!v),f>Aa&&(o.moveTo(f*ad(m),f*pl(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,w=g,k=m,S=y,C=y,_=s.apply(this,arguments)/2,L=_>Aa&&(n?+n.apply(this,arguments):Bp(f*f+p*p)),O=LA(Ez(p-f)/2,+r.apply(this,arguments)),D=O,z=O,F,A;if(L>Aa){var R=Sz(L/f*pl(_)),N=Sz(L/p*pl(_));(S-=R*2)>Aa?(R*=v?1:-1,w+=R,k-=R):(S=0,w=k=(g+m)/2),(C-=N*2)>Aa?(N*=v?1:-1,x+=N,b-=N):(C=0,x=b=(g+m)/2)}var M=p*ad(x),I=p*pl(x),$=f*ad(k),P=f*pl(k);if(O>Aa){var B=p*ad(b),q=p*pl(b),V=f*ad(w),X=f*pl(w),W;if(yAa?z>Aa?(F=y4(V,X,M,I,p,z,v),A=y4(B,q,$,P,p,z,v),o.moveTo(F.cx+F.x01,F.cy+F.y01),zAa)||!(S>Aa)?o.lineTo($,P):D>Aa?(F=y4($,P,B,q,f,-D,v),A=y4(M,I,V,X,f,-D,v),o.lineTo(F.cx+F.x01,F.cy+F.y01),Dt?1:e>=t?0:NaN}function ake(t){return t}function ske(){var t=ake,e=ike,r=null,n=ui(0),i=ui(m4),a=ui(0);function s(o){var l,u=(o=_z(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(m4,Math.max(-m4,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=x*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(k,S){return e(g[k],g[S])}):r!=null&&p.sort(function(k,S){return r(o[k],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:x};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:ui(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:ui(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ui(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:ui(+o),s):a},s}class Lz{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function Iz(t){return new Lz(t,!0)}function Dz(t){return new Lz(t,!1)}function _u(){}function v4(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function b4(t){this._context=t}b4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:v4(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function P2(t){return new b4(t)}function Mz(t){this._context=t}Mz.prototype={areaStart:_u,areaEnd:_u,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function oke(t){return new Mz(t)}function Nz(t){this._context=t}Nz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function lke(t){return new Nz(t)}function Oz(t,e){this._basis=new b4(t),this._beta=e}Oz.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const cke=(function t(e){function r(n){return e===1?new b4(n):new Oz(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function x4(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function IA(t,e){this._context=t,this._k=(1-e)/6}IA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:x4(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $z=(function t(e){function r(n){return new IA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function DA(t,e){this._context=t,this._k=(1-e)/6}DA.prototype={areaStart:_u,areaEnd:_u,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uke=(function t(e){function r(n){return new DA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function MA(t,e){this._context=t,this._k=(1-e)/6}MA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hke=(function t(e){function r(n){return new MA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function NA(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Aa){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Aa){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Pz(t,e){this._context=t,this._alpha=e}Pz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:NA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Bz=(function t(e){function r(n){return e?new Pz(n,e):new IA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Fz(t,e){this._context=t,this._alpha=e}Fz.prototype={areaStart:_u,areaEnd:_u,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:NA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dke=(function t(e){function r(n){return e?new Fz(n,e):new DA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function zz(t,e){this._context=t,this._alpha=e}zz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:NA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const fke=(function t(e){function r(n){return e?new zz(n,e):new MA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Gz(t){this._context=t}Gz.prototype={areaStart:_u,areaEnd:_u,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function pke(t){return new Gz(t)}function qz(t){return t<0?-1:1}function Vz(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(qz(a)+qz(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Wz(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function OA(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function T4(t){this._context=t}T4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:OA(this,this._t0,Wz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,OA(this,Wz(this,r=Vz(this,t,e)),r);break;default:OA(this,this._t0,r=Vz(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Uz(t){this._context=new Hz(t)}(Uz.prototype=Object.create(T4.prototype)).point=function(t,e){T4.prototype.point.call(this,e,t)};function Hz(t){this._context=t}Hz.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function Yz(t){return new T4(t)}function Xz(t){return new Uz(t)}function Kz(t){this._context=t}Kz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=jz(t),i=jz(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Qz(t){return new w4(t,.5)}function Jz(t){return new w4(t,0)}function eG(t){return new w4(t,1)}function B2(t,e,r){this.k=t,this.x=e,this.y=r}B2.prototype={constructor:B2,scale:function(t){return t===1?this:new B2(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new B2(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},B2.prototype;var ms=T(t=>{var i;const{securityLevel:e}=$e();let r=pt("body");if(e==="sandbox"){const s=((i=pt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=pt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function $A(t){return typeof t>"u"||t===null}T($A,"isNothing");function tG(t){return typeof t=="object"&&t!==null}T(tG,"isObject");function rG(t){return Array.isArray(t)?t:$A(t)?[]:[t]}T(rG,"toArray");function nG(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}T(C4,"getLine");function k4(t,e){return Di.repeat(" ",e-t.length)+t}T(k4,"padStart");function sG(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=C4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Di.repeat(" ",e.indent)+k4((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=C4(t.buffer,n[s],i[s],t.position,d),o+=Di.repeat(" ",e.indent)+k4((t.line+1).toString(),h)+" | "+u.str+` -`,o+=Di.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=C4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Di.repeat(" ",e.indent)+k4((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}T(sG,"makeSnippet");var Tke=sG,wke=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Cke=["scalar","sequence","mapping"];function oG(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}T(oG,"compileStyleAliases");function lG(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(wke.indexOf(r)===-1)throw new ys('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=oG(e.styleAliases||null),Cke.indexOf(this.kind)===-1)throw new ys('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}T(lG,"Type$1");var _a=lG;function BA(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}T(BA,"compileList");function cG(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(T(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:T(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:T(function(t){return t.toString(10)},"decimal"),hexadecimal:T(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Dke=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function wG(t){return!(t===null||!Dke.test(t)||t[t.length-1]==="_")}T(wG,"resolveYamlFloat");function CG(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}T(CG,"constructYamlFloat");var Mke=/^[-+]?[0-9]+e/;function kG(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Di.isNegativeZero(t))return"-0.0";return r=t.toString(10),Mke.test(r)?r.replace("e",".e"):r}T(kG,"representYamlFloat");function EG(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Di.isNegativeZero(t))}T(EG,"isFloat");var Nke=new _a("tag:yaml.org,2002:float",{kind:"scalar",resolve:wG,construct:CG,predicate:EG,represent:kG,defaultStyle:"lowercase"}),SG=_ke.extend({implicit:[Rke,Lke,Ike,Nke]}),Oke=SG,AG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),_G=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function RG(t){return t===null?!1:AG.exec(t)!==null||_G.exec(t)!==null}T(RG,"resolveYamlTimestamp");function LG(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=AG.exec(t),e===null&&(e=_G.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}T(LG,"constructYamlTimestamp");function IG(t){return t.toISOString()}T(IG,"representYamlTimestamp");var $ke=new _a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:RG,construct:LG,instanceOf:Date,represent:IG});function DG(t){return t==="<<"||t===null}T(DG,"resolveYamlMerge");var Pke=new _a("tag:yaml.org,2002:merge",{kind:"scalar",resolve:DG}),FA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function MG(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=FA;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}T(MG,"resolveYamlBinary");function NG(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=FA,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}T(NG,"constructYamlBinary");function OG(t){var e="",r=0,n,i,a=t.length,s=FA;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}T(OG,"representYamlBinary");function $G(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}T($G,"isBinary");var Bke=new _a("tag:yaml.org,2002:binary",{kind:"scalar",resolve:MG,construct:NG,predicate:$G,represent:OG}),Fke=Object.prototype.hasOwnProperty,zke=Object.prototype.toString;function PG(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}T(QG,"charFromCodepoint");function VA(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}T(VA,"setProperty");var JG=new Array(256),eq=new Array(256);for(od=0;od<256;od++)JG[od]=qA(od)?1:0,eq[od]=qA(od);var od;function tq(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||VG,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}T(tq,"State$1");function WA(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Tke(r),new ys(e,r)}T(WA,"generateError");function cr(t,e){throw WA(t,e)}T(cr,"throwError");function F2(t,e){t.onWarning&&t.onWarning.call(null,WA(t,e))}T(F2,"throwWarning");var rq={YAML:T(function(e,r,n){var i,a,s;e.version!==null&&cr(e,"duplication of %YAML directive"),n.length!==1&&cr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&cr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&cr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&F2(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:T(function(e,r,n){var i,a;n.length!==2&&cr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],YG.test(i)||cr(e,"ill-formed tag handle (first argument) of the TAG directive"),Ru.call(e.tagMap,i)&&cr(e,'there is a previously declared suffix for "'+i+'" tag handle'),XG.test(a)||cr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{cr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function xc(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Di.repeat(` -`,e-1))}T(R4,"writeFoldedLines");function nq(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),qa(p)||sd(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),qa(i)||r&&sd(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),qa(i)||r&&sd(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),qa(n))break}else{if(t.position===t.lineStart&&z2(t)||r&&sd(p))break;if(Io(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,hi(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(xc(t,a,s,!1),R4(t,t.line-l),a=s=t.position,o=!1),Lu(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return xc(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}T(nq,"readPlainScalar");function iq(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(xc(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Io(r)?(xc(t,n,i,!0),R4(t,hi(t,!1,e)),n=i=t.position):t.position===t.lineStart&&z2(t)?cr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);cr(t,"unexpected end of the stream within a single quoted scalar")}T(iq,"readSingleQuotedScalar");function aq(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return xc(t,r,t.position,!0),t.position++,!0;if(o===92){if(xc(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Io(o))hi(t,!1,e);else if(o<256&&JG[o])t.result+=eq[o],t.position++;else if((s=jG(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=KG(o))>=0?a=(a<<4)+s:cr(t,"expected hexadecimal character");t.result+=QG(a),t.position++}else cr(t,"unknown escape sequence");r=n=t.position}else Io(o)?(xc(t,r,n,!0),R4(t,hi(t,!1,e)),r=n=t.position):t.position===t.lineStart&&z2(t)?cr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}cr(t,"unexpected end of the stream within a double quoted scalar")}T(aq,"readDoubleQuotedScalar");function sq(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(hi(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&cr(t,"expected the node content, but found ','"):cr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),qa(u)&&(d=f=!0,t.position++,hi(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,cd(t,e,S4,!1,!0),y=t.tag,m=t.result,hi(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),hi(t,!0,e),cd(t,e,S4,!1,!0),v=t.result),p?ld(t,o,g,y,m,v,n,i,a):d?o.push(ld(t,null,g,y,m,v,n,i,a)):o.push(m),hi(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}cr(t,"unexpected end of the stream within a flow collection")}T(sq,"readFlowCollection");function oq(t,e){var r,n,i=zA,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)zA===i?i=d===43?HG:Hke:cr(t,"repeat of a chomping mode identifier");else if((h=ZG(d))>=0)h===0?cr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?cr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Lu(d)){do d=t.input.charCodeAt(++t.position);while(Lu(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Io(d)&&d!==0)}for(;d!==0;){for(_4(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Io(d)){l++;continue}if(t.lineIndente)&&l!==0)cr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),cd(t,e,A4,!0,i)&&(y?g=t.result:m=t.result),y||(ld(t,d,f,p,g,m,s,o,l),p=g=m=null),hi(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&x!==0)cr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&cr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):cr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}T(cd,"composeNode");function dq(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(hi(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!qa(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&cr(t,"directive name must not be less than one character in length");s!==0;){for(;Lu(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Io(s));break}if(Io(s))break;for(r=t.position;s!==0&&!qa(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&_4(t),Ru.call(rq,n)?rq[n](t,n,i):F2(t,'unknown document directive "'+n+'"')}if(hi(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,hi(t,!0,-1)):a&&cr(t,"directives end mark is expected"),cd(t,t.lineIndent-1,A4,!1,!0),hi(t,!0,-1),t.checkLineBreaks&&Xke.test(t.input.slice(e,t.position))&&F2(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&z2(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,hi(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=YA(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i{e!==void 0&&(OC[t]=e)},"addStylesForDiagram"),ake=nke,c_={};Bc(c_,{clear:()=>zn,getAccDescription:()=>ei,getAccTitle:()=>Qn,getDiagramTitle:()=>Vn,setAccDescription:()=>Jn,setAccTitle:()=>qn,setDiagramTitle:()=>ti});var u_="",h_="",d_="",f_=b(t=>Qr(t,sr()),"sanitizeText"),zn=b(()=>{u_="",d_="",h_=""},"clear"),qn=b(t=>{u_=f_(t).replace(/^\s+/g,"")},"setAccTitle"),Qn=b(()=>u_,"getAccTitle"),Jn=b(t=>{d_=f_(t).replace(/\n\s+/g,` +`)},"setAccDescription"),ei=b(()=>d_,"getAccDescription"),ti=b(t=>{h_=f_(t)},"setDiagramTitle"),Vn=b(()=>h_,"getDiagramTitle"),GG=he,ske=Y6,Ve=sr,p_=AG,WG=u0,g_=b(t=>Qr(t,Ve()),"sanitizeText"),m_=d0,oke=b(()=>c_,"getCommonDb"),$C={},PC=b((t,e,r)=>{var n;$C[t]&&GG.warn(`Diagram with id ${t} already registered. Overwriting.`),$C[t]=e,r&&OG(t,r),ike(t,e.styles),(n=e.injectUtils)==null||n.call(e,GG,ske,Ve,g_,m_,oke(),()=>{})},"registerDiagram"),y_=b(t=>{if(t in $C)return $C[t];throw new lke(t)},"getDiagram"),lke=(k1=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},b(k1,"DiagramNotFoundError"),k1);function BC(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function cke(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function v_(t){let e,r,n;t.length!==2?(e=BC,r=(o,l)=>BC(t(o),l),n=(o,l)=>t(o)-l):(e=t===BC||t===cke?t:uke,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function uke(){return 0}function hke(t){return t===null?NaN:+t}const dke=v_(BC).right;v_(hke).center;class qG extends Map{constructor(e,r=gke){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(VG(this,e))}has(e){return super.has(VG(this,e))}set(e,r){return super.set(fke(this,e),r)}delete(e){return super.delete(pke(this,e))}}function VG({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function fke({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function pke({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function gke(t){return t!==null&&typeof t=="object"?t.valueOf():t}const mke=Math.sqrt(50),yke=Math.sqrt(10),vke=Math.sqrt(2);function FC(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=mke?10:a>=yke?5:a>=vke?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Tke(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function wke(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function Ake(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function _ke(){return!this.__axis}function HG(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===zC||t===GC?-1:1,h=t===GC||t===T_?"x":"y",d=t===zC||t===w_?Ske:kke;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Cke),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,x=+v[v.length-1]+l,w=(e.bandwidth?Ake:Eke)(e.copy(),l),C=p.selection?p.selection():p,k=C.selectAll(".domain").data([null]),S=C.selectAll(".tick").data(g,e).order(),E=S.exit(),L=S.enter().append("g").attr("class","tick"),M=S.select("line"),I=S.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(L),M=M.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),I=I.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===zC?"0em":t===w_?"0.71em":"0.32em")),p!==C&&(k=k.transition(p),S=S.transition(p),M=M.transition(p),I=I.transition(p),E=E.transition(p).attr("opacity",UG).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),L.attr("opacity",UG).attr("transform",function(P){var $=this.parentNode.__axis;return d(($&&isFinite($=$(P))?$:w(P))+l)})),E.remove(),k.attr("d",t===GC||t===T_?s?"M"+u*s+","+T+"H"+l+"V"+x+"H"+u*s:"M"+l+","+T+"V"+x:s?"M"+T+","+u*s+"V"+l+"H"+x+"V"+u*s:"M"+T+","+l+"H"+x),S.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),M.attr(h+"2",u*a),I.attr(h,u*y).text(m),C.filter(_ke).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===T_?"start":t===GC?"end":"middle"),C.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Rke(t){return HG(zC,t)}function Lke(t){return HG(w_,t)}var Ike={value:()=>{}};function YG(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}WC.prototype=YG.prototype={constructor:WC,on:function(t,e){var r=this._,n=Mke(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),jG.hasOwnProperty(e)?{space:jG[e],local:t}:t}function Nke(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===C_&&e.documentElement.namespaceURI===C_?e.createElement(t):e.createElementNS(r,t)}}function Oke(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function KG(t){var e=qC(t);return(e.local?Oke:Nke)(e)}function $ke(){}function S_(t){return t==null?$ke:function(){return this.querySelector(t)}}function Pke(t){typeof t!="function"&&(t=S_(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=x&&(x=T+1);!(C=y[x])&&++x=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function lEe(t){t||(t=cEe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function uEe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function hEe(){return Array.from(this)}function dEe(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?CEe:typeof e=="function"?kEe:SEe)(t,e,r??"")):f0(this.node(),t)}function f0(t,e){return t.style.getPropertyValue(e)||tW(t).getComputedStyle(t,null).getPropertyValue(e)}function AEe(t){return function(){delete this[t]}}function _Ee(t,e){return function(){this[t]=e}}function REe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function LEe(t,e){return arguments.length>1?this.each((e==null?AEe:typeof e=="function"?REe:_Ee)(t,e)):this.node()[t]}function rW(t){return t.trim().split(/^|\s+/)}function k_(t){return t.classList||new nW(t)}function nW(t){this._node=t,this._names=rW(t.getAttribute("class")||"")}nW.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function iW(t,e){for(var r=k_(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function i5e(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?YC(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?YC(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=f5e.exec(t))?new Ya(e[1],e[2],e[3],1):(e=p5e.exec(t))?new Ya(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=g5e.exec(t))?YC(e[1],e[2],e[3],e[4]):(e=m5e.exec(t))?YC(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=y5e.exec(t))?gW(e[1],e[2]/100,e[3]/100,1):(e=v5e.exec(t))?gW(e[1],e[2]/100,e[3]/100,e[4]):lW.hasOwnProperty(t)?hW(lW[t]):t==="transparent"?new Ya(NaN,NaN,NaN,0):null}function hW(t){return new Ya(t>>16&255,t>>8&255,t&255,1)}function YC(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ya(t,e,r,n)}function dW(t){return t instanceof Ld||(t=Id(t)),t?(t=t.rgb(),new Ya(t.r,t.g,t.b,t.opacity)):new Ya}function E_(t,e,r,n){return arguments.length===1?dW(t):new Ya(t,e,r,n??1)}function Ya(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}hb(Ya,E_,UC(Ld,{brighter(t){return t=t==null?HC:Math.pow(HC,t),new Ya(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?db:Math.pow(db,t),new Ya(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ya(Md(this.r),Md(this.g),Md(this.b),XC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fW,formatHex:fW,formatHex8:T5e,formatRgb:pW,toString:pW}));function fW(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}`}function T5e(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}${Dd((isNaN(this.opacity)?1:this.opacity)*255)}`}function pW(){const t=XC(this.opacity);return`${t===1?"rgb(":"rgba("}${Md(this.r)}, ${Md(this.g)}, ${Md(this.b)}${t===1?")":`, ${t})`}`}function XC(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Md(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Dd(t){return t=Md(t),(t<16?"0":"")+t.toString(16)}function gW(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new rl(t,e,r,n)}function mW(t){if(t instanceof rl)return new rl(t.h,t.s,t.l,t.opacity);if(t instanceof Ld||(t=Id(t)),!t)return new rl;if(t instanceof rl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new rl(s,o,l,t.opacity)}function w5e(t,e,r,n){return arguments.length===1?mW(t):new rl(t,e,r,n??1)}function rl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}hb(rl,w5e,UC(Ld,{brighter(t){return t=t==null?HC:Math.pow(HC,t),new rl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?db:Math.pow(db,t),new rl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ya(A_(t>=240?t-240:t+120,i,n),A_(t,i,n),A_(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new rl(yW(this.h),jC(this.s),jC(this.l),XC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=XC(this.opacity);return`${t===1?"hsl(":"hsla("}${yW(this.h)}, ${jC(this.s)*100}%, ${jC(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yW(t){return t=(t||0)%360,t<0?t+360:t}function jC(t){return Math.max(0,Math.min(1,t||0))}function A_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const C5e=Math.PI/180,S5e=180/Math.PI,KC=18,vW=.96422,bW=1,xW=.82521,TW=4/29,g0=6/29,wW=3*g0*g0,k5e=g0*g0*g0;function CW(t){if(t instanceof Gl)return new Gl(t.l,t.a,t.b,t.opacity);if(t instanceof qc)return SW(t);t instanceof Ya||(t=dW(t));var e=I_(t.r),r=I_(t.g),n=I_(t.b),i=__((.2225045*e+.7168786*r+.0606169*n)/bW),a,s;return e===r&&r===n?a=s=i:(a=__((.4360747*e+.3850649*r+.1430804*n)/vW),s=__((.0139322*e+.0971045*r+.7141733*n)/xW)),new Gl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function E5e(t,e,r,n){return arguments.length===1?CW(t):new Gl(t,e,r,n??1)}function Gl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}hb(Gl,E5e,UC(Ld,{brighter(t){return new Gl(this.l+KC*(t??1),this.a,this.b,this.opacity)},darker(t){return new Gl(this.l-KC*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=vW*R_(e),t=bW*R_(t),r=xW*R_(r),new Ya(L_(3.1338561*e-1.6168667*t-.4906146*r),L_(-.9787684*e+1.9161415*t+.033454*r),L_(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function __(t){return t>k5e?Math.pow(t,1/3):t/wW+TW}function R_(t){return t>g0?t*t*t:wW*(t-TW)}function L_(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function I_(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function A5e(t){if(t instanceof qc)return new qc(t.h,t.c,t.l,t.opacity);if(t instanceof Gl||(t=CW(t)),t.a===0&&t.b===0)return new qc(NaN,0()=>t;function kW(t,e){return function(r){return t+r*e}}function _5e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function R5e(t,e){var r=e-t;return r?kW(t,r>180||r<-180?r-360*Math.round(r/360):r):ZC(isNaN(t)?e:t)}function L5e(t){return(t=+t)==1?pb:function(e,r){return r-e?_5e(e,r,t):ZC(isNaN(e)?r:e)}}function pb(t,e){var r=e-t;return r?kW(t,r):ZC(isNaN(t)?e:t)}const QC=(function t(e){var r=L5e(e);function n(i,a){var s=r((i=E_(i)).r,(a=E_(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=pb(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function I5e(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:nl(n,i)})),r=N_.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:nl(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:nl(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:nl(u,d)},{i:m-2,x:nl(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--m0}function DW(){Nd=(t4=vb.now())+r4,m0=gb=0;try{H5e()}finally{m0=0,X5e(),Nd=0}}function Y5e(){var t=vb.now(),e=t-t4;e>LW&&(r4-=e,t4=t)}function X5e(){for(var t,e=e4,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:e4=r);yb=t,B_(n)}function B_(t){if(!m0){gb&&(gb=clearTimeout(gb));var e=t-Nd;e>24?(t<1/0&&(gb=setTimeout(DW,t-vb.now()-r4)),mb&&(mb=clearInterval(mb))):(mb||(t4=vb.now(),mb=setInterval(Y5e,LW)),m0=1,IW(DW))}}function NW(t,e,r){var n=new n4;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var j5e=YG("start","end","cancel","interrupt"),K5e=[],OW=0,$W=1,F_=2,i4=3,PW=4,z_=5,a4=6;function s4(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Z5e(t,r,{name:e,index:n,group:i,on:j5e,tween:K5e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:OW})}function G_(t,e){var r=il(t,e);if(r.state>OW)throw new Error("too late; already scheduled");return r}function Wl(t,e){var r=il(t,e);if(r.state>i4)throw new Error("too late; already running");return r}function il(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Z5e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=MW(a,0,r.time);function a(u){r.state=$W,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==$W)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===i4)return NW(s);p.state===PW?(p.state=a4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hF_&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function _3e(t,e,r){var n,i,a=A3e(e)?G_:Wl;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function R3e(t,e){var r=this._id;return arguments.length<2?il(this.node(),r).on.on(t):this.each(_3e(r,t,e))}function L3e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function I3e(){return this.on("end.remove",L3e(this._id))}function M3e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=S_(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return GW;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iOd)if(!(Math.abs(d*l-u*h)>Od)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),x=a*Math.tan((q_-Math.acos((m+f-y)/(2*v*T)))/2),w=x/T,C=x/v;Math.abs(w-1)>Od&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Od||Math.abs(this._y1-h)>Od)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%V_+V_),f>nAe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Od&&this._append`A${n},${n},0,${+(f>=q_)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function sAe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function o4(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function y0(t){return t=o4(Math.abs(t)),t?t[1]:NaN}function oAe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function lAe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var cAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l4(t){if(!(e=cAe.exec(t)))throw new Error("invalid format: "+t);var e;return new U_({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}l4.prototype=U_.prototype;function U_(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}U_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function uAe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var c4;function hAe(t,e){var r=o4(t,e);if(!r)return c4=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(c4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+o4(t,Math.max(0,e+a-1))[0]}function WW(t,e){var r=o4(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const qW={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:sAe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>WW(t*100,e),r:WW,s:hAe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function VW(t){return t}var UW=Array.prototype.map,HW=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dAe(t){var e=t.grouping===void 0||t.thousands===void 0?VW:oAe(UW.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?VW:lAe(UW.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=l4(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,x=d.comma,w=d.precision,C=d.trim,k=d.type;k==="n"?(x=!0,k="g"):qW[k]||(w===void 0&&(w=12),C=!0,k="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var S=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(k)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=qW[k],M=/[defgprs%]/.test(k);w=w===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function I(P){var $=S,_=E,R,O,D;if(k==="c")_=L(P)+_,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:L(Math.abs(P),w),C&&(P=uAe(P)),N&&+P==0&&m!=="+"&&(N=!1),$=(N?m==="("?m:o:m==="-"||m==="("?"":m)+$,_=(k==="s"&&!isNaN(P)&&c4!==void 0?HW[8+c4/3]:"")+_+(N&&m==="("?")":""),M){for(R=-1,O=P.length;++RD||D>57){_=(D===46?i+P.slice(R+1):P.slice(R))+_,P=P.slice(0,R);break}}}x&&!v&&(P=e(P,1/0));var B=$.length+P.length+_.length,F=B>1)+$+P+_+F.slice(B);break;default:P=F+$+P+_;break}return a(P)}return I.toString=function(){return d+""},I}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(y0(f)/3)))*3,g=Math.pow(10,-p),m=u((d=l4(d),d.type="f",d),{suffix:HW[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var u4,$d,YW;fAe({thousands:",",grouping:[3],currency:["$",""]});function fAe(t){return u4=dAe(t),$d=u4.format,YW=u4.formatPrefix,u4}function pAe(t){return Math.max(0,-y0(Math.abs(t)))}function gAe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(y0(e)/3)))*3-y0(Math.abs(t)))}function mAe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,y0(e)-y0(t))+1}function yAe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function vAe(){return this.eachAfter(yAe)}function bAe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function xAe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function TAe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function SAe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function kAe(t){for(var e=this,r=EAe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function EAe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function AAe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function _Ae(){return Array.from(this)}function RAe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function LAe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*IAe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new h4(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore($Ae)}function MAe(){return H_(this).eachBefore(OAe)}function DAe(t){return t.children}function NAe(t){return Array.isArray(t)?t[1]:null}function OAe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function $Ae(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function h4(t){this.data=t,this.depth=this.height=0,this.parent=null}h4.prototype=H_.prototype={constructor:h4,count:vAe,each:bAe,eachAfter:TAe,eachBefore:xAe,find:wAe,sum:CAe,sort:SAe,path:kAe,ancestors:AAe,descendants:_Ae,leaves:RAe,links:LAe,copy:MAe,[Symbol.iterator]:IAe};function PAe(t){if(typeof t!="function")throw new Error;return t}function bb(){return 0}function xb(t){return function(){return t}}function BAe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function FAe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),k=y*y*C,x=Math.max(T/k,k/v),x>w){y-=u;break}w=x}s.push(l={value:y,dice:p1?n:1)},r})(GAe);function VAe(){var t=qAe,e=!1,r=1,n=1,i=[0],a=bb,s=bb,o=bb,l=bb,u=bb;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(BAe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function XAe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?jAe:XAe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),nl)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,HAe),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=B5e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:v0,h()):s!==v0},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function ZW(){return KAe()(v0,v0)}function ZAe(t,e,r,n){var i=x_(t,e,r),a;switch(n=l4(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=gAe(i,s))&&(n.precision=a),YW(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=mAe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=pAe(i))&&(n.precision=a-(n.type==="%")*2);break}}return $d(n)}function QAe(t){var e=t.domain;return t.ticks=function(r){var n=e();return bke(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return ZAe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=b_(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function b0(){var t=ZW();return t.copy=function(){return KW(t,b0())},d4.apply(t,arguments),QAe(t)}function JAe(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uKi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(j_.setTime(+a),K_.setTime(+s),t(j_),t(K_),Math.floor(r(j_,K_))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const x0=Ki(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);x0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ki(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):x0),x0.range;const Hc=1e3,Ro=Hc*60,Yc=Ro*60,Xc=Yc*24,Z_=Xc*7,QW=Xc*30,Q_=Xc*365,sh=Ki(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hc)},(t,e)=>(e-t)/Hc,t=>t.getUTCSeconds());sh.range;const Tb=Ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hc)},(t,e)=>{t.setTime(+t+e*Ro)},(t,e)=>(e-t)/Ro,t=>t.getMinutes());Tb.range,Ki(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ro)},(t,e)=>(e-t)/Ro,t=>t.getUTCMinutes()).range;const wb=Ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hc-t.getMinutes()*Ro)},(t,e)=>{t.setTime(+t+e*Yc)},(t,e)=>(e-t)/Yc,t=>t.getHours());wb.range,Ki(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Yc)},(t,e)=>(e-t)/Yc,t=>t.getUTCHours()).range;const Bd=Ki(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ro)/Xc,t=>t.getDate()-1);Bd.range;const J_=Ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Xc,t=>t.getUTCDate()-1);J_.range,Ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Xc,t=>Math.floor(t/Xc)).range;function Fd(t){return Ki(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Ro)/Z_)}const Cb=Fd(0),Sb=Fd(1),JW=Fd(2),eq=Fd(3),zd=Fd(4),tq=Fd(5),rq=Fd(6);Cb.range,Sb.range,JW.range,eq.range,zd.range,tq.range,rq.range;function Gd(t){return Ki(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Z_)}const nq=Gd(0),f4=Gd(1),e6e=Gd(2),t6e=Gd(3),T0=Gd(4),r6e=Gd(5),n6e=Gd(6);nq.range,f4.range,e6e.range,t6e.range,T0.range,r6e.range,n6e.range;const kb=Ki(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());kb.range,Ki(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const jc=Ki(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());jc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ki(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),jc.range;const Wd=Ki(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Wd.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ki(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),Wd.range;function i6e(t,e,r,n,i,a){const s=[[sh,1,Hc],[sh,5,5*Hc],[sh,15,15*Hc],[sh,30,30*Hc],[a,1,Ro],[a,5,5*Ro],[a,15,15*Ro],[a,30,30*Ro],[i,1,Yc],[i,3,3*Yc],[i,6,6*Yc],[i,12,12*Yc],[n,1,Xc],[n,2,2*Xc],[r,1,Z_],[e,1,QW],[e,3,3*QW],[t,1,Q_]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(x_(u/Q_,h/Q_,d));if(p===0)return x0.every(Math.max(x_(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ae=tR(Eb(re.y,0,1)),_e=ae.getUTCDay(),ae=_e>4||_e===0?f4.ceil(ae):f4(ae),ae=J_.offset(ae,(re.V-1)*7),re.y=ae.getUTCFullYear(),re.m=ae.getUTCMonth(),re.d=ae.getUTCDate()+(re.w+6)%7):(ae=eR(Eb(re.y,0,1)),_e=ae.getDay(),ae=_e>4||_e===0?Sb.ceil(ae):Sb(ae),ae=Bd.offset(ae,(re.V-1)*7),re.y=ae.getFullYear(),re.m=ae.getMonth(),re.d=ae.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),_e="Z"in re?tR(Eb(re.y,0,1)).getUTCDay():eR(Eb(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(_e+5)%7:re.w+re.U*7-(_e+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,tR(re)):eR(re)}}function E(J,Z,ee,re){for(var ge=0,ae=Z.length,_e=ee.length,Fe,qe;ge=_e)return-1;if(Fe=Z.charCodeAt(ge++),Fe===37){if(Fe=Z.charAt(ge++),qe=C[Fe in iq?Z.charAt(ge++):Fe],!qe||(re=qe(J,ee,re))<0)return-1}else if(Fe!=ee.charCodeAt(re++))return-1}return re}function L(J,Z,ee){var re=u.exec(Z.slice(ee));return re?(J.p=h.get(re[0].toLowerCase()),ee+re[0].length):-1}function M(J,Z,ee){var re=p.exec(Z.slice(ee));return re?(J.w=g.get(re[0].toLowerCase()),ee+re[0].length):-1}function I(J,Z,ee){var re=d.exec(Z.slice(ee));return re?(J.w=f.get(re[0].toLowerCase()),ee+re[0].length):-1}function P(J,Z,ee){var re=v.exec(Z.slice(ee));return re?(J.m=T.get(re[0].toLowerCase()),ee+re[0].length):-1}function $(J,Z,ee){var re=m.exec(Z.slice(ee));return re?(J.m=y.get(re[0].toLowerCase()),ee+re[0].length):-1}function _(J,Z,ee){return E(J,e,Z,ee)}function R(J,Z,ee){return E(J,r,Z,ee)}function O(J,Z,ee){return E(J,n,Z,ee)}function D(J){return s[J.getDay()]}function N(J){return a[J.getDay()]}function B(J){return l[J.getMonth()]}function F(J){return o[J.getMonth()]}function G(J){return i[+(J.getHours()>=12)]}function z(J){return 1+~~(J.getMonth()/3)}function W(J){return s[J.getUTCDay()]}function V(J){return a[J.getUTCDay()]}function H(J){return l[J.getUTCMonth()]}function te(J){return o[J.getUTCMonth()]}function Y(J){return i[+(J.getUTCHours()>=12)]}function se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var Z=k(J+="",x);return Z.toString=function(){return J},Z},parse:function(J){var Z=S(J+="",!1);return Z.toString=function(){return J},Z},utcFormat:function(J){var Z=k(J+="",w);return Z.toString=function(){return J},Z},utcParse:function(J){var Z=S(J+="",!0);return Z.toString=function(){return J},Z}}}var iq={"-":"",_:" ",0:"0"},da=/^\s*\d+/,l6e=/^%/,c6e=/[\\^$*+?|[\]().{}]/g;function xn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function h6e(t,e,r){var n=da.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function d6e(t,e,r){var n=da.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function f6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function p6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function g6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function aq(t,e,r){var n=da.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function sq(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function m6e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function y6e(t,e,r){var n=da.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function v6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function oq(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function b6e(t,e,r){var n=da.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function lq(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function x6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function T6e(t,e,r){var n=da.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function w6e(t,e,r){var n=da.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function C6e(t,e,r){var n=da.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function S6e(t,e,r){var n=l6e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function k6e(t,e,r){var n=da.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function E6e(t,e,r){var n=da.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function cq(t,e){return xn(t.getDate(),e,2)}function A6e(t,e){return xn(t.getHours(),e,2)}function _6e(t,e){return xn(t.getHours()%12||12,e,2)}function R6e(t,e){return xn(1+Bd.count(jc(t),t),e,3)}function uq(t,e){return xn(t.getMilliseconds(),e,3)}function L6e(t,e){return uq(t,e)+"000"}function I6e(t,e){return xn(t.getMonth()+1,e,2)}function M6e(t,e){return xn(t.getMinutes(),e,2)}function D6e(t,e){return xn(t.getSeconds(),e,2)}function N6e(t){var e=t.getDay();return e===0?7:e}function O6e(t,e){return xn(Cb.count(jc(t)-1,t),e,2)}function hq(t){var e=t.getDay();return e>=4||e===0?zd(t):zd.ceil(t)}function $6e(t,e){return t=hq(t),xn(zd.count(jc(t),t)+(jc(t).getDay()===4),e,2)}function P6e(t){return t.getDay()}function B6e(t,e){return xn(Sb.count(jc(t)-1,t),e,2)}function F6e(t,e){return xn(t.getFullYear()%100,e,2)}function z6e(t,e){return t=hq(t),xn(t.getFullYear()%100,e,2)}function G6e(t,e){return xn(t.getFullYear()%1e4,e,4)}function W6e(t,e){var r=t.getDay();return t=r>=4||r===0?zd(t):zd.ceil(t),xn(t.getFullYear()%1e4,e,4)}function q6e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+xn(e/60|0,"0",2)+xn(e%60,"0",2)}function dq(t,e){return xn(t.getUTCDate(),e,2)}function V6e(t,e){return xn(t.getUTCHours(),e,2)}function U6e(t,e){return xn(t.getUTCHours()%12||12,e,2)}function H6e(t,e){return xn(1+J_.count(Wd(t),t),e,3)}function fq(t,e){return xn(t.getUTCMilliseconds(),e,3)}function Y6e(t,e){return fq(t,e)+"000"}function X6e(t,e){return xn(t.getUTCMonth()+1,e,2)}function j6e(t,e){return xn(t.getUTCMinutes(),e,2)}function K6e(t,e){return xn(t.getUTCSeconds(),e,2)}function Z6e(t){var e=t.getUTCDay();return e===0?7:e}function Q6e(t,e){return xn(nq.count(Wd(t)-1,t),e,2)}function pq(t){var e=t.getUTCDay();return e>=4||e===0?T0(t):T0.ceil(t)}function J6e(t,e){return t=pq(t),xn(T0.count(Wd(t),t)+(Wd(t).getUTCDay()===4),e,2)}function e_e(t){return t.getUTCDay()}function t_e(t,e){return xn(f4.count(Wd(t)-1,t),e,2)}function r_e(t,e){return xn(t.getUTCFullYear()%100,e,2)}function n_e(t,e){return t=pq(t),xn(t.getUTCFullYear()%100,e,2)}function i_e(t,e){return xn(t.getUTCFullYear()%1e4,e,4)}function a_e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?T0(t):T0.ceil(t),xn(t.getUTCFullYear()%1e4,e,4)}function s_e(){return"+0000"}function gq(){return"%"}function mq(t){return+t}function yq(t){return Math.floor(+t/1e3)}var w0,p4;o_e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function o_e(t){return w0=o6e(t),p4=w0.format,w0.parse,w0.utcFormat,w0.utcParse,w0}function l_e(t){return new Date(t)}function c_e(t){return t instanceof Date?+t:+new Date(+t)}function vq(t,e,r,n,i,a,s,o,l,u){var h=ZW(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),x=u("%B"),w=u("%Y");function C(k){return(l(k)1?0:t<-1?Rb:Math.acos(t)}function xq(t){return t>=1?g4:t<=-1?-g4:Math.asin(t)}function Tq(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new aAe(e)}function g_e(t){return t.innerRadius}function m_e(t){return t.outerRadius}function y_e(t){return t.startAngle}function v_e(t){return t.endAngle}function b_e(t){return t&&t.padAngle}function x_e(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*f_*_+R*R&&(E=M,L=I),{cx:E,cy:L,x01:-h,y01:-d,x11:E*(i/C-1),y11:L*(i/C-1)}}function S0(){var t=g_e,e=m_e,r=Ii(0),n=null,i=y_e,a=v_e,s=b_e,o=null,l=Tq(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-g4,m=a.apply(this,arguments)-g4,y=bq(m-g),v=m>g;if(o||(o=h=l()),pja))o.moveTo(0,0);else if(y>m4-ja)o.moveTo(p*qd(g),p*ql(g)),o.arc(0,0,p,g,m,!v),f>ja&&(o.moveTo(f*qd(m),f*ql(m)),o.arc(0,0,f,m,g,v));else{var T=g,x=m,w=g,C=m,k=y,S=y,E=s.apply(this,arguments)/2,L=E>ja&&(n?+n.apply(this,arguments):C0(f*f+p*p)),M=rR(bq(p-f)/2,+r.apply(this,arguments)),I=M,P=M,$,_;if(L>ja){var R=xq(L/f*ql(E)),O=xq(L/p*ql(E));(k-=R*2)>ja?(R*=v?1:-1,w+=R,C-=R):(k=0,w=C=(g+m)/2),(S-=O*2)>ja?(O*=v?1:-1,T+=O,x-=O):(S=0,T=x=(g+m)/2)}var D=p*qd(T),N=p*ql(T),B=f*qd(C),F=f*ql(C);if(M>ja){var G=p*qd(x),z=p*ql(x),W=f*qd(w),V=f*ql(w),H;if(yja?P>ja?($=y4(W,V,D,N,p,P,v),_=y4(G,z,B,F,p,P,v),o.moveTo($.cx+$.x01,$.cy+$.y01),Pja)||!(k>ja)?o.lineTo(B,F):I>ja?($=y4(B,F,G,z,f,-I,v),_=y4(D,N,W,V,f,-I,v),o.lineTo($.cx+$.x01,$.cy+$.y01),It?1:e>=t?0:NaN}function S_e(t){return t}function k_e(){var t=S_e,e=C_e,r=null,n=Ii(0),i=Ii(m4),a=Ii(0);function s(o){var l,u=(o=wq(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(m4,Math.max(-m4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),x=T*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(C,k){return e(g[C],g[k])}):r!=null&&p.sort(function(C,k){return r(o[C],o[k])}),l=0,d=f?(y-u*x)/f:0;l0?w*d:0)+x,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Ii(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Ii(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Ii(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Ii(+o),s):a},s}class Sq{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function kq(t){return new Sq(t,!0)}function Eq(t){return new Sq(t,!1)}function oh(){}function v4(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function b4(t){this._context=t}b4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:v4(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mb(t){return new b4(t)}function Aq(t){this._context=t}Aq.prototype={areaStart:oh,areaEnd:oh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function E_e(t){return new Aq(t)}function _q(t){this._context=t}_q.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:v4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function A_e(t){return new _q(t)}function Rq(t,e){this._basis=new b4(t),this._beta=e}Rq.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const __e=(function t(e){function r(n){return e===1?new b4(n):new Rq(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function x4(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function nR(t,e){this._context=t,this._k=(1-e)/6}nR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:x4(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Lq=(function t(e){function r(n){return new nR(n,e)}return r.tension=function(n){return t(+n)},r})(0);function iR(t,e){this._context=t,this._k=(1-e)/6}iR.prototype={areaStart:oh,areaEnd:oh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const R_e=(function t(e){function r(n){return new iR(n,e)}return r.tension=function(n){return t(+n)},r})(0);function aR(t,e){this._context=t,this._k=(1-e)/6}aR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:x4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const L_e=(function t(e){function r(n){return new aR(n,e)}return r.tension=function(n){return t(+n)},r})(0);function sR(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>ja){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ja){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Iq(t,e){this._context=t,this._alpha=e}Iq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:sR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Mq=(function t(e){function r(n){return e?new Iq(n,e):new nR(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Dq(t,e){this._context=t,this._alpha=e}Dq.prototype={areaStart:oh,areaEnd:oh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:sR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const I_e=(function t(e){function r(n){return e?new Dq(n,e):new iR(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Nq(t,e){this._context=t,this._alpha=e}Nq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:sR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const M_e=(function t(e){function r(n){return e?new Nq(n,e):new aR(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Oq(t){this._context=t}Oq.prototype={areaStart:oh,areaEnd:oh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function D_e(t){return new Oq(t)}function $q(t){return t<0?-1:1}function Pq(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return($q(a)+$q(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Bq(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function oR(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function T4(t){this._context=t}T4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:oR(this,this._t0,Bq(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,oR(this,Bq(this,r=Pq(this,t,e)),r);break;default:oR(this,this._t0,r=Pq(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Fq(t){this._context=new zq(t)}(Fq.prototype=Object.create(T4.prototype)).point=function(t,e){T4.prototype.point.call(this,e,t)};function zq(t){this._context=t}zq.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function Gq(t){return new T4(t)}function Wq(t){return new Fq(t)}function qq(t){this._context=t}qq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Vq(t),i=Vq(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Hq(t){return new w4(t,.5)}function Yq(t){return new w4(t,0)}function Xq(t){return new w4(t,1)}function Db(t,e,r){this.k=t,this.x=e,this.y=r}Db.prototype={constructor:Db,scale:function(t){return t===1?this:new Db(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Db(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Db.prototype;var Ka=b(t=>{var i;const{securityLevel:e}=Ve();let r=mt("body");if(e==="sandbox"){const s=((i=mt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=mt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function lR(t){return typeof t>"u"||t===null}b(lR,"isNothing");function jq(t){return typeof t=="object"&&t!==null}b(jq,"isObject");function Kq(t){return Array.isArray(t)?t:lR(t)?[]:[t]}b(Kq,"toArray");function Zq(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}b(C4,"getLine");function S4(t,e){return Zi.repeat(" ",e-t.length)+t}b(S4,"padStart");function eV(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=C4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Zi.repeat(" ",e.indent)+S4((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=C4(t.buffer,n[s],i[s],t.position,d),o+=Zi.repeat(" ",e.indent)+S4((t.line+1).toString(),h)+" | "+u.str+` +`,o+=Zi.repeat("-",e.indent+h+3+u.pos)+`^ +`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=C4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Zi.repeat(" ",e.indent)+S4((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}b(eV,"makeSnippet");var z_e=eV,G_e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],W_e=["scalar","sequence","mapping"];function tV(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}b(tV,"compileStyleAliases");function rV(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(G_e.indexOf(r)===-1)throw new zs('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=tV(e.styleAliases||null),W_e.indexOf(this.kind)===-1)throw new zs('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}b(rV,"Type$1");var Za=rV;function uR(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}b(uR,"compileList");function nV(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(b(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:b(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:b(function(t){return t.toString(10)},"decimal"),hexadecimal:b(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Z_e=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function mV(t){return!(t===null||!Z_e.test(t)||t[t.length-1]==="_")}b(mV,"resolveYamlFloat");function yV(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}b(yV,"constructYamlFloat");var Q_e=/^[-+]?[0-9]+e/;function vV(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Zi.isNegativeZero(t))return"-0.0";return r=t.toString(10),Q_e.test(r)?r.replace("e",".e"):r}b(vV,"representYamlFloat");function bV(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Zi.isNegativeZero(t))}b(bV,"isFloat");var J_e=new Za("tag:yaml.org,2002:float",{kind:"scalar",resolve:mV,construct:yV,predicate:bV,represent:vV,defaultStyle:"lowercase"}),xV=Y_e.extend({implicit:[X_e,j_e,K_e,J_e]}),eRe=xV,TV=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),wV=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function CV(t){return t===null?!1:TV.exec(t)!==null||wV.exec(t)!==null}b(CV,"resolveYamlTimestamp");function SV(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=TV.exec(t),e===null&&(e=wV.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}b(SV,"constructYamlTimestamp");function kV(t){return t.toISOString()}b(kV,"representYamlTimestamp");var tRe=new Za("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:CV,construct:SV,instanceOf:Date,represent:kV});function EV(t){return t==="<<"||t===null}b(EV,"resolveYamlMerge");var rRe=new Za("tag:yaml.org,2002:merge",{kind:"scalar",resolve:EV}),hR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function AV(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=hR;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}b(AV,"resolveYamlBinary");function _V(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=hR,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}b(_V,"constructYamlBinary");function RV(t){var e="",r=0,n,i,a=t.length,s=hR;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}b(RV,"representYamlBinary");function LV(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}b(LV,"isBinary");var nRe=new Za("tag:yaml.org,2002:binary",{kind:"scalar",resolve:AV,construct:_V,predicate:LV,represent:RV}),iRe=Object.prototype.hasOwnProperty,aRe=Object.prototype.toString;function IV(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}b(HV,"charFromCodepoint");function gR(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}b(gR,"setProperty");var YV=new Array(256),XV=new Array(256);for(Ud=0;Ud<256;Ud++)YV[Ud]=pR(Ud)?1:0,XV[Ud]=pR(Ud);var Ud;function jV(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||PV,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}b(jV,"State$1");function mR(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=z_e(r),new zs(e,r)}b(mR,"generateError");function mr(t,e){throw mR(t,e)}b(mr,"throwError");function Nb(t,e){t.onWarning&&t.onWarning.call(null,mR(t,e))}b(Nb,"throwWarning");var KV={YAML:b(function(e,r,n){var i,a,s;e.version!==null&&mr(e,"duplication of %YAML directive"),n.length!==1&&mr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&mr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&mr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&Nb(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:b(function(e,r,n){var i,a;n.length!==2&&mr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],GV.test(i)||mr(e,"ill-formed tag handle (first argument) of the TAG directive"),lh.call(e.tagMap,i)&&mr(e,'there is a previously declared suffix for "'+i+'" tag handle'),WV.test(a)||mr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{mr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Kc(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Zi.repeat(` +`,e-1))}b(R4,"writeFoldedLines");function ZV(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),us(p)||Vd(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),us(i)||r&&Vd(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),us(i)||r&&Vd(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),us(n))break}else{if(t.position===t.lineStart&&Ob(t)||r&&Vd(p))break;if(al(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Mi(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(Kc(t,a,s,!1),R4(t,t.line-l),a=s=t.position,o=!1),ch(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Kc(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}b(ZV,"readPlainScalar");function QV(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Kc(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else al(r)?(Kc(t,n,i,!0),R4(t,Mi(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Ob(t)?mr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);mr(t,"unexpected end of the stream within a single quoted scalar")}b(QV,"readSingleQuotedScalar");function JV(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Kc(t,r,t.position,!0),t.position++,!0;if(o===92){if(Kc(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),al(o))Mi(t,!1,e);else if(o<256&&YV[o])t.result+=XV[o],t.position++;else if((s=VV(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=qV(o))>=0?a=(a<<4)+s:mr(t,"expected hexadecimal character");t.result+=HV(a),t.position++}else mr(t,"unknown escape sequence");r=n=t.position}else al(o)?(Kc(t,r,n,!0),R4(t,Mi(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ob(t)?mr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}mr(t,"unexpected end of the stream within a double quoted scalar")}b(JV,"readDoubleQuotedScalar");function eU(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(Mi(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&mr(t,"expected the node content, but found ','"):mr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),us(u)&&(d=f=!0,t.position++,Mi(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,Yd(t,e,E4,!1,!0),y=t.tag,m=t.result,Mi(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),Mi(t,!0,e),Yd(t,e,E4,!1,!0),v=t.result),p?Hd(t,o,g,y,m,v,n,i,a):d?o.push(Hd(t,null,g,y,m,v,n,i,a)):o.push(m),Mi(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}mr(t,"unexpected end of the stream within a flow collection")}b(eU,"readFlowCollection");function tU(t,e){var r,n,i=dR,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)dR===i?i=d===43?zV:hRe:mr(t,"repeat of a chomping mode identifier");else if((h=UV(d))>=0)h===0?mr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?mr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(ch(d)){do d=t.input.charCodeAt(++t.position);while(ch(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!al(d)&&d!==0)}for(;d!==0;){for(_4(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),al(d)){l++;continue}if(t.lineIndente)&&l!==0)mr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),Yd(t,e,A4,!0,i)&&(y?g=t.result:m=t.result),y||(Hd(t,d,f,p,g,m,s,o,l),p=g=m=null),Mi(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)mr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&mr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):mr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}b(Yd,"composeNode");function sU(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Mi(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!us(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&mr(t,"directive name must not be less than one character in length");s!==0;){for(;ch(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!al(s));break}if(al(s))break;for(r=t.position;s!==0&&!us(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&_4(t),lh.call(KV,n)?KV[n](t,n,i):Nb(t,'unknown document directive "'+n+'"')}if(Mi(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Mi(t,!0,-1)):a&&mr(t,"directives end mark is expected"),Yd(t,t.lineIndent-1,A4,!1,!0),Mi(t,!0,-1),t.checkLineBreaks&&fRe.test(t.input.slice(e,t.position))&&Nb(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ob(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Mi(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=bR(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}T(qp,"codePointAt");function JA(t){var e=/^\n* /;return e.test(t)}T(JA,"needIndentIndicator");var Aq=1,e_=2,_q=3,Rq=4,Vp=5;function Lq(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=Eq(qp(t,0))&&Sq(qp(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=qp(t,l),!Gp(u))return Vp;m=m&&QA(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=qp(t,l),u===G2)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Gp(u))return Vp;m=m&&QA(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?Aq:a===q2?Vp:e_:r>9&&JA(t)?Vp:s?a===q2?Vp:e_:f?Rq:_q}T(Lq,"chooseScalarStyle");function Iq(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===q2?'""':"''";if(!t.noCompatMode&&(gEe.indexOf(e)!==-1||mEe.test(e)))return t.quotingType===q2?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return kq(t,u)}switch(T(l,"testAmbiguity"),Lq(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case Aq:return e;case e_:return"'"+e.replace(/'/g,"''")+"'";case _q:return"|"+t_(e,t.indent)+r_(jA(e,a));case Rq:return">"+t_(e,t.indent)+r_(jA(Dq(e,s),a));case Vp:return'"'+Mq(e)+'"';default:throw new ys("impossible error: invalid scalar style")}})()}T(Iq,"writeScalar");function t_(t,e){var r=JA(t)?String(e):"",n=t[t.length-1]===` +`&&(a+=r),a+=s;return a}b(wR,"indentString");function I4(t,e){return` +`+Zi.repeat(" ",t.indent*e)}b(I4,"generateNextLine");function vU(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}b(A0,"codePointAt");function kR(t){var e=/^\n* /;return e.test(t)}b(kR,"needIndentIndicator");var TU=1,ER=2,wU=3,CU=4,_0=5;function SU(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=bU(A0(t,0))&&xU(A0(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=A0(t,l),!E0(u))return _0;m=m&&SR(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=A0(t,l),u===$b)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!E0(u))return _0;m=m&&SR(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?TU:a===Pb?_0:ER:r>9&&kR(t)?_0:s?a===Pb?_0:ER:f?CU:wU}b(SU,"chooseScalarStyle");function kU(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Pb?'""':"''";if(!t.noCompatMode&&(NRe.indexOf(e)!==-1||ORe.test(e)))return t.quotingType===Pb?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return vU(t,u)}switch(b(l,"testAmbiguity"),SU(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case TU:return e;case ER:return"'"+e.replace(/'/g,"''")+"'";case wU:return"|"+AR(e,t.indent)+_R(wR(e,a));case CU:return">"+AR(e,t.indent)+_R(wR(EU(e,s),a));case _0:return'"'+AU(e)+'"';default:throw new zs("impossible error: invalid scalar style")}})()}b(kU,"writeScalar");function AR(t,e){var r=kR(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` -`}T(t_,"blockHeader");function r_(t){return t[t.length-1]===` -`?t.slice(0,-1):t}T(r_,"dropEndingNewline");function Dq(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,n_(t.slice(0,u),e)})(),i=t[0]===` +`}b(AR,"blockHeader");function _R(t){return t[t.length-1]===` +`?t.slice(0,-1):t}b(_R,"dropEndingNewline");function EU(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,r.lastIndex=u,RR(t.slice(0,u),e)})(),i=t[0]===` `||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?` -`:"")+n_(l,e),i=a}return n}T(Dq,"foldString");function n_(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` +`:"")+RR(l,e),i=a}return n}b(EU,"foldString");function RR(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` `+t.slice(i,a),i=a+1),s=o;return l+=` `,t.length-i>e&&s>i?l+=t.slice(i,s)+` -`+t.slice(s+1):l+=t.slice(i),l.slice(1)}T(n_,"foldLine");function Mq(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=qp(t,i),n=Ra[r],!n&&Gp(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||wq(r);return e}T(Mq,"escapeString");function Nq(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&gl(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}T(Nq,"writeFlowSequence");function i_(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&gl(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=I4(t,e)),t.dump&&G2===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}T(i_,"writeBlockSequence");function Oq(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),gl(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}T(Oq,"writeFlowMapping");function $q(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new ys("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&G2===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=I4(t,e)),gl(t,e+1,h,!0,d)&&(t.dump&&G2===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}T($q,"writeBlockMapping");function a_(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}T(a_,"detectType");function gl(t,e,r,n,i,a,s){t.tag=null,t.dump=r,a_(t,r,!1)||a_(t,r,!0);var o=pq.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?($q(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(Oq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?i_(t,e-1,t.dump,i):i_(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(Nq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&Iq(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new ys("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}T(gl,"writeNode");function Pq(t,e){var r=[],n=[],i,a;for(D4(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=A0(t,i),n=Qa[r],!n&&E0(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||mU(r);return e}b(AU,"escapeString");function _U(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&Vl(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}b(_U,"writeFlowSequence");function LR(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&Vl(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=I4(t,e)),t.dump&&$b===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}b(LR,"writeBlockSequence");function RU(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Vl(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}b(RU,"writeFlowMapping");function LU(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new zs("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&$b===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=I4(t,e)),Vl(t,e+1,h,!0,d)&&(t.dump&&$b===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}b(LU,"writeBlockMapping");function IR(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}b(IR,"detectType");function Vl(t,e,r,n,i,a,s){t.tag=null,t.dump=r,IR(t,r,!1)||IR(t,r,!0);var o=lU.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(LU(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(RU(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?LR(t,e-1,t.dump,i):LR(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(_U(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&kU(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new zs("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}b(Vl,"writeNode");function IU(t,e){var r=[],n=[],i,a;for(M4(t,r,n),i=0,a=n.length;i{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),La={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Bq={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function W2(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Un(t),e=Un(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}T(W2,"calculateDeltaAndAngle");var Un=T(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Fq=T(t=>({x:T(function(e,r,n){let i=0;const a=Un(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaX:g}=W2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Un(e).x-Un(n[n.length-1]).x),o=Math.abs(Un(e).y-Un(n[n.length-1]).y),l=Math.abs(Un(e).x-Un(n[0]).x),u=Math.abs(Un(e).y-Un(n[0]).y),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaY:g}=W2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Un(e).y-Un(n[n.length-1]).y),o=Math.abs(Un(e).x-Un(n[n.length-1]).x),l=Math.abs(Un(e).y-Un(n[0]).y),u=Math.abs(Un(e).x-Un(n[0]).x),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return O4}var ud=TEe();function wEe(t){return Array.isArray(t)}function s_(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function CEe(){}function qq(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function U2(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Vq="[object RegExp]",o_="[object String]",l_="[object Number]",c_="[object Boolean]",u_="[object Arguments]",Wq="[object Symbol]",Uq="[object Date]",Hq="[object Map]",Yq="[object Set]",Xq="[object Array]",Kq="[object ArrayBuffer]",jq="[object Object]",Zq="[object DataView]",Qq="[object Uint8Array]",Jq="[object Uint8ClampedArray]",eV="[object Uint16Array]",tV="[object Uint32Array]",rV="[object Int8Array]",nV="[object Int16Array]",iV="[object Int32Array]",aV="[object Float32Array]",sV="[object Float64Array]",oV=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function h_(t){return typeof oV.Buffer<"u"&&oV.Buffer.isBuffer(t)}function kEe(t){return Number.isSafeInteger(t)&&t>=0}function lV(t){return t!=null&&typeof t!="function"&&kEe(t.length)}function EEe(t){return t==="__proto__"}function $4(t){return t==null||typeof t!="object"&&typeof t!="function"}function d_(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function SEe(t,e){return Wp(t,void 0,t,new Map,e)}function Wp(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if($4(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(U2(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Do(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case l_:case o_:case c_:{const s=new t.constructor(t==null?void 0:t.valueOf());return Do(s,t),s}case u_:{const s={};return Do(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function cV(t){return _Ee(t)}function f_(t){return t!==null&&typeof t=="object"&&U2(t)==="[object Arguments]"}function p_(t){return typeof t=="object"&&t!==null}function REe(t){return p_(t)&&lV(t)}function H2(t){return d_(t)}function LEe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Y2(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Y2.Cache||Map),r}Y2.Cache=Map;function IEe(t){if($4(t))return t;const e=U2(t);if(!DEe(t))return{};if(wEe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(H2(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?NEe(i,t):g_(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return g_(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return OEe(r,t),g_(r,t),MEe(r,t),r}function DEe(t){switch(U2(t)){case u_:case Xq:case Kq:case Zq:case c_:case Uq:case aV:case sV:case rV:case nV:case iV:case Hq:case l_:case jq:case Vq:case Yq:case o_:case Wq:case Qq:case Jq:case eV:case tV:return!0;default:return!1}}function g_(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function MEe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function OEe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function $Ee(t){if($4(t))return t;if(Array.isArray(t)||d_(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function PEe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var hV="​",FEe={curveBasis:P2,curveBasisClosed:oke,curveBasisOpen:lke,curveBumpX:Iz,curveBumpY:Dz,curveBundle:cke,curveCardinalClosed:uke,curveCardinalOpen:hke,curveCardinal:$z,curveCatmullRomClosed:dke,curveCatmullRomOpen:fke,curveCatmullRom:Bz,curveLinear:O2,curveLinearClosed:pke,curveMonotoneX:Yz,curveMonotoneY:Xz,curveNatural:Zz,curveStep:Qz,curveStepAfter:eG,curveStepBefore:Jz},zEe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,GEe=T(function(t,e){const r=dV(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Rw(s),n=li(n,[...s])}else n=r.args;if(!n)return;let i=I6(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),dV=T(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${zEe.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ae.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=d2.exec(t))!==null;)if(a.index===d2.lastIndex&&d2.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return ae.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),qEe=T(function(t){return t.replace(d2,"")},"removeDirectives"),VEe=T(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function m_(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return FEe[r]??e}T(m_,"interpolateToCurve");function fV(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ud.sanitizeUrl(r):r}T(fV,"formatUrl");var WEe=T((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=y_(i,e),e=i});const n=r/2;return v_(t,n)}T(pV,"traverseEdge");function gV(t){return t.length===1?t[0]:pV(t)}T(gV,"calcLabelPosition");var mV=T((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),v_=T((t,e)=>{let r,n=e;for(const i of t){if(r){const a=y_(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:mV((1-s)*r.x+s*i.x,5),y:mV((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),UEe=T((t,e,r)=>{ae.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=v_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function yV(t,e,r){const n=structuredClone(r);ae.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=v_(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}T(yV,"calcTerminalLabelPosition");function b_(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}T(b_,"getStylesFromArray");var vV=0,bV=T(()=>(vV++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vV),"generateId");function xV(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ixV(t.length),"random"),HEe=T(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),YEe=T(function(t,e){const r=e.text.replace(It.lineBreakRegex," "),[,n]=Tc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),X2=Y2((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),It.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=Va(`${s} `,r),u=Va(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=XEe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),XEe=Y2((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(Va(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function B4(t,e){return F4(t,e).height}T(B4,"calculateTextHeight");function Va(t,e){return F4(t,e).width}T(Va,"calculateTextWidth");var F4=Y2((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Tc(r),s=["sans-serif",n],o=t.split(It.lineBreakRegex),l=[],u=pt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=HEe();y.text=m||hV;const v=YEe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),KEe=(Im=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},T(Im,"InitIDGenerator"),Im),z4,jEe=T(function(t){return z4=z4||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),z4.innerHTML=t,unescape(z4.textContent)},"entityDecode");function x_(t){return"str"in t}T(x_,"isDetailedError");var ZEe=T((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Tc=T(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ti(t,e){return BEe({},t,e)}T(ti,"cleanAndMerge");var Lr={assignWithDepth:li,wrapLabel:X2,calculateTextHeight:B4,calculateTextWidth:Va,calculateTextDimensions:F4,cleanAndMerge:ti,detectInit:GEe,detectDirective:dV,isSubstringInArray:VEe,interpolateToCurve:m_,calcLabelPosition:gV,calcCardinalityPosition:UEe,calcTerminalLabelPosition:yV,formatUrl:fV,getStylesFromArray:b_,generateId:bV,random:TV,runFunc:WEe,entityDecode:jEe,insertTitle:ZEe,isLabelCoordinateInPath:wV,parseFontSize:Tc,InitIDGenerator:KEe},QEe=T(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),wc=T(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Up=T((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Ki(t){return t??null}T(Ki,"handleUndefinedAttr");function wV(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}T(wV,"isLabelCoordinateInPath");var K2=T(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function T_(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=$e().fontSize?$e().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Fr.fontSize]=Tc(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}T(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}T(T_,"configureLabelImages");var JEe=T(t=>{const{handDrawnSeed:e}=$e();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),Hp=T(t=>{const e=eSe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),eSe=T(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),w_=T(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Kt=T(t=>{const{stylesArray:e}=Hp(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];w_(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),er=T((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=$e(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=Hp(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:tSe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),tSe=T(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const rSe=Object.freeze({left:0,top:0,width:16,height:16}),G4=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),CV=Object.freeze({...rSe,...G4}),nSe=Object.freeze({...CV,body:"",hidden:!1}),iSe=Object.freeze({width:null,height:null}),aSe=Object.freeze({...iSe,...G4}),sSe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return C_(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return C_(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return C_(o,r)?o:null}return null},C_=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function oSe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function kV(t,e){const r=oSe(t,e);for(const n in nSe)n in G4?n in t&&!(n in r)&&(r[n]=G4[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function lSe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function EV(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=kV(n[o]||i[o],a)}return s(e),r.forEach(s),kV(t,a)}function cSe(t,e){if(t.icons[e])return EV(t,e,[]);const r=lSe(t,[e])[e];return r?EV(t,e,r):null}const uSe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,hSe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function SV(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(uSe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=hSe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function dSe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function fSe(t,e){return t?""+t+""+e:e}function pSe(t,e,r){const n=dSe(t);return fSe(n.defs,e+n.content+r)}const gSe=t=>t==="unset"||t==="undefined"||t==="none";function mSe(t,e){const r={...CV,...t},n={...aSe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=pSe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=SV(d,l/u)):(h=s==="auto"?l:s,d=o===null?SV(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{gSe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const ySe=/\sid="(\S+)"/g,AV=new Map;function vSe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=AV.get(t)||0;return AV.set(t,e+1),e?`${t}${e}`:t}function bSe(t){const e=[];let r;for(;r=ySe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=vSe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function xSe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}function k_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var hd=k_();function _V(t){hd=t}var j2={exec:()=>null};function tn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Wa.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var TSe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},wSe=/^(?:[ \t]*(?:\n|$))+/,CSe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kSe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ESe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,E_=/(?:[*+-]|\d{1,9}[.)])/,RV=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,LV=tn(RV).replace(/bull/g,E_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SSe=tn(RV).replace(/bull/g,E_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),S_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ASe=/^[^\n]+/,A_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_Se=tn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",A_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),RSe=tn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,E_).getRegex(),q4="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",__=/|$))/,LSe=tn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",__).replace("tag",q4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IV=tn(S_).replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",q4).getRegex(),ISe=tn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IV).getRegex(),R_={blockquote:ISe,code:CSe,def:_Se,fences:kSe,heading:ESe,hr:Z2,html:LSe,lheading:LV,list:RSe,newline:wSe,paragraph:IV,table:j2,text:ASe},DV=tn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",q4).getRegex(),DSe={...R_,lheading:SSe,table:DV,paragraph:tn(S_).replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",DV).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",q4).getRegex()},MSe={...R_,html:tn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",__).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:j2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tn(S_).replace("hr",Z2).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",LV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NSe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OSe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,MV=/^( {2,}|\\)\n(?!\s*$)/,$Se=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",TSe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$V=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,GSe=tn($V,"u").replace(/punct/g,V4).getRegex(),qSe=tn($V,"u").replace(/punct/g,OV).getRegex(),PV="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VSe=tn(PV,"gu").replace(/notPunctSpace/g,NV).replace(/punctSpace/g,L_).replace(/punct/g,V4).getRegex(),WSe=tn(PV,"gu").replace(/notPunctSpace/g,FSe).replace(/punctSpace/g,BSe).replace(/punct/g,OV).getRegex(),USe=tn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,NV).replace(/punctSpace/g,L_).replace(/punct/g,V4).getRegex(),HSe=tn(/\\(punct)/,"gu").replace(/punct/g,V4).getRegex(),YSe=tn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),XSe=tn(__).replace("(?:-->|$)","-->").getRegex(),KSe=tn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",XSe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,jSe=tn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",W4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),BV=tn(/^!?\[(label)\]\[(ref)\]/).replace("label",W4).replace("ref",A_).getRegex(),FV=tn(/^!?\[(ref)\](?:\[\])?/).replace("ref",A_).getRegex(),ZSe=tn("reflink|nolink(?!\\()","g").replace("reflink",BV).replace("nolink",FV).getRegex(),zV=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,I_={_backpedal:j2,anyPunctuation:HSe,autolink:YSe,blockSkip:zSe,br:MV,code:OSe,del:j2,emStrongLDelim:GSe,emStrongRDelimAst:VSe,emStrongRDelimUnd:USe,escape:NSe,link:jSe,nolink:FV,punctuation:PSe,reflink:BV,reflinkSearch:ZSe,tag:KSe,text:$Se,url:j2},QSe={...I_,link:tn(/^!?\[(label)\]\((.*?)\)/).replace("label",W4).getRegex(),reflink:tn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W4).getRegex()},D_={...I_,emStrongRDelimAst:WSe,emStrongLDelim:qSe,url:tn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",zV).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:tn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},GV=t=>e6e[t];function yl(t,e){if(e){if(Wa.escapeTest.test(t))return t.replace(Wa.escapeReplace,GV)}else if(Wa.escapeTestNoEncode.test(t))return t.replace(Wa.escapeReplaceNoEncode,GV);return t}function qV(t){try{t=encodeURI(t).replace(Wa.percentDecode,"%")}catch{return null}return t}function VV(t,e){var a;let r=t.replace(Wa.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Wa.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function WV(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function r6e(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */var FRe=b(t=>{const{handDrawnSeed:e}=Ve();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),R0=b(t=>{const e=zRe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),zRe=b(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),MR=b(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Qt=b(t=>{const{stylesArray:e}=R0(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];MR(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),rr=b((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ve(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=R0(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:GRe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),GRe=b(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),O4={},Qi={},MU;function WRe(){return MU||(MU=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.BLANK_URL=Qi.relativeFirstCharacters=Qi.whitespaceEscapeCharsRegex=Qi.urlSchemeRegex=Qi.ctrlCharactersRegex=Qi.htmlCtrlEntityRegex=Qi.htmlEntitiesRegex=Qi.invalidProtocolRegex=void 0,Qi.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Qi.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Qi.htmlCtrlEntityRegex=/&(newline|tab);/gi,Qi.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Qi.urlSchemeRegex=/^.+(:|:)/gim,Qi.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Qi.relativeFirstCharacters=[".","/"],Qi.BLANK_URL="about:blank"),Qi}var DU;function qRe(){if(DU)return O4;DU=1,Object.defineProperty(O4,"__esModule",{value:!0}),O4.sanitizeUrl=a;var t=WRe();function e(s){return t.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return O4}var Xd=qRe();function VRe(t){return Array.isArray(t)}function DR(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function URe(){}function NU(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Fb(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const OU="[object RegExp]",NR="[object String]",OR="[object Number]",$R="[object Boolean]",PR="[object Arguments]",$U="[object Symbol]",PU="[object Date]",BU="[object Map]",FU="[object Set]",zU="[object Array]",GU="[object ArrayBuffer]",WU="[object Object]",qU="[object DataView]",VU="[object Uint8Array]",UU="[object Uint8ClampedArray]",HU="[object Uint16Array]",YU="[object Uint32Array]",XU="[object Int8Array]",jU="[object Int16Array]",KU="[object Int32Array]",ZU="[object Float32Array]",QU="[object Float64Array]",JU=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function BR(t){return typeof JU.Buffer<"u"&&JU.Buffer.isBuffer(t)}function HRe(t){return Number.isSafeInteger(t)&&t>=0}function eH(t){return t!=null&&typeof t!="function"&&HRe(t.length)}function YRe(t){return t==="__proto__"}function $4(t){return t==null||typeof t!="object"&&typeof t!="function"}function FR(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function XRe(t,e){return L0(t,void 0,t,new Map,e)}function L0(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if($4(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(Fb(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),sl(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case OR:case NR:case $R:{const s=new t.constructor(t==null?void 0:t.valueOf());return sl(s,t),s}case PR:{const s={};return sl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function tH(t){return KRe(t)}function zR(t){return t!==null&&typeof t=="object"&&Fb(t)==="[object Arguments]"}function GR(t){return typeof t=="object"&&t!==null}function ZRe(t){return GR(t)&&eH(t)}function zb(t){return FR(t)}function QRe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Gb(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Gb.Cache||Map),r}Gb.Cache=Map;function JRe(t){if($4(t))return t;const e=Fb(t);if(!e7e(t))return{};if(VRe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(zb(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?r7e(i,t):WR(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return WR(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return n7e(r,t),WR(r,t),t7e(r,t),r}function e7e(t){switch(Fb(t)){case PR:case zU:case GU:case qU:case $R:case PU:case ZU:case QU:case XU:case jU:case KU:case BU:case OR:case WU:case OU:case FU:case NR:case $U:case VU:case UU:case HU:case YU:return!0;default:return!1}}function WR(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function t7e(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function n7e(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function i7e(t){if($4(t))return t;if(Array.isArray(t)||FR(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function a7e(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var nH="​",o7e={curveBasis:Mb,curveBasisClosed:E_e,curveBasisOpen:A_e,curveBumpX:kq,curveBumpY:Eq,curveBundle:__e,curveCardinalClosed:R_e,curveCardinalOpen:L_e,curveCardinal:Lq,curveCatmullRomClosed:I_e,curveCatmullRomOpen:M_e,curveCatmullRom:Mq,curveLinear:Lb,curveLinearClosed:D_e,curveMonotoneX:Gq,curveMonotoneY:Wq,curveNatural:Uq,curveStep:Hq,curveStepAfter:Xq,curveStepBefore:Yq},l7e=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,c7e=b(function(t,e){const r=iH(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);RC(s),n=Ri(n,[...s])}else n=r.args;if(!n)return;let i=i_(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),iH=b(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${l7e.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),he.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=lb.exec(t))!==null;)if(a.index===lb.lastIndex&&lb.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return he.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),u7e=b(function(t){return t.replace(lb,"")},"removeDirectives"),h7e=b(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function qR(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return o7e[r]??e}b(qR,"interpolateToCurve");function aH(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Xd.sanitizeUrl(r):r}b(aH,"formatUrl");var d7e=b((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=VR(i,e),e=i});const n=r/2;return UR(t,n)}b(sH,"traverseEdge");function oH(t){return t.length===1?t[0]:sH(t)}b(oH,"calcLabelPosition");var lH=b((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),UR=b((t,e)=>{let r,n=e;for(const i of t){if(r){const a=VR(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:lH((1-s)*r.x+s*i.x,5),y:lH((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),f7e=b((t,e,r)=>{he.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=UR(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function cH(t,e,r){const n=structuredClone(r);he.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=UR(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}b(cH,"calcTerminalLabelPosition");function HR(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}b(HR,"getStylesFromArray");var uH=0,hH=b(()=>(uH++,"id-"+Math.random().toString(36).substr(2,12)+"-"+uH),"generateId");function dH(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;idH(t.length),"random"),p7e=b(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),g7e=b(function(t,e){const r=e.text.replace($t.lineBreakRegex," "),[,n]=Zc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),Wb=Gb((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),$t.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=hs(`${s} `,r),u=hs(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=m7e(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),m7e=Gb((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(hs(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function B4(t,e){return F4(t,e).height}b(B4,"calculateTextHeight");function hs(t,e){return F4(t,e).width}b(hs,"calculateTextWidth");var F4=Gb((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Zc(r),s=["sans-serif",n],o=t.split($t.lineBreakRegex),l=[],u=mt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=p7e();y.text=m||nH;const v=g7e(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),y7e=(E1=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},b(E1,"InitIDGenerator"),E1),z4,v7e=b(function(t){return z4=z4||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),z4.innerHTML=t,unescape(z4.textContent)},"entityDecode");function YR(t){return"str"in t}b(YR,"isDetailedError");var b7e=b((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Zc=b(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ri(t,e){return s7e({},t,e)}b(ri,"cleanAndMerge");var Er={assignWithDepth:Ri,wrapLabel:Wb,calculateTextHeight:B4,calculateTextWidth:hs,calculateTextDimensions:F4,cleanAndMerge:ri,detectInit:c7e,detectDirective:iH,isSubstringInArray:h7e,interpolateToCurve:qR,calcLabelPosition:oH,calcCardinalityPosition:f7e,calcTerminalLabelPosition:cH,formatUrl:aH,getStylesFromArray:HR,generateId:hH,random:fH,runFunc:d7e,entityDecode:v7e,insertTitle:b7e,isLabelCoordinateInPath:pH,parseFontSize:Zc,InitIDGenerator:y7e},x7e=b(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Qc=b(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),I0=b((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function fa(t){return t??null}b(fa,"handleUndefinedAttr");function pH(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}b(pH,"isLabelCoordinateInPath");var M0=b(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function XR(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Ve().fontSize?Ve().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=jr.fontSize]=Zc(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}b(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}b(XR,"configureLabelImages");const T7e=Object.freeze({left:0,top:0,width:16,height:16}),G4=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),gH=Object.freeze({...T7e,...G4}),w7e=Object.freeze({...gH,body:"",hidden:!1}),C7e=Object.freeze({width:null,height:null}),S7e=Object.freeze({...C7e,...G4}),k7e=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return jR(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return jR(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return jR(o,r)?o:null}return null},jR=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function E7e(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function mH(t,e){const r=E7e(t,e);for(const n in w7e)n in G4?n in t&&!(n in r)&&(r[n]=G4[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function A7e(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function yH(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=mH(n[o]||i[o],a)}return s(e),r.forEach(s),mH(t,a)}function _7e(t,e){if(t.icons[e])return yH(t,e,[]);const r=A7e(t,[e])[e];return r?yH(t,e,r):null}const R7e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,L7e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vH(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(R7e);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=L7e.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function I7e(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function M7e(t,e){return t?""+t+""+e:e}function D7e(t,e,r){const n=I7e(t);return M7e(n.defs,e+n.content+r)}const N7e=t=>t==="unset"||t==="undefined"||t==="none";function O7e(t,e){const r={...gH,...t},n={...S7e,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let x=m.rotate;v?T?x+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=D7e(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=vH(d,l/u)):(h=s==="auto"?l:s,d=o===null?vH(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{N7e(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const $7e=/\sid="(\S+)"/g,bH=new Map;function P7e(t){t=t.replace(/[0-9]+$/,"")||"a";const e=bH.get(t)||0;return bH.set(t,e+1),e?`${t}${e}`:t}function B7e(t){const e=[];let r;for(;r=$7e.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=P7e(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function F7e(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var xH={body:'?',height:80,width:80},KR=new Map,TH=new Map,ZR=b(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(he.debug("Registering icon pack:",e.name),"loader"in e)TH.set(e.name,e.loader);else if("icons"in e)KR.set(e.name,e.icons);else throw he.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),wH=b(async(t,e)=>{const r=k7e(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=KR.get(n);if(!i){const s=TH.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},KR.set(n,i)}catch(o){throw he.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=_7e(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),z7e=b(async t=>{try{return await wH(t),!0}catch{return!1}},"isIconAvailable"),Jc=b(async(t,e,r)=>{let n;try{n=await wH(t,e==null?void 0:e.fallbackPrefix)}catch(s){he.error(s),n=xH}const i=O7e(n,e),a=F7e(B7e(i.body),{...i.attributes,...r});return Qr(a,sr())},"getIconSVG");function QR(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jd=QR();function CH(t){jd=t}var qb={exec:()=>null};function Tn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(ds.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var G7e=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},W7e=/^(?:[ \t]*(?:\n|$))+/,q7e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,V7e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vb=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U7e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,JR=/(?:[*+-]|\d{1,9}[.)])/,SH=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kH=Tn(SH).replace(/bull/g,JR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),H7e=Tn(SH).replace(/bull/g,JR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),e7=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Y7e=/^[^\n]+/,t7=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,X7e=Tn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",t7).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j7e=Tn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,JR).getRegex(),W4="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",r7=/|$))/,K7e=Tn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",r7).replace("tag",W4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),EH=Tn(e7).replace("hr",Vb).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",W4).getRegex(),Z7e=Tn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",EH).getRegex(),n7={blockquote:Z7e,code:q7e,def:X7e,fences:V7e,heading:U7e,hr:Vb,html:K7e,lheading:kH,list:j7e,newline:W7e,paragraph:EH,table:qb,text:Y7e},AH=Tn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vb).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",W4).getRegex(),Q7e={...n7,lheading:H7e,table:AH,paragraph:Tn(e7).replace("hr",Vb).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",AH).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",W4).getRegex()},J7e={...n7,html:Tn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",r7).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qb,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Tn(e7).replace("hr",Vb).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",kH).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},eLe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tLe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_H=/^( {2,}|\\)\n(?!\s*$)/,rLe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",G7e?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),IH=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,oLe=Tn(IH,"u").replace(/punct/g,q4).getRegex(),lLe=Tn(IH,"u").replace(/punct/g,LH).getRegex(),MH="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cLe=Tn(MH,"gu").replace(/notPunctSpace/g,RH).replace(/punctSpace/g,i7).replace(/punct/g,q4).getRegex(),uLe=Tn(MH,"gu").replace(/notPunctSpace/g,aLe).replace(/punctSpace/g,iLe).replace(/punct/g,LH).getRegex(),hLe=Tn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,RH).replace(/punctSpace/g,i7).replace(/punct/g,q4).getRegex(),dLe=Tn(/\\(punct)/,"gu").replace(/punct/g,q4).getRegex(),fLe=Tn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pLe=Tn(r7).replace("(?:-->|$)","-->").getRegex(),gLe=Tn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",pLe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,mLe=Tn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",V4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),DH=Tn(/^!?\[(label)\]\[(ref)\]/).replace("label",V4).replace("ref",t7).getRegex(),NH=Tn(/^!?\[(ref)\](?:\[\])?/).replace("ref",t7).getRegex(),yLe=Tn("reflink|nolink(?!\\()","g").replace("reflink",DH).replace("nolink",NH).getRegex(),OH=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,a7={_backpedal:qb,anyPunctuation:dLe,autolink:fLe,blockSkip:sLe,br:_H,code:tLe,del:qb,emStrongLDelim:oLe,emStrongRDelimAst:cLe,emStrongRDelimUnd:hLe,escape:eLe,link:mLe,nolink:NH,punctuation:nLe,reflink:DH,reflinkSearch:yLe,tag:gLe,text:rLe,url:qb},vLe={...a7,link:Tn(/^!?\[(label)\]\((.*?)\)/).replace("label",V4).getRegex(),reflink:Tn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V4).getRegex()},s7={...a7,emStrongRDelimAst:uLe,emStrongLDelim:lLe,url:Tn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",OH).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Tn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},$H=t=>xLe[t];function Ul(t,e){if(e){if(ds.escapeTest.test(t))return t.replace(ds.escapeReplace,$H)}else if(ds.escapeTestNoEncode.test(t))return t.replace(ds.escapeReplaceNoEncode,$H);return t}function PH(t){try{t=encodeURI(t).replace(ds.percentDecode,"%")}catch{return null}return t}function BH(t,e){var a;let r=t.replace(ds.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ds.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function FH(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function wLe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` -`)}var H4=class{constructor(e){Hr(this,"options");Hr(this,"rules");Hr(this,"lexer");this.options=e||hd}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:J2(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=r6e(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=J2(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:J2(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=J2(r[0],` +`)}var H4=class{constructor(e){un(this,"options");un(this,"rules");un(this,"lexer");this.options=e||jd}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Hb(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=wLe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Hb(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Hb(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Hb(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),p=e.split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` -`,e=e.substring(p.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),k=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(` -`,1)[0],_;if(p=C,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||k.test(p)||S.test(p)||x.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` -`+_.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||k.test(f)||b.test(f))break;d+=` -`+p}!g&&!p.trim()&&(g=!0),h+=C+` -`,e=e.substring(C.length+1),f=_.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=J2(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=t6e(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),WV(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return WV(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Mo=class sB{constructor(e){Hr(this,"tokens");Hr(this,"options");Hr(this,"state");Hr(this,"tokenizer");Hr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||hd,this.options.tokenizer=this.options.tokenizer||new H4,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Wa,block:U4.normal,inline:Q2.normal};this.options.pedantic?(r.block=U4.pedantic,r.inline=Q2.pedantic):this.options.gfm&&(r.block=U4.gfm,this.options.breaks?r.inline=Q2.breaks:r.inline=Q2.gfm),this.tokenizer.rules=r}static get rules(){return{block:U4,inline:Q2}}static lex(e,r){return new sB(r).lex(e)}static lexInline(e,r){return new sB(r).inlineTokens(e)}lex(e){e=e.replace(Wa.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` +`,e=e.substring(p.length+1),u=!0),!u){let T=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m);for(;e;){let S=e.split(` +`,1)[0],E;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||C.test(p)||k.test(p)||T.test(p)||x.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` +`+E.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||C.test(f)||x.test(f))break;d+=` +`+p}!g&&!p.trim()&&(g=!0),h+=S+` +`,e=e.substring(S.length+1),f=E.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Hb(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=TLe(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),FH(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return FH(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},ol=class eG{constructor(e){un(this,"tokens");un(this,"options");un(this,"state");un(this,"tokenizer");un(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jd,this.options.tokenizer=this.options.tokenizer||new H4,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ds,block:U4.normal,inline:Ub.normal};this.options.pedantic?(r.block=U4.pedantic,r.inline=Ub.pedantic):this.options.gfm&&(r.block=U4.gfm,this.options.breaks?r.inline=Ub.breaks:r.inline=Ub.gfm),this.tokenizer.rules=r}static get rules(){return{block:U4,inline:Ub}}static lex(e,r){return new eG(r).lex(e)}static lexInline(e,r){return new eG(r).inlineTokens(e)}lex(e){e=e.replace(ds.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` @@ -196,16 +199,16 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Y4=class{constructor(e){Hr(this,"options");Hr(this,"parser");this.options=e||hd}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Wa.notSpaceStart))==null?void 0:s[0],a=e.replace(Wa.endingNewline,"")+` -`;return i?'
'+(n?a:yl(a,!0))+`
-`:"
"+(n?a:yl(a,!0))+`
+`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Y4=class{constructor(e){un(this,"options");un(this,"parser");this.options=e||jd}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(ds.notSpaceStart))==null?void 0:s[0],a=e.replace(ds.endingNewline,"")+` +`;return i?'
'+(n?a:Ul(a,!0))+`
+`:"
"+(n?a:Ul(a,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o `+i+" -`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+yl(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • +`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Ul(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

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

    An error occurred:

    "+yl(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},dd=new n6e;function un(t,e){return dd.parse(t,e)}un.options=un.setOptions=function(t){return dd.setOptions(t),un.defaults=dd.defaults,_V(un.defaults),un},un.getDefaults=k_,un.defaults=hd,un.use=function(...t){return dd.use(...t),un.defaults=dd.defaults,_V(un.defaults),un},un.walkTokens=function(t,e){return dd.walkTokens(t,e)},un.parseInline=dd.parseInline,un.Parser=No,un.parser=No.parse,un.Renderer=Y4,un.TextRenderer=M_,un.Lexer=Mo,un.lexer=Mo.lex,un.Tokenizer=H4,un.Hooks=eb,un.parse=un,un.options,un.setOptions,un.use,un.walkTokens,un.parseInline,No.parse,Mo.lex;function UV(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Ul(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=PH(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=PH(e);if(a===null)return Ul(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Y4(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new H4(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Yb;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];Yb.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&Yb.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return ol.lex(e,r??this.defaults)}parser(e,r){return ll.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?ol.lex:ol.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?ll.parse:ll.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?ol.lex:ol.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?ll.parse:ll.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+Ul(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Kd=new CLe;function _n(t,e){return Kd.parse(t,e)}_n.options=_n.setOptions=function(t){return Kd.setOptions(t),_n.defaults=Kd.defaults,CH(_n.defaults),_n},_n.getDefaults=QR,_n.defaults=jd,_n.use=function(...t){return Kd.use(...t),_n.defaults=Kd.defaults,CH(_n.defaults),_n},_n.walkTokens=function(t,e){return Kd.walkTokens(t,e)},_n.parseInline=Kd.parseInline,_n.Parser=ll,_n.parser=ll.parse,_n.Renderer=Y4,_n.TextRenderer=o7,_n.Lexer=ol,_n.lexer=ol.lex,_n.Tokenizer=H4,_n.Hooks=Yb,_n.parse=_n,_n.options,_n.setOptions,_n.use,_n.walkTokens,_n.parseInline,ll.parse,ol.lex;function zH(t){for(var e=[],r=1;r?',height:80,width:80},N_=new Map,YV=new Map,XV=T(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ae.debug("Registering icon pack:",e.name),"loader"in e)YV.set(e.name,e.loader);else if("icons"in e)N_.set(e.name,e.icons);else throw ae.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),KV=T(async(t,e)=>{const r=sSe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=N_.get(n);if(!i){const s=YV.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},N_.set(n,i)}catch(o){throw ae.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=cSe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),i6e=T(async t=>{try{return await KV(t),!0}catch{return!1}},"isIconAvailable"),Iu=T(async(t,e,r)=>{let n;try{n=await KV(t,e==null?void 0:e.fallbackPrefix)}catch(s){ae.error(s),n=HV}const i=mSe(n,e),a=xSe(bSe(i.body),{...i.attributes,...r});return qr(a,lr())},"getIconSVG");function jV(t,{markdownAutoWrap:e}){const n=t.replace(//g,` +`)),s+=d+n[l+1]}),s}function GH(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return UV(n)}T(jV,"preprocessMarkdown");function ZV(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}T(ZV,"nonMarkdownToLines");function QV(t,e={}){const r=jV(t,e),n=un.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return T(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}T(QV,"markdownToLines");function JV(t){return t?`

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

    `:""}T(JV,"nonMarkdownToHTML");function eW(t,{markdownAutoWrap:e}={}){const r=un.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

    ${(o=i.tokens)==null?void 0:o.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ae.warn(`Unsupported markdown: ${i.type}`),i.raw)}return T(n,"output"),r.map(n).join("")}T(eW,"markdownToHTML");function tW(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}T(tW,"splitTextToChars");function rW(t,e){const r=tW(e.content);return O_(t,[],r,e.type)}T(rW,"splitWordToFitWidth");function O_(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?O_(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}T(O_,"splitWordToFitWidthRecursion");function nW(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return X4(t,e)}T(nW,"splitLineToFitWidth");function X4(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return X4(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=rW(e,a);r.push([o]),l.content&&t.unshift(l)}return X4(t,e,r)}T(X4,"splitLineToFitWidthRecursion");function $_(t,e){e&&t.attr("style",e)}T($_,"applyStyle");var iW=16384;async function aW(t,e,r,n,i=!1,a=lr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,iW)}px`),s.attr("height",`${Math.min(10*r,iW)}px`);const o=s.append("xhtml:div"),l=ci(e.label)?await Nw(e.label.replace(It.lineBreakRegex,` -`),a):qr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),$_(h,e.labelStyle),h.attr("class",`${u} ${n}`),$_(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}T(aW,"addHtmlSpan");function K4(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}T(K4,"createTspan");function sW(t,e,r){const n=t.append("text"),i=K4(n,1,e);j4(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}T(sW,"computeWidthOfText");function oW(t,e,r){var s;const n=t.append("text"),i=K4(n,1,e);j4(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}T(oW,"computeDimensionOfText");function lW(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=T(p=>sW(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:nW(h,d);for(const p of f){const g=K4(l,u,1.1,i);j4(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}T(lW,"createFormattedText");function P_(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}T(P_,"decodeHTMLEntities");function j4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(P_(r.content)):i.text(" "+P_(r.content))})}T(j4,"updateTextContentAndStyles");async function cW(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await i6e(o)?await Iu(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}T(cW,"replaceIconSubstring");var Ua=T(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ae.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?eW(e,h):JV(e),f=await cW(wc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:ci(e)?p:f,labelStyle:r.replace("fill:","color:")};return await aW(t,g,l,i,u,h)}else{const d=wc(e.replace(//g,"
    ")),f=s?QV(d.replace("
    ","
    "),h):ZV(d),p=lW(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).select("text").attr("style",m)}return n?pt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function B_(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function a6e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s6e(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)B_(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];a6e(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const w=m[x].edge,k=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)B_(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),B_(f,h,d)})(l,o,-i)}return l}function tb(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),s6e(t,i,n,a||1)}class F_{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=tb(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function Z4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class o6e extends F_{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=tb(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Z4([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class l6e extends F_{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let c6e=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=tb(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Z4(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Z4(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Z4(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function dW(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(fW(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function rb(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function fW(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=rb(t,e,-h),[r,n]=rb(r,n,-h);const F=(t-r)/2,A=(e-n)/2;let R=F*F/(i*i)+A*A/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const N=i*i,M=a*a,I=N*M-N*A*A-M*F*F,$=N*A*A+M*F*F,P=(o===l?-1:1)*Math.sqrt(Math.abs(I/$));m=P*i*A/a+(t+r)/2,y=P*-a*F/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const F=g,A=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=fW(r=m+i*Math.cos(g),n=y+a*Math.sin(g),A,R,i,a,s,0,l,[g,F,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),w=Math.cos(g),k=Math.sin(g),S=Math.tan(v/4),C=4/3*i*S,_=4/3*a*S,L=[t,e],O=[t+C*b,e-_*x],D=[r+C*k,n-_*w],z=[r,n];if(O[0]=2*L[0]-O[0],O[1]=2*L[1]-O[1],u)return[O,D,z].concat(f);{f=[O,D,z].concat(f);const F=[];for(let A=0;A2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=wW(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=wW(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return s&&(o?v.push(...Du(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Du(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function vW(t,e){const r=dW(hW(q_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Du(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...m6e(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Du(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function W_(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Cr(i,e),n[0][1]+Cr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*xW(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=Cr(p,i,u),g=Cr(g,i,u);const m=[],y=()=>Cr(d,i,u),v=()=>Cr(h,i,u),x=i.preserveVertices;return s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:Cr(h,i,u)),e+(x?0:Cr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function tC(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+Cr(e,r),t[0][1]+Cr(e,r)]),n.push([t[0][0]+Cr(e,r),t[0][1]+Cr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=fd(l,u,.5),p=fd(u,h,.5),g=fd(h,d,.5),m=fd(f,p,.5),y=fd(p,g,.5),v=fd(m,y,.5);H_([l,f,m,v],0,r,i),H_([v,y,g,d],0,r,i)}var a,s;return i}function v6e(t,e){return iC(t,0,t.length,e)}function iC(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(iC(t,e,u+1,n,a),iC(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function Y_(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?iC(n,0,n.length,r):n}const Ps="none";class aC{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[pW(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=g6e(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(W_([u],s)):o.push(Yp([u],s))}return s.stroke!==Ps&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=mW(n,i,s),u=V_(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=V_(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(Yp([u.estimatedPoints],s));return s.stroke!==Ps&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[J4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=yW(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=yW(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,w=p;let k=Math.abs(g/2),S=Math.abs(m/2);k+=Cr(.01*k,x),S+=Cr(.01*S,x);let C=y,_=v;for(;C<0;)C+=2*Math.PI,_+=2*Math.PI;_-C>2*Math.PI&&(C=0,_=2*Math.PI);const L=(_-C)/x.curveStepCount,O=[];for(let D=C;D<=_;D+=L)O.push([b+k*Math.cos(D),w+S*Math.sin(D)]);return O.push([b+k*Math.cos(_),w+S*Math.sin(_)]),O.push([b,w]),Yp([O],x)})(e,r,n,i,a,s,u));return u.stroke!==Ps&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=gW(e,n);if(n.fill&&n.fill!==Ps)if(n.fillStyle==="solid"){const s=gW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...Y_(CW([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...Y_(CW(u),10,(1+n.roughness)/2))}s.length&&i.push(Yp([s],n))}return n.stroke!==Ps&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=J4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(W_([e],n)):i.push(Yp([e],n))),n.stroke!==Ps&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Ps,s=n.stroke!==Ps,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=dW(hW(q_(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...Y_(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:k,data:S}of p)switch(k){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const k of g){const S=v6e(k,f);S.length&&w.push(S)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=vW(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=vW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(W_(l,n));else i.push(Yp(l,n));return s&&(o?l.forEach((h=>{i.push(J4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ps};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ps,strokeWidth:0,fill:n.fill||Ps};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ps,strokeWidth:n,fill:Ps}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class b6e{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new aC(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const sC="http://www.w3.org/2000/svg";class x6e{constructor(e,r){this.svg=e,this.gen=new aC(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(sC,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(sC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(sC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(sC,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var jt={canvas:(t,e)=>new b6e(t,e),svg:(t,e)=>new x6e(t,e),generator:t=>new aC(t),newSeed:()=>aC.newSeed()},Tr=T(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||dc((p=$e())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Ki(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Ua(s,qr(wc(o),$e()),{useHtmlLabels:i,width:e.width||((g=$e().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},$e());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=pt(h);await T_(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),X_=T(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??cn($e()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Ua(i,qr(wc(e),$e()),{useHtmlLabels:n,width:r.width||((u=(l=$e())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(cn($e())){const h=a.children[0],d=pt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),nr=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),gr=T((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Wr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}T(Wr,"createPathFromPoints");function Mu(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}T(Mu,"generateFullSineWavePoints");function ib(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=T((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}T(K_,"mergePaths");var T6e=T((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),Xp=T6e,w6e=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=$e(),o=cn(s);return await Ua(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Nu=w6e,Ou=T((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),kW=T(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=$e(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Kt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=cn(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Ua(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Nu(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(cn(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=jt.svg(d),_=er(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=C.path(Ou(x,b,y,v,0),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=K2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return Xp(e,C)},{cluster:d,labelBBox:m}},"rect"),C6e=T((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return Xp(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),k6e=T(async(t,e)=>{const r=$e(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Nu(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(cn(r)){const L=p.children[0],O=pt(p);g=L.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,k=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),O=jt.svg(u),D=e.rx||e.ry?O.path(Ou(w,k,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):O.rectangle(w,k,v,x,{seed:i});C=u.insert(()=>D,":first-child");const z=O.rectangle(w,S,v,b,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>D,":first-child"),f=u.insert(()=>z)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",w).attr("y",k).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(cn(r)?0:3)})`);const _=C.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return Xp(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),E6e=T(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=$e(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Kt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=cn(r),p=d.insert("g").attr("class","cluster-label "),g=await Ua(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(cn(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=jt.svg(d),_=er(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=C.path(Ou(x,b,y,v,e.rx),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=K2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return Xp(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),S6e=T((t,e)=>{const r=$e(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=jt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return Xp(e,m)},{cluster:s,labelBBox:{}}},"divider"),A6e=kW,_6e={rect:kW,squareRect:A6e,roundedWithTitle:k6e,noteGroup:C6e,divider:S6e,kanbanSection:E6e},EW=new Map,j_=T(async(t,e)=>{const r=e.shape||"rect",n=await _6e[r](t,e);return EW.set(e.id,n),n},"insertCluster"),R6e=T(()=>{EW=new Map},"clear");function SW(t,e){return t.intersect(e)}T(SW,"intersectNode");var L6e=SW;function AW(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(Z_,"sameSign");var D6e=LW;function IW(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Ki(o)),nr(e,d),e.intersect=function(f){return ae.info("Circle intersect",e,s,f),Ht.circle(e,s,f)},a}T(DW,"anchor");function Q_(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),x=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/a,(t-v)/i);let k=Math.atan2((n-x)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const S=[];for(let C=0;C<20;C++){const _=C/19,L=b+_*k,O=v+i*Math.cos(L),D=x+a*Math.sin(L);S.push({x:O,y:D})}return S}T(Q_,"generateArcPoints");function MW(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}T(MW,"calculateArcSagitta");async function NW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=T(L=>L+s,"calcTotalHeight"),l=T(L=>{const O=L/2;return[O/(2.5+L/50),O]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Tr(t,e,gr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=MW(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...Q_(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...Q_(y/2,v/2,y/2,-v/2,f,p,!0)],w=jt.svg(u),k=er(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=Wr(b),C=w.path(S,k),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${f/2}, 0)`),nr(e,_),e.intersect=function(L){return Ht.polygon(e,b,L)},u}T(NW,"bowTieRect");function Cc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(Cc,"insertPolygonShape");var oC=12;async function OW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+oC),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+oC,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+oC},{x:d+oC,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=jt.svg(o),b=er(e,{}),w=Wr(m),k=x.path(w,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=Cc(o,u,h,m);return n&&y.attr("style",n),nr(e,y),e.intersect=function(x){return Ht.polygon(e,m,x)},o}T(OW,"card");function $W(t,e){const{nodeStyles:r}=Kt(e);e.label="";const n=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=jt.svg(n),l=er(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Wr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Ht.polygon(e,s,f)},n}T($W,"choice");async function J_(t,e,r){const{labelStyles:n,nodeStyles:i}=Kt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Tr(t,e,gr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=jt.svg(a),g=er(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ki(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return nr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},e.intersect=function(p){return ae.info("Circle intersect",e,h,p),Ht.circle(e,h,p)},a}T(J_,"circle");function PW(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${s.x},${s.y}`}T(PW,"createLine");function BW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=jt.svg(i),l=er(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=PW(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),nr(e,f),e.intersect=function(p){return ae.info("crossedCircle intersect",e,{radius:a,point:p}),Ht.circle(e,a,p)},i}T(BW,"crossedCircle");function kc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),nr(e,S),e.intersect=function(C){return Ht.polygon(e,g,C)},i}T(FW,"curlyBraceLeft");function Ec(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),nr(e,S),e.intersect=function(C){return Ht.polygon(e,g,C)},i}T(zW,"curlyBraceRight");function la(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),O.insert(()=>w,":first-child"),O.insert(()=>C,":first-child"),O.attr("class","text"),f&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),nr(e,O),e.intersect=function(D){return Ht.polygon(e,m,D)},i}T(GW,"curlyBraces");async function qW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Tr(t,e,gr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=jt.svg(u),y=er(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,w=x/4,k=[{x:b,y:0},{x:w,y:0},{x:0,y:x/2},{x:w,y:x},{x:b,y:x},...ib(-b,-x/2,p,50,270,90)],S=Wr(k),C=m.path(S,y),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(${-d/2}, ${-f/2})`),nr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},u}T(qW,"curvedTrapezoid");var N6e=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),O6e=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),$6e=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),VW=8,WW=8;async function UW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthk,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=N6e(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ki(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),nr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Ht.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}T(UW,"cylinder");async function Kp(t,e,r){const{labelStyles:n,nodeStyles:i}=Kt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Tr(t,e,gr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=jt.svg(a),y=er(e,{}),v=f||p?m.path(Ou(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Ki(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Ki(f)).attr("ry",Ki(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return nr(e,d),e.calcIntersect=function(m,y){return Ht.rect(m,y)},e.intersect=function(m){return Ht.rect(e,m)},a}T(Kp,"drawRect");async function HW(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await Kp(t,e,l);if(e.look==="handDrawn"){const p=jt.svg(u),g=er(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}T(HW,"datastore");async function YW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Tr(t,e,gr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=jt.svg(s),y=er(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),nr(e,b),e.intersect=function(w){return Ht.rect(e,w)},s}T(YW,"dividedRectangle");async function XW(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Kt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=jt.svg(o),y=er(e,{roughness:.2,strokeWidth:2.5}),v=er(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Ki(e.cssClasses)).attr("style",Ki(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return nr(e,d),e.intersect=function(m){return ae.info("DoubleCircle intersect",e,u,m),Ht.circle(e,u,m)},o}T(XW,"doublecircle");function KW(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Kt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=jt.svg(a),{nodeBorder:u}=r,h=er(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),nr(e,f),e.intersect=function(p){return ae.info("filledCircle intersect",e,{radius:s,point:p}),Ht.circle(e,s,p)},a}T(KW,"filledCircle");var jW=10,ZW=10;async function QW(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,nr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return ae.info("Triangle intersect",e,f,b),Ht.polygon(e,f,b)},s}T(QW,"flippedTriangle");function JW(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Kt(e);e.label="";const s=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=jt.svg(s),p=er(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),nr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Ht.rect(e,v)},s}T(JW,"forkJoin");async function eU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),nr(e,b),e.intersect=function(w){return ae.info("Pill intersect",e,{radius:f,point:w}),Ht.polygon(e,y,w)},l}T(eU,"halfRoundedRectangle");var P6e=T((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function tU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Tr(t,e,gr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=jt.svg(h),b=er(e,{}),w=P6e(0,0,g,f,p),k=x.path(w,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=Cc(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,nr(e,y),e.intersect=function(x){return Ht.polygon(e,m,x)},h}T(tU,"hexagon");async function rU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Tr(t,e,gr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=jt.svg(i),u=er(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Wr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),nr(e,p),e.intersect=function(g){return ae.info("Pill intersect",e,{points:h}),Ht.polygon(e,h,g)},i}T(rU,"hourglass");async function nU(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Kt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Tr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=Hp(e),v=-g/2,x=-p/2,b=e.label?8:0,w=jt.svg(u),k=er(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=w.rectangle(v,x,g,p,k),C=Math.max(g,h.width),_=p+h.height+b,L=w.rectangle(-C/2,-_/2,C,_,{...k,fill:"transparent",stroke:"none"}),O=u.insert(()=>S,":first-child"),D=u.insert(()=>L);if(e.icon){const z=u.append("g");z.html(`${await Iu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const F=z.node().getBBox(),A=F.width,R=F.height,N=F.x,M=F.y;z.attr("transform",`translate(${-A/2-N},${f?h.height/2+b/2-R/2-M:-h.height/2-b/2-R/2-M})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),nr(e,D),e.intersect=function(z){if(ae.info("iconSquare intersect",e,z),!e.label)return Ht.rect(e,z);const F=e.x??0,A=e.y??0,R=e.height??0;let N=[];return f?N=[{x:F-h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2+h.height+b},{x:F+g/2,y:A-R/2+h.height+b},{x:F+g/2,y:A+R/2},{x:F-g/2,y:A+R/2},{x:F-g/2,y:A-R/2+h.height+b},{x:F-h.width/2,y:A-R/2+h.height+b}]:N=[{x:F-g/2,y:A-R/2},{x:F+g/2,y:A-R/2},{x:F+g/2,y:A-R/2+p},{x:F+h.width/2,y:A-R/2+p},{x:F+h.width/2/2,y:A+R/2},{x:F-h.width/2,y:A+R/2},{x:F-h.width/2,y:A-R/2+p},{x:F-g/2,y:A-R/2+p}],Ht.polygon(e,N,z)},u}T(nU,"icon");async function iU(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Kt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Tr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=Hp(e),x=jt.svg(u),b=er(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const k=u.append("g");e.icon&&k.html(`${await Iu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=k.node().getBBox(),C=S.width,_=S.height,L=S.x,O=S.y,D=Math.max(C,_)*Math.SQRT2+f*2,z=x.circle(0,0,D,b),F=Math.max(D,h.width),A=D+h.height+p,R=x.rectangle(-F/2,-A/2,F,A,{...b,fill:"transparent",stroke:"none"}),N=u.insert(()=>z,":first-child"),M=u.insert(()=>R);return k.attr("transform",`translate(${-C/2-L},${g?h.height/2+p/2-_/2-O:-h.height/2-p/2-_/2-O})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),nr(e,M),e.intersect=function(I){return ae.info("iconSquare intersect",e,I),Ht.rect(e,I)},u}T(iU,"iconCircle");async function aU(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Kt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Tr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=Hp(e),b=-m/2,w=-g/2,k=e.label?8:0,S=jt.svg(u),C=er(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=x.get("fill");C.stroke=_??v;const L=S.path(Ou(b,w,m,g,5),C),O=Math.max(m,h.width),D=g+h.height+k,z=S.rectangle(-O/2,-D/2,O,D,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child").attr("class","icon-shape2"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Iu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),M=N.width,I=N.height,$=N.x,P=N.y;R.attr("transform",`translate(${-M/2-$},${p?h.height/2+k/2-I/2-P:-h.height/2-k/2-I/2-P})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-D/2:D/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),nr(e,A),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,M=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:M-I/2},{x:N+h.width/2,y:M-I/2},{x:N+h.width/2,y:M-I/2+h.height+k},{x:N+m/2,y:M-I/2+h.height+k},{x:N+m/2,y:M+I/2},{x:N-m/2,y:M+I/2},{x:N-m/2,y:M-I/2+h.height+k},{x:N-h.width/2,y:M-I/2+h.height+k}]:$=[{x:N-m/2,y:M-I/2},{x:N+m/2,y:M-I/2},{x:N+m/2,y:M-I/2+g},{x:N+h.width/2,y:M-I/2+g},{x:N+h.width/2/2,y:M+I/2},{x:N-h.width/2,y:M+I/2},{x:N-h.width/2,y:M-I/2+g},{x:N-m/2,y:M-I/2+g}],Ht.polygon(e,$,R)},u}T(aU,"iconRounded");async function sU(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Kt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Tr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=Hp(e),b=-m/2,w=-g/2,k=e.label?8:0,S=jt.svg(u),C=er(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=x.get("fill");C.stroke=_??v;const L=S.path(Ou(b,w,m,g,.1),C),O=Math.max(m,h.width),D=g+h.height+k,z=S.rectangle(-O/2,-D/2,O,D,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Iu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),M=N.width,I=N.height,$=N.x,P=N.y;R.attr("transform",`translate(${-M/2-$},${p?h.height/2+k/2-I/2-P:-h.height/2-k/2-I/2-P})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-D/2:D/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),nr(e,A),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,M=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:M-I/2},{x:N+h.width/2,y:M-I/2},{x:N+h.width/2,y:M-I/2+h.height+k},{x:N+m/2,y:M-I/2+h.height+k},{x:N+m/2,y:M+I/2},{x:N-m/2,y:M+I/2},{x:N-m/2,y:M-I/2+h.height+k},{x:N-h.width/2,y:M-I/2+h.height+k}]:$=[{x:N-m/2,y:M-I/2},{x:N+m/2,y:M-I/2},{x:N+m/2,y:M-I/2+g},{x:N+h.width/2,y:M-I/2+g},{x:N+h.width/2/2,y:M+I/2},{x:N-h.width/2,y:M+I/2},{x:N-h.width/2,y:M-I/2+g},{x:N-m/2,y:M-I/2+g}],Ht.polygon(e,$,R)},u}T(sU,"iconSquare");async function oU(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Kt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Tr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=jt.svg(d),b=er(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(m,y,u,h,b),k=Math.max(u,f.width),S=h+f.height+v,C=x.rectangle(-k/2,-S/2,k,S,{...b,fill:"none",stroke:"none"}),_=d.insert(()=>w,":first-child"),L=d.insert(()=>C);if(e.img){const O=d.append("image");O.attr("href",e.img),O.attr("width",u),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),_.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),nr(e,L),e.intersect=function(O){if(ae.info("iconSquare intersect",e,O),!e.label)return Ht.rect(e,O);const D=e.x??0,z=e.y??0,F=e.height??0;let A=[];return g?A=[{x:D-f.width/2,y:z-F/2},{x:D+f.width/2,y:z-F/2},{x:D+f.width/2,y:z-F/2+f.height+v},{x:D+u/2,y:z-F/2+f.height+v},{x:D+u/2,y:z+F/2},{x:D-u/2,y:z+F/2},{x:D-u/2,y:z-F/2+f.height+v},{x:D-f.width/2,y:z-F/2+f.height+v}]:A=[{x:D-u/2,y:z-F/2},{x:D+u/2,y:z-F/2},{x:D+u/2,y:z-F/2+h},{x:D+f.width/2,y:z-F/2+h},{x:D+f.width/2/2,y:z+F/2},{x:D-f.width/2,y:z+F/2},{x:D-f.width/2,y:z-F/2+h},{x:D-u/2,y:z-F/2+h}],Ht.polygon(e,A,O)},d}T(oU,"imageSquare");async function lU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=jt.svg(o),m=er(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=Cc(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,nr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(lU,"inv_trapezoid");async function cU(t,e){const{shapeSvg:r,bbox:n,label:i}=await Tr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),nr(e,a),e.intersect=function(l){return Ht.rect(e,l)},r}T(cU,"labelRect");async function uU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=jt.svg(o),m=er(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Cc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,nr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(uU,"lean_left");async function hU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=jt.svg(o),m=er(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Cc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,nr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(hU,"lean_right");function dU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=jt.svg(i),d=er(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Wr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),nr(e,g),e.intersect=function(m){return ae.info("lightningBolt intersect",e,m),Ht.polygon(e,u,m)},i}T(dU,"lightningBolt");var B6e=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),F6e=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),z6e=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),fU=10,pU=10;async function gU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=B6e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Ki(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),nr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=Ht.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),x.y+=w}return x},o}T(gU,"linedCylinder");async function mU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Tr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=jt.svg(o),y=er(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Mu(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),nr(e,b),e.intersect=function(w){return Ht.polygon(e,v,w)},o}T(mU,"linedWaveEdgedRect");async function yU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Tr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=jt.svg(l),b=er(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],k=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Wr(w);let C=x.path(S,b);const _=Wr(k);let L=x.path(_,b);e.look!=="handDrawn"&&(C=K_(C),L=K_(L));const O=l.insert("g",":first-child");return O.insert(()=>C),O.insert(()=>L),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),nr(e,O),e.intersect=function(D){return Ht.polygon(e,w,D)},l}T(yU,"multiRect");async function vU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Tr(t,e,gr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=Mu(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],C=jt.svg(i),_=er(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=Wr(k),O=C.path(L,_),D=Wr(S),z=C.path(D,_),F=i.insert(()=>O,":first-child");return F.insert(()=>z),F.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),nr(e,F),e.intersect=function(A){return Ht.polygon(e,k,A)},i}T(vU,"multiWaveEdgedRectangle");async function bU(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Kt(e);e.labelStyle=n,e.useHtmlLabels||cn(lr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Tr(t,e,gr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=jt.svg(s),m=er(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),nr(e,v),e.intersect=function(x){return Ht.rect(e,x)},s}T(bU,"note");var G6e=T((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function xU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Tr(t,e,gr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=jt.svg(i),g=er(e,{}),m=G6e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=Cc(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),nr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Ht.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}T(xU,"question");async function TU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Tr(t,e,gr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=jt.svg(o),x=er(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Wr(m),w=v.path(b,x),k=o.insert(()=>w,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),nr(e,k),e.intersect=function(S){return Ht.polygon(e,m,S)},o}T(TU,"rect_left_inv_arrow");async function wU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Nu(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(cn($e())){const _=h.children[0],L=pt(h);d=_.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}ae.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Nu(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=pt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;pt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),pt(h).attr("transform","translate( "+(d.width(ae.debug("Rough node insert CXC",O),D),":first-child"),S=a.insert(()=>(ae.debug("Rough node insert CXC",O),O),":first-child")}else S=s.insert("rect",":first-child"),C=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),C.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return nr(e,S),e.intersect=function(_){return Ht.rect(e,_)},a}T(wU,"rectWithTitle");async function CU(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return Kp(t,e,i)}T(CU,"roundedRect");var pd=8;async function kU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?pd:pd*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-pd,f=h,p=pd-u/2,g=-h/2,{cssStyles:m}=e,y=jt.svg(s),v=er(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-pd,y:g+f},{x:p-pd,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(k=>[k.x,k.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Ki(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${pd/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),nr(e,w),e.intersect=function(k){return Ht.rect(e,k)},s}T(kU,"shadedProcess");async function EU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await Tr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=jt.svg(o),x=er(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Wr(b),k=v.path(w,x),S=o.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),nr(e,S),e.intersect=function(C){return Ht.polygon(e,b,C)},o}T(EU,"slopedRect");async function SU(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return Kp(t,e,a)}T(SU,"squareRect");async function AU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=jt.svg(o),g=er(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...ib(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...ib(h/2-d,0,d,50,270,450)],y=Wr(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),nr(e,x),e.intersect=function(b){return Ht.polygon(e,m,b)},o}T(AU,"stadium");async function _U(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return Kp(t,e,r)}T(_U,"state");function RU(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=Kt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=jt.svg(h),f=er(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",k=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return nr(e,v),e.intersect=function(w){return Ht.circle(e,(e.width??0)/2,w)},h}T(RU,"stateEnd");function LU(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=jt.svg(a).circle(0,0,e.width,JEe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return nr(e,s),e.intersect=function(u){return Ht.circle(e,(e.width??7)/2,u)},a}T(LU,"stateStart");var jp=8;async function IU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+2*jp+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*jp,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=jt.svg(o),v=er(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+jp,g,p+jp,g+f,v),w=y.line(p+jp+d,g,p+jp+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const k=o.insert(()=>x,":first-child"),{cssStyles:S}=e;k.attr("class","basic label-container").attr("style",Ki(S)),nr(e,k)}else{const y=Cc(o,d,f,m);n&&y.attr("style",n),nr(e,y)}return e.intersect=function(y){return Ht.polygon(e,m,y)},o}T(IU,"subroutine");var e7=.2;async function DU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-e7*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=e7*u,d=e7*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=jt.svg(o),b=er(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],k=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Wr(w),C=x.path(S,b),_=Wr(k),L=x.path(_,{...b,fillStyle:"solid"}),O=o.insert(()=>L,":first-child");return O.insert(()=>C,":first-child"),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),nr(e,O),e.intersect=function(D){return Ht.polygon(e,w,D)},o}T(DU,"taggedRect");async function MU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Tr(t,e,gr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=jt.svg(i),m=er(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Mu(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...Mu(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],w=Wr(y),k=g.path(w,m),S=Wr(b),C=g.path(S,{...m,fillStyle:"solid"}),_=i.insert(()=>C,":first-child");return _.insert(()=>k,":first-child"),_.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),nr(e,_),e.intersect=function(L){return Ht.polygon(e,y,L)},i}T(MU,"taggedWaveEdgedRectangle");async function NU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Tr(t,e,gr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),nr(e,h),e.intersect=function(d){return Ht.rect(e,d)},i}T(NU,"text");var q6e=T((t,e,r,n,i,a)=>`M${t},${e} +`);return zH(n)}b(GH,"preprocessMarkdown");function WH(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}b(WH,"nonMarkdownToLines");function qH(t,e={}){const r=GH(t,e),n=_n.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return b(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}b(qH,"markdownToLines");function VH(t){return t?`

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

    `:""}b(VH,"nonMarkdownToHTML");function UH(t,{markdownAutoWrap:e}={}){const r=_n.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

    ${(o=i.tokens)==null?void 0:o.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(he.warn(`Unsupported markdown: ${i.type}`),i.raw)}return b(n,"output"),r.map(n).join("")}b(UH,"markdownToHTML");function HH(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}b(HH,"splitTextToChars");function YH(t,e){const r=HH(e.content);return l7(t,[],r,e.type)}b(YH,"splitWordToFitWidth");function l7(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?l7(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}b(l7,"splitWordToFitWidthRecursion");function XH(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return X4(t,e)}b(XH,"splitLineToFitWidth");function X4(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return X4(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=YH(e,a);r.push([o]),l.content&&t.unshift(l)}return X4(t,e,r)}b(X4,"splitLineToFitWidthRecursion");function c7(t,e){e&&t.attr("style",e)}b(c7,"applyStyle");var jH=16384;async function KH(t,e,r,n,i=!1,a=sr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,jH)}px`),s.attr("height",`${Math.min(10*r,jH)}px`);const o=s.append("xhtml:div"),l=Li(e.label)?await NC(e.label.replace($t.lineBreakRegex,` +`),a):Qr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),c7(h,e.labelStyle),h.attr("class",`${u} ${n}`),c7(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}b(KH,"addHtmlSpan");function j4(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}b(j4,"createTspan");function ZH(t,e,r){const n=t.append("text"),i=j4(n,1,e);K4(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}b(ZH,"computeWidthOfText");function QH(t,e,r){var s;const n=t.append("text"),i=j4(n,1,e);K4(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}b(QH,"computeDimensionOfText");function JH(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=b(p=>ZH(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:XH(h,d);for(const p of f){const g=j4(l,u,1.1,i);K4(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}b(JH,"createFormattedText");function u7(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}b(u7,"decodeHTMLEntities");function K4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(u7(r.content)):i.text(" "+u7(r.content))})}b(K4,"updateTextContentAndStyles");async function eY(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await z7e(o)?await Jc(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}b(eY,"replaceIconSubstring");var Ja=b(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(he.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?UH(e,h):VH(e),f=await eY(Qc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Li(e)?p:f,labelStyle:r.replace("fill:","color:")};return await KH(t,g,l,i,u,h)}else{const d=Qc(e.replace(//g,"
    ")),f=s?qH(d.replace("
    ","
    "),h):WH(d),p=JH(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");mt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");mt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");mt(p).select("text").attr("style",m)}return n?mt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):mt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function h7(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function SLe(t,e){return t[0]===e[0]&&t[1]===e[1]}function kLe(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)h7(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const x=[...T];SLe(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let x=0;xT.yminx.ymin?1:T.xx.x?1:T.ymax===x.ymax?0:(T.ymax-x.ymax)/Math.abs(T.ymax-x.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let x=0;xy);x++)T=x;g.splice(0,T+1).forEach((x=>{m.push({s:y,edge:x})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,x)=>T.edge.x===x.edge.x?0:(T.edge.x-x.edge.x)/Math.abs(T.edge.x-x.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const w=m[T].edge,C=m[x].edge;p.push([[Math.round(w.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)h7(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),h7(f,h,d)})(l,o,-i)}return l}function Xb(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),kLe(t,i,n,a||1)}class d7{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=Xb(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function Z4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class ELe extends d7{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Xb(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Z4([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class ALe extends d7{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let _Le=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=Xb(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Z4(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Z4(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Z4(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function nY(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(iY(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function jb(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function iY(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=jb(t,e,-h),[r,n]=jb(r,n,-h);const $=(t-r)/2,_=(e-n)/2;let R=$*$/(i*i)+_*_/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const O=i*i,D=a*a,N=O*D-O*_*_-D*$*$,B=O*_*_+D*$*$,F=(o===l?-1:1)*Math.sqrt(Math.abs(N/B));m=F*i*_/a+(t+r)/2,y=F*-a*$/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const $=g,_=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=iY(r=m+i*Math.cos(g),n=y+a*Math.sin(g),_,R,i,a,s,0,l,[g,$,m,y])}v=g-p;const T=Math.cos(p),x=Math.sin(p),w=Math.cos(g),C=Math.sin(g),k=Math.tan(v/4),S=4/3*i*k,E=4/3*a*k,L=[t,e],M=[t+S*x,e-E*T],I=[r+S*C,n-E*w],P=[r,n];if(M[0]=2*L[0]-M[0],M[1]=2*L[1]-M[1],u)return[M,I,P].concat(f);{f=[M,I,P].concat(f);const $=[];for(let _=0;_2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=fY(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=fY(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...uh(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...uh(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function cY(t,e){const r=nY(rY(g7(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...uh(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...OLe(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...uh(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function y7(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Ir(i,e),n[0][1]+Ir(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*hY(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=Ir(p,i,u),g=Ir(g,i,u);const m=[],y=()=>Ir(d,i,u),v=()=>Ir(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:Ir(h,i,u)),e+(T?0:Ir(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function tS(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+Ir(e,r),t[0][1]+Ir(e,r)]),n.push([t[0][0]+Ir(e,r),t[0][1]+Ir(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=Zd(l,u,.5),p=Zd(u,h,.5),g=Zd(h,d,.5),m=Zd(f,p,.5),y=Zd(p,g,.5),v=Zd(m,y,.5);b7([l,f,m,v],0,r,i),b7([v,y,g,d],0,r,i)}var a,s;return i}function PLe(t,e){return iS(t,0,t.length,e)}function iS(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(iS(t,e,u+1,n,a),iS(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function x7(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?iS(n,0,n.length,r):n}const oo="none";class aS{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[aY(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=NLe(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(y7([u],s)):o.push(D0([u],s))}return s.stroke!==oo&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=oY(n,i,s),u=m7(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=m7(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(D0([u.estimatedPoints],s));return s.stroke!==oo&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[J4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=lY(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=lY(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const x=f,w=p;let C=Math.abs(g/2),k=Math.abs(m/2);C+=Ir(.01*C,T),k+=Ir(.01*k,T);let S=y,E=v;for(;S<0;)S+=2*Math.PI,E+=2*Math.PI;E-S>2*Math.PI&&(S=0,E=2*Math.PI);const L=(E-S)/T.curveStepCount,M=[];for(let I=S;I<=E;I+=L)M.push([x+C*Math.cos(I),w+k*Math.sin(I)]);return M.push([x+C*Math.cos(E),w+k*Math.sin(E)]),M.push([x,w]),D0([M],T)})(e,r,n,i,a,s,u));return u.stroke!==oo&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=sY(e,n);if(n.fill&&n.fill!==oo)if(n.fillStyle==="solid"){const s=sY(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...x7(pY([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...x7(pY(u),10,(1+n.roughness)/2))}s.length&&i.push(D0([s],n))}return n.stroke!==oo&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=J4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(y7([e],n)):i.push(D0([e],n))),n.stroke!==oo&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==oo,s=n.stroke!==oo,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=nY(rY(g7(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...x7(v,d)),v=[]},x=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:C,data:k}of p)switch(C){case"M":x(),y=[k[0],k[1]],m.push(y);break;case"L":T(),m.push([k[0],k[1]]);break;case"C":if(!v.length){const S=m.length?m[m.length-1]:y;v.push([S[0],S[1]])}v.push([k[0],k[1]]),v.push([k[2],k[3]]),v.push([k[4],k[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(x(),!f)return g;const w=[];for(const C of g){const k=PLe(C,f);k.length&&w.push(k)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=cY(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=cY(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(y7(l,n));else i.push(D0(l,n));return s&&(o?l.forEach((h=>{i.push(J4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:oo};break;case"fillPath":s={d:this.opsToPath(a),stroke:oo,strokeWidth:0,fill:n.fill||oo};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||oo,strokeWidth:n,fill:oo}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class BLe{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new aS(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const sS="http://www.w3.org/2000/svg";class FLe{constructor(e,r){this.svg=e,this.gen=new aS(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(sS,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(sS,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(sS,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(sS,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var tr={canvas:(t,e)=>new BLe(t,e),svg:(t,e)=>new FLe(t,e),generator:t=>new aS(t),newSeed:()=>aS.newSeed()},_r=b(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||Fl((p=Ve())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",fa(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Ja(s,Qr(Qc(o),Ve()),{useHtmlLabels:i,width:e.width||((g=Ve().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ve());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=mt(h);await XR(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),T7=b(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??An(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Ja(i,Qr(Qc(e),Ve()),{useHtmlLabels:n,width:r.width||((u=(l=Ve())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(An(Ve())){const h=a.children[0],d=mt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),dr=b((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),wr=b((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function an(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}b(an,"createPathFromPoints");function hh(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}b(hh,"generateFullSineWavePoints");function Zb(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=b((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}b(w7,"mergePaths");var zLe=b((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),Qd=zLe,GLe=b(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Ve(),o=An(s);return await Ja(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),dh=GLe,fh=b((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),WLe=b(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Qt(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Fl(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Ja(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const $=y.children[0],_=mt(y);v=$.getBoundingClientRect(),_.attr("width",v.width),_.attr("height",v.height)}const T=e.padding??0,x=e.width<=v.width+T?v.width+T:e.width;e.width<=v.width+T?e.diff=(x-e.width)/2-T:e.diff=-T;const w=e.height,C=e.y-w/2,k=e.y+w/2,S=e.x-x/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+w/3,L=g?4:0,M=v.height+2*L;let I,P;if(g){const $=Math.max(M,v.height+2*L),_=S+$,R=Math.max(0,x-$);if(e.look==="handDrawn"){const N=tr.svg(f),B=rr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),F=rr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),G=N.rectangle(S,C,$,w,B);I=f.insert(()=>G,":first-child");const z=N.rectangle(_,C,R,w,F);P=f.insert(()=>z,":first-child"),I.select("path:nth-child(2)").attr("style",h.join(";")),I.select("path").attr("style",d.join(";").replace("fill","stroke"))}else I=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",u).attr("x",S).attr("y",C).attr("width",$).attr("height",w).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",_).attr("y",C).attr("width",R).attr("height",w).attr("fill","none").attr("stroke",o);const O=S+$/2,D=e.y;m.attr("transform",`translate(${O}, ${D}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const $=Math.max(0,E-C),_=Math.min(M,$),R=C+_,O=Math.max(0,k-R),D=e.x-x/2;if(e.look==="handDrawn"){const F=tr.svg(f),G=rr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=rr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),W=F.rectangle(D,C,x,_,G);I=f.insert(()=>W,":first-child");const V=F.rectangle(D,R,x,O,z);P=f.insert(()=>V,":first-child"),I.select("path:nth-child(2)").attr("style",h.join(";")),I.select("path").attr("style",d.join(";").replace("fill","stroke"))}else I=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",u).attr("x",D).attr("y",C).attr("width",x).attr("height",_).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",D).attr("y",R).attr("width",x).attr("height",O).attr("fill","none").attr("stroke",o);const N=e.x-v.width/2,B=C+(_-v.height)/2;m.attr("transform",`translate(${N}, ${B})`)}if(he.trace("Swimlane data ",e,JSON.stringify(e)),l){const $=m.select("span");$&&$.attr("style",l)}return e.offsetX=0,e.width=x,e.height=w,e.offsetY=v.height-T/2,e.intersect=function($){return Qd(e,$)},{cluster:f,labelBBox:v}},"swimlane"),gY=b(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Qt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=An(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Ja(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await dh(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(An(r)){const S=g.children[0],E=mt(g);m=S.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,x=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const S=tr.svg(d),E=rr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=S.path(fh(T,x,y,v,0),E);w=d.insert(()=>(he.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",x).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=M0(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const S=p.select("span");S&&S.attr("style",o)}const k=w.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return Qd(e,S)},{cluster:d,labelBBox:m}},"rect"),qLe=b((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return Qd(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),VLe=b(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await dh(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(An(r)){const L=p.children[0],M=mt(p);g=L.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,x=e.height+m-g.height-6,w=e.x-v/2,C=e.y-T/2;e.width=v;const k=e.y-e.height/2-y+g.height+2;let S;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),M=tr.svg(u),I=e.rx||e.ry?M.path(fh(w,C,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(w,C,v,T,{seed:i});S=u.insert(()=>I,":first-child");const P=M.rectangle(w,k,v,x,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});S=u.insert(()=>I,":first-child"),f=u.insert(()=>P)}else S=h.insert("rect",":first-child"),S.attr("class","outer").attr("x",w).attr("y",C).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",k).attr("width",v).attr("height",x);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(An(r)?0:3)})`);const E=S.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return Qd(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),ULe=b(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Qt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=An(r),p=d.insert("g").attr("class","cluster-label "),g=await Ja(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(An(r)){const S=g.children[0],E=mt(g);m=S.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,x=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const S=tr.svg(d),E=rr(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=S.path(fh(T,x,y,v,e.rx),E);w=d.insert(()=>(he.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",x).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=M0(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const S=p.select("span");S&&S.attr("style",o)}const k=w.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return Qd(e,S)},{cluster:d,labelBBox:m}},"kanbanSection"),HLe=b((t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=tr.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return Qd(e,m)},{cluster:s,labelBBox:{}}},"divider"),YLe=gY,XLe={rect:gY,squareRect:YLe,roundedWithTitle:VLe,noteGroup:qLe,divider:HLe,kanbanSection:ULe,swimlane:WLe},mY=new Map,oS=b(async(t,e)=>{const r=e.shape||"rect",n=await XLe[r](t,e);return mY.set(e.id,n),n},"insertCluster"),yY=b(()=>{mY=new Map},"clear");function vY(t,e){return t.intersect(e)}b(vY,"intersectNode");var jLe=vY;function bY(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}b(C7,"sameSign");var ZLe=wY;function CY(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",fa(o)),dr(e,d),e.intersect=function(f){return he.info("Circle intersect",e,s,f),jt.circle(e,s,f)},a}b(SY,"anchor");function S7(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),x=Math.atan2((e-T)/a,(t-v)/i);let C=Math.atan2((n-T)/a,(r-v)/i)-x;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);const k=[];for(let S=0;S<20;S++){const E=S/19,L=x+E*C,M=v+i*Math.cos(L),I=T+a*Math.sin(L);k.push({x:M,y:I})}return k}b(S7,"generateArcPoints");function kY(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}b(kY,"calculateArcSagitta");async function EY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=b(L=>L+s,"calcTotalHeight"),l=b(L=>{const M=L/2;return[M/(2.5+L/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await _r(t,e,wr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=kY(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,x=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...S7(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...S7(y/2,v/2,y/2,-v/2,f,p,!0)],w=tr.svg(u),C=rr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=an(x),S=w.path(k,C),E=u.insert(()=>S,":first-child");return E.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),dr(e,E),e.intersect=function(L){return jt.polygon(e,x,L)},u}b(EY,"bowTieRect");function eu(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}b(eu,"insertPolygonShape");var lS=12;async function AY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+lS),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+lS,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+lS},{x:d+lS,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=tr.svg(o),x=rr(e,{}),w=an(m),C=T.path(w,x);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=eu(o,u,h,m);return n&&y.attr("style",n),dr(e,y),e.intersect=function(T){return jt.polygon(e,m,T)},o}b(AY,"card");function _Y(t,e){const{nodeStyles:r}=Qt(e);e.label="";const n=t.insert("g").attr("class",wr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=tr.svg(n),l=rr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=an(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return jt.polygon(e,s,f)},n}b(_Y,"choice");async function k7(t,e,r){const{labelStyles:n,nodeStyles:i}=Qt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await _r(t,e,wr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=tr.svg(a),g=rr(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",fa(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return dr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return jt.circle(p,m,g)},e.intersect=function(p){return he.info("Circle intersect",e,h,p),jt.circle(e,h,p)},a}b(k7,"circle");function RY(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}b(RY,"createLine");function LY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",wr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=tr.svg(i),l=rr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=RY(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),dr(e,f),e.intersect=function(p){return he.info("crossedCircle intersect",e,{radius:a,point:p}),jt.circle(e,a,p)},i}b(LY,"crossedCircle");function tu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),f&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),dr(e,k),e.intersect=function(S){return jt.polygon(e,g,S)},i}b(IY,"curlyBraceLeft");function ru(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),f&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),dr(e,k),e.intersect=function(S){return jt.polygon(e,g,S)},i}b(MY,"curlyBraceRight");function Ia(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.insert(()=>S,":first-child"),M.attr("class","text"),f&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),dr(e,M),e.intersect=function(I){return jt.polygon(e,m,I)},i}b(DY,"curlyBraces");async function NY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await _r(t,e,wr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=tr.svg(u),y=rr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,x=v-p,w=T/4,C=[{x,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x,y:T},...Zb(-x,-T/2,p,50,270,90)],k=an(C),S=m.path(k,y),E=u.insert(()=>S,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),dr(e,E),e.intersect=function(L){return jt.polygon(e,C,L)},u}b(NY,"curvedTrapezoid");var JLe=b((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),e8e=b((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),t8e=b((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),OY=8,$Y=8;async function PY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.width<$Y&&(e.width=$Y);const T=y/2/(2.5+y/50);e.height=(e.height??0)-a-T*3,e.heightC,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=JLe(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",fa(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),dr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=jt.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let x=f*f*(1-T*T/(d*d));x>0&&(x=Math.sqrt(x)),x=f-x,y.y-(e.y??0)>0&&(x=-x),v.y+=x}return v},o}b(PY,"cylinder");async function N0(t,e,r){const{labelStyles:n,nodeStyles:i}=Qt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await _r(t,e,wr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=tr.svg(a),y=rr(e,{}),v=f||p?m.path(fh(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",fa(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",fa(f)).attr("ry",fa(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return dr(e,d),e.calcIntersect=function(m,y){return jt.rect(m,y)},e.intersect=function(m){return jt.rect(e,m)},a}b(N0,"drawRect");async function BY(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await N0(t,e,l);if(e.look==="handDrawn"){const p=tr.svg(u),g=rr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}b(BY,"datastore");async function FY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await _r(t,e,wr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=tr.svg(s),y=rr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),x=s.insert(()=>T,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),dr(e,x),e.intersect=function(w){return jt.rect(e,w)},s}b(FY,"dividedRectangle");async function zY(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Qt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=tr.svg(o),y=rr(e,{roughness:.2,strokeWidth:2.5}),v=rr(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),x=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",fa(e.cssClasses)).attr("style",fa(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(x)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return dr(e,d),e.intersect=function(m){return he.info("DoubleCircle intersect",e,u,m),jt.circle(e,u,m)},o}b(zY,"doublecircle");function GY(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Qt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",wr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=tr.svg(a),{nodeBorder:u}=r,h=rr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),dr(e,f),e.intersect=function(p){return he.info("filledCircle intersect",e,{radius:s,point:p}),jt.circle(e,s,p)},a}b(GY,"filledCircle");var WY=10,qY=10;async function VY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,dr(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(x){return he.info("Triangle intersect",e,f,x),jt.polygon(e,f,x)},s}b(VY,"flippedTriangle");function UY(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Qt(e);e.label="";const s=t.insert("g").attr("class",wr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=tr.svg(s),p=rr(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),dr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return jt.rect(e,v)},s}b(UY,"forkJoin");async function HY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),dr(e,x),e.intersect=function(w){return he.info("Pill intersect",e,{radius:f,point:w}),jt.polygon(e,y,w)},l}b(HY,"halfRoundedRectangle");var r8e=b((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function YY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const x=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*x-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await _r(t,e,wr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=tr.svg(h),x=rr(e,{}),w=r8e(0,0,g,f,p),C=T.path(w,x);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=eu(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,dr(e,y),e.intersect=function(T){return jt.polygon(e,m,T)},h}b(YY,"hexagon");async function XY(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await _r(t,e,wr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=tr.svg(i),u=rr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=an(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),dr(e,p),e.intersect=function(g){return he.info("Pill intersect",e,{points:h}),jt.polygon(e,h,g)},i}b(XY,"hourglass");async function jY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Qt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await _r(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=R0(e),v=-g/2,T=-p/2,x=e.label?8:0,w=tr.svg(u),C=rr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=w.rectangle(v,T,g,p,C),S=Math.max(g,h.width),E=p+h.height+x,L=w.rectangle(-S/2,-E/2,S,E,{...C,fill:"transparent",stroke:"none"}),M=u.insert(()=>k,":first-child"),I=u.insert(()=>L);if(e.icon){const P=u.append("g");P.html(`${await Jc(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=P.node().getBBox(),_=$.width,R=$.height,O=$.x,D=$.y;P.attr("transform",`translate(${-_/2-O},${f?h.height/2+x/2-R/2-D:-h.height/2-x/2-R/2-D})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),dr(e,I),e.intersect=function(P){if(he.info("iconSquare intersect",e,P),!e.label)return jt.rect(e,P);const $=e.x??0,_=e.y??0,R=e.height??0;let O=[];return f?O=[{x:$-h.width/2,y:_-R/2},{x:$+h.width/2,y:_-R/2},{x:$+h.width/2,y:_-R/2+h.height+x},{x:$+g/2,y:_-R/2+h.height+x},{x:$+g/2,y:_+R/2},{x:$-g/2,y:_+R/2},{x:$-g/2,y:_-R/2+h.height+x},{x:$-h.width/2,y:_-R/2+h.height+x}]:O=[{x:$-g/2,y:_-R/2},{x:$+g/2,y:_-R/2},{x:$+g/2,y:_-R/2+p},{x:$+h.width/2,y:_-R/2+p},{x:$+h.width/2/2,y:_+R/2},{x:$-h.width/2,y:_+R/2},{x:$-h.width/2,y:_-R/2+p},{x:$-g/2,y:_-R/2+p}],jt.polygon(e,O,P)},u}b(jY,"icon");async function KY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Qt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await _r(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=R0(e),T=tr.svg(u),x=rr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=v.get("fill");x.stroke=w??y;const C=u.append("g");e.icon&&C.html(`${await Jc(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const k=C.node().getBBox(),S=k.width,E=k.height,L=k.x,M=k.y,I=Math.max(S,E)*Math.SQRT2+f*2,P=T.circle(0,0,I,x),$=Math.max(I,h.width),_=I+h.height+p,R=T.rectangle(-$/2,-_/2,$,_,{...x,fill:"transparent",stroke:"none"}),O=u.insert(()=>P,":first-child"),D=u.insert(()=>R);return C.attr("transform",`translate(${-S/2-L},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),dr(e,D),e.intersect=function(N){return he.info("iconSquare intersect",e,N),jt.rect(e,N)},u}b(KY,"iconCircle");async function ZY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Qt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await _r(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=R0(e),x=-m/2,w=-g/2,C=e.label?8:0,k=tr.svg(u),S=rr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const E=T.get("fill");S.stroke=E??v;const L=k.path(fh(x,w,m,g,5),S),M=Math.max(m,h.width),I=g+h.height+C,P=k.rectangle(-M/2,-I/2,M,I,{...S,fill:"transparent",stroke:"none"}),$=u.insert(()=>L,":first-child").attr("class","icon-shape2"),_=u.insert(()=>P);if(e.icon){const R=u.append("g");R.html(`${await Jc(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=R.node().getBBox(),D=O.width,N=O.height,B=O.x,F=O.y;R.attr("transform",`translate(${-D/2-B},${p?h.height/2+C/2-N/2-F:-h.height/2-C/2-N/2-F})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-I/2:I/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),dr(e,_),e.intersect=function(R){if(he.info("iconSquare intersect",e,R),!e.label)return jt.rect(e,R);const O=e.x??0,D=e.y??0,N=e.height??0;let B=[];return p?B=[{x:O-h.width/2,y:D-N/2},{x:O+h.width/2,y:D-N/2},{x:O+h.width/2,y:D-N/2+h.height+C},{x:O+m/2,y:D-N/2+h.height+C},{x:O+m/2,y:D+N/2},{x:O-m/2,y:D+N/2},{x:O-m/2,y:D-N/2+h.height+C},{x:O-h.width/2,y:D-N/2+h.height+C}]:B=[{x:O-m/2,y:D-N/2},{x:O+m/2,y:D-N/2},{x:O+m/2,y:D-N/2+g},{x:O+h.width/2,y:D-N/2+g},{x:O+h.width/2/2,y:D+N/2},{x:O-h.width/2,y:D+N/2},{x:O-h.width/2,y:D-N/2+g},{x:O-m/2,y:D-N/2+g}],jt.polygon(e,B,R)},u}b(ZY,"iconRounded");async function QY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Qt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await _r(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=R0(e),x=-m/2,w=-g/2,C=e.label?8:0,k=tr.svg(u),S=rr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const E=T.get("fill");S.stroke=E??v;const L=k.path(fh(x,w,m,g,.1),S),M=Math.max(m,h.width),I=g+h.height+C,P=k.rectangle(-M/2,-I/2,M,I,{...S,fill:"transparent",stroke:"none"}),$=u.insert(()=>L,":first-child"),_=u.insert(()=>P);if(e.icon){const R=u.append("g");R.html(`${await Jc(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=R.node().getBBox(),D=O.width,N=O.height,B=O.x,F=O.y;R.attr("transform",`translate(${-D/2-B},${p?h.height/2+C/2-N/2-F:-h.height/2-C/2-N/2-F})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-I/2:I/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),dr(e,_),e.intersect=function(R){if(he.info("iconSquare intersect",e,R),!e.label)return jt.rect(e,R);const O=e.x??0,D=e.y??0,N=e.height??0;let B=[];return p?B=[{x:O-h.width/2,y:D-N/2},{x:O+h.width/2,y:D-N/2},{x:O+h.width/2,y:D-N/2+h.height+C},{x:O+m/2,y:D-N/2+h.height+C},{x:O+m/2,y:D+N/2},{x:O-m/2,y:D+N/2},{x:O-m/2,y:D-N/2+h.height+C},{x:O-h.width/2,y:D-N/2+h.height+C}]:B=[{x:O-m/2,y:D-N/2},{x:O+m/2,y:D-N/2},{x:O+m/2,y:D-N/2+g},{x:O+h.width/2,y:D-N/2+g},{x:O+h.width/2/2,y:D+N/2},{x:O-h.width/2,y:D+N/2},{x:O-h.width/2,y:D-N/2+g},{x:O-m/2,y:D-N/2+g}],jt.polygon(e,B,R)},u}b(QY,"iconSquare");async function JY(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Qt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await _r(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=tr.svg(d),x=rr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=T.rectangle(m,y,u,h,x),C=Math.max(u,f.width),k=h+f.height+v,S=T.rectangle(-C/2,-k/2,C,k,{...x,fill:"none",stroke:"none"}),E=d.insert(()=>w,":first-child"),L=d.insert(()=>S);if(e.img){const M=d.append("image");M.attr("href",e.img),M.attr("width",u),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-u/2},${g?k/2-h:-k/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),dr(e,L),e.intersect=function(M){if(he.info("iconSquare intersect",e,M),!e.label)return jt.rect(e,M);const I=e.x??0,P=e.y??0,$=e.height??0;let _=[];return g?_=[{x:I-f.width/2,y:P-$/2},{x:I+f.width/2,y:P-$/2},{x:I+f.width/2,y:P-$/2+f.height+v},{x:I+u/2,y:P-$/2+f.height+v},{x:I+u/2,y:P+$/2},{x:I-u/2,y:P+$/2},{x:I-u/2,y:P-$/2+f.height+v},{x:I-f.width/2,y:P-$/2+f.height+v}]:_=[{x:I-u/2,y:P-$/2},{x:I+u/2,y:P-$/2},{x:I+u/2,y:P-$/2+h},{x:I+f.width/2,y:P-$/2+h},{x:I+f.width/2/2,y:P+$/2},{x:I-f.width/2,y:P+$/2},{x:I-f.width/2,y:P-$/2+h},{x:I-u/2,y:P-$/2+h}],jt.polygon(e,_,M)},d}b(JY,"imageSquare");async function eX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=tr.svg(o),m=rr(e,{}),y=an(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=eu(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,dr(e,f),e.intersect=function(g){return jt.polygon(e,d,g)},o}b(eX,"inv_trapezoid");async function tX(t,e){const{shapeSvg:r,bbox:n,label:i}=await _r(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),dr(e,a),e.intersect=function(l){return jt.rect(e,l)},r}b(tX,"labelRect");async function rX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=tr.svg(o),m=rr(e,{}),y=an(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=eu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,dr(e,f),e.intersect=function(g){return jt.polygon(e,d,g)},o}b(rX,"lean_left");async function nX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=tr.svg(o),m=rr(e,{}),y=an(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=eu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,dr(e,f),e.intersect=function(g){return jt.polygon(e,d,g)},o}b(nX,"lean_right");function iX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",wr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=tr.svg(i),d=rr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=an(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),dr(e,g),e.intersect=function(m){return he.info("lightningBolt intersect",e,m),jt.polygon(e,u,m)},i}b(iX,"lightningBolt");var n8e=b((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),i8e=b((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),a8e=b((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),aX=10,sX=10;async function oX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthk,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=n8e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",fa(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),dr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=jt.rect(e,v),x=T.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-x*x/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}b(oX,"linedCylinder");async function lX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await _r(t,e,wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=tr.svg(o),y=rr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...hh(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),x=o.insert(()=>T,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),dr(e,x),e.intersect=function(w){return jt.polygon(e,v,w)},o}b(lX,"linedWaveEdgedRect");async function cX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await _r(t,e,wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=tr.svg(l),x=rr(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=an(w);let S=T.path(k,x);const E=an(C);let L=T.path(E,x);e.look!=="handDrawn"&&(S=w7(S),L=w7(L));const M=l.insert("g",":first-child");return M.insert(()=>S),M.insert(()=>L),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),dr(e,M),e.intersect=function(I){return jt.polygon(e,w,I)},l}b(cX,"multiRect");async function uX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await _r(t,e,wr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,x=hh(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=x==null?void 0:x[x.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...x,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],k=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],S=tr.svg(i),E=rr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const L=an(C),M=S.path(L,E),I=an(k),P=S.path(I,E),$=i.insert(()=>M,":first-child");return $.insert(()=>P),$.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",n),$.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),dr(e,$),e.intersect=function(_){return jt.polygon(e,C,_)},i}b(uX,"multiWaveEdgedRectangle");async function hX(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Qt(e);e.labelStyle=n,e.useHtmlLabels||An(sr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await _r(t,e,wr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=tr.svg(s),m=rr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),dr(e,v),e.intersect=function(T){return jt.rect(e,T)},s}b(hX,"note");var s8e=b((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function dX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await _r(t,e,wr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=tr.svg(i),g=rr(e,{}),m=s8e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=eu(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),dr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=jt.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}b(dX,"question");async function fX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await _r(t,e,wr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=tr.svg(o),T=rr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const x=an(m),w=v.path(x,T),C=o.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),dr(e,C),e.intersect=function(k){return jt.polygon(e,m,k)},o}b(fX,"rect_left_inv_arrow");async function pX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await dh(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(An(Ve())){const E=h.children[0],L=mt(h);d=E.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}he.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await dh(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=mt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;mt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),mt(h).attr("transform","translate( "+(d.width(he.debug("Rough node insert CXC",M),I),":first-child"),k=a.insert(()=>(he.debug("Rough node insert CXC",M),M),":first-child")}else k=s.insert("rect",":first-child"),S=s.insert("line"),k.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),S.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return dr(e,k),e.intersect=function(E){return jt.rect(e,E)},a}b(pX,"rectWithTitle");async function gX(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return N0(t,e,i)}b(gX,"roundedRect");var Jd=8;async function mX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?Jd:Jd*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-Jd,f=h,p=Jd-u/2,g=-h/2,{cssStyles:m}=e,y=tr.svg(s),v=rr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-Jd,y:g+f},{x:p-Jd,y:g},{x:p,y:g},{x:p,y:g+f}],x=y.polygon(T.map(C=>[C.x,C.y]),v),w=s.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path").attr("style",fa(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${Jd/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),dr(e,w),e.intersect=function(C){return jt.rect(e,C)},s}b(mX,"shadedProcess");async function yX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await _r(t,e,wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=tr.svg(o),T=rr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const x=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=an(x),C=v.path(w,T),k=o.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),k.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),dr(e,k),e.intersect=function(S){return jt.polygon(e,x,S)},o}b(yX,"slopedRect");async function vX(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return N0(t,e,a)}b(vX,"squareRect");async function bX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=tr.svg(o),g=rr(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...Zb(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...Zb(h/2-d,0,d,50,270,450)],y=an(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),dr(e,T),e.intersect=function(x){return jt.polygon(e,m,x)},o}b(bX,"stadium");async function xX(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return N0(t,e,r)}b(xX,"state");function TX(t,e,{config:{themeVariables:r}}){var T,x;const{labelStyles:n,nodeStyles:i}=Qt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=tr.svg(h),f=rr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((x=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:x.id)??"",C=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return dr(e,v),e.intersect=function(w){return jt.circle(e,(e.width??0)/2,w)},h}b(TX,"stateEnd");function wX(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=tr.svg(a).circle(0,0,e.width,FRe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return dr(e,s),e.intersect=function(u){return jt.circle(e,(e.width??7)/2,u)},a}b(wX,"stateStart");var O0=8;async function CX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.width)??l.width)+2*O0+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*O0,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=tr.svg(o),v=rr(e,{}),T=y.rectangle(p,g,d+16,f,v),x=y.line(p+O0,g,p+O0,g+f,v),w=y.line(p+O0+d,g,p+O0+d,g+f,v);o.insert(()=>x,":first-child"),o.insert(()=>w,":first-child");const C=o.insert(()=>T,":first-child"),{cssStyles:k}=e;C.attr("class","basic label-container").attr("style",fa(k)),dr(e,C)}else{const y=eu(o,d,f,m);n&&y.attr("style",n),dr(e,y)}return e.intersect=function(y){return jt.polygon(e,m,y)},o}b(CX,"subroutine");var E7=.2;async function SX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-E7*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=E7*u,d=E7*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=tr.svg(o),x=rr(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=an(w),S=T.path(k,x),E=an(C),L=T.path(E,{...x,fillStyle:"solid"}),M=o.insert(()=>L,":first-child");return M.insert(()=>S,":first-child"),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),dr(e,M),e.intersect=function(I){return jt.polygon(e,w,I)},o}b(SX,"taggedRect");async function kX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await _r(t,e,wr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=tr.svg(i),m=rr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...hh(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,x=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...hh(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=an(y),C=g.path(w,m),k=an(x),S=g.path(k,{...m,fillStyle:"solid"}),E=i.insert(()=>S,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),dr(e,E),e.intersect=function(L){return jt.polygon(e,y,L)},i}b(kX,"taggedWaveEdgedRectangle");async function EX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await _r(t,e,wr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),dr(e,h),e.intersect=function(d){return jt.rect(e,d)},i}b(EX,"text");var o8e=b((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),V6e=T((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),W6e=T((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),OU=5,$U=10;async function PU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=q6e(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ki(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),nr(e,g),e.intersect=function(m){const y=Ht.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},s}T(PU,"tiltedCylinder");async function BU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=jt.svg(o),m=er(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Cc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,nr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(BU,"trapezoid");async function FU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),nr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},u}T(FU,"trapezoidalPentagon");var zU=10,GU=10;async function qU(t,e){var w;const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,nr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(k){return ae.info("Triangle intersect",e,p,k),Ht.polygon(e,p,k)},s}T(qU,"triangle");async function VU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Tr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=jt.svg(l),w=er(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const k=[{x:-d/2-x,y:g/2},...Mu(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Wr(k),C=b.path(S,w),_=l.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),nr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},l}T(VU,"waveEdgedRectangle");async function WU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Tr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=jt.svg(o),m=er(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Mu(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Mu(u/2,-f/2,-u/2,-f/2,d,-1)],v=Wr(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),nr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},o}T(WU,"waveRectangle");var ri=10;async function UU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-ri,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ri,10));const{shapeSvg:s,bbox:o,label:l}=await Tr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ri,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ri,d=u-ri,f=h-ri,p=-d/2,g=-f/2,{cssStyles:m}=e,y=jt.svg(s),v=er(e,{}),x=[{x:p-ri,y:g-ri},{x:p-ri,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ri}],b=`M${p-ri},${g-ri} L${p+d},${g-ri} L${p+d},${g+f} L${p-ri},${g+f} L${p-ri},${g-ri} - M${p-ri},${g} L${p+d},${g} - M${p},${g-ri} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),k=s.insert(()=>w,":first-child");return k.attr("transform",`translate(${ri/2}, ${ri/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ri/2-(o.x-(o.left??0))}, ${-(o.height/2)+ri/2-(o.y-(o.top??0))})`),nr(e,k),e.intersect=function(S){return Ht.polygon(e,x,S)},s}T(UU,"windowPane");var HU=new Set(["redux-color","redux-dark-color"]),U6e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function t7(t,e){var ie,K,se,te;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=lr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=lr(),{background:ee}=Z,ne={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await t7(t,ne)}const u=lr();e.useHtmlLabels=u.htmlLabels;let h=((ie=u.er)==null?void 0:ie.diagramPadding)??10,d=((K=u.er)==null?void 0:K.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Kt(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Va(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(k+S+C+_);k+=Z/D,S+=Z/D,C>0&&(C+=Z/D),_>0&&(_+=Z/D)}const F=k+S+C+_,A=jt.svg(y),R=er(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let N=0;w.length>0&&(N=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const M=Math.max(z.width+h*2,(e==null?void 0:e.width)||0,F),I=Math.max((N??0)+v.height,(e==null?void 0:e.height)||0),$=-M/2,P=-I/2;if(y.selectAll("g:not(:first-child)").each((Z,ee,ne)=>{const oe=pt(ne[ee]),fe=oe.attr("transform");let Ae=0,Re=0;if(fe){const Ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);Ce&&(Ae=parseFloat(Ce[1]),Re=parseFloat(Ce[2]),oe.attr("class").includes("attribute-name")?Ae+=k:oe.attr("class").includes("attribute-keys")?Ae+=k+S:oe.attr("class").includes("attribute-comment")&&(Ae+=k+S+C))}oe.attr("transform",`translate(${$+h/2+Ae}, ${Re+P+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(P+d/2)+")"),n!=null&&HU.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const B=A.rectangle($,P,M,I,R),q=y.insert(()=>B,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,ee]of w.entries()){const oe=(Z+1)%2===0&&ee.yOffset!==0,fe=A.rectangle($,v.height+P+(ee==null?void 0:ee.yOffset),M,ee==null?void 0:ee.rowHeight,{...R,fill:oe?a:s,stroke:o});y.insert(()=>fe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${oe?"even":"odd"}`)}const V=1e-4;let X=Qp($,v.height+P,M+$,v.height+P,V),W=A.polygon(X.map(Z=>[Z.x,Z.y]),R);if(y.insert(()=>W).attr("class","divider"),X=Qp(k+$,v.height+P,k+$,I+P,V),W=A.polygon(X.map(Z=>[Z.x,Z.y]),R),y.insert(()=>W).attr("class","divider"),L){const Z=k+S+$;X=Qp(Z,v.height+P,Z,I+P,V),W=A.polygon(X.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}if(O){const Z=k+S+C+$;X=Qp(Z,v.height+P,Z,I+P,V),W=A.polygon(X.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}for(const Z of b){const ee=v.height+P+Z;X=Qp($,ee,M+$,ee,V),W=A.polygon(X.map(ne=>[ne.x,ne.y]),R),y.insert(()=>W).attr("class","divider")}if(nr(e,q),g&&e.look!=="handDrawn")if(n!=null&&U6e.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(te=Z==null?void 0:Z.filter(ne=>ne.includes("stroke")))==null?void 0:te.map(ne=>`${ne}`).join("; ");y.selectAll("path").attr("style",ee??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Ht.rect(e,Z)},y}T(t7,"erBox");async function Zp(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Su(e)&&(e=Su(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Ua(o,e,{width:Va(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(dc(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}T(Zp,"addText");function Qp(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}T(Qp,"lineToPolygon");async function YU(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",gr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await ab(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await ab(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await ab(u,x,m,[x.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await ab(h,x,y,[x.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}T(YU,"textHelper");async function ab(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=lr();let s="useHtmlLabels"in e?e.useHtmlLabels:dc(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),ci(o)&&(s=!0);const l=await Ua(i,V6(wc(o)),{width:Va(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=pt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}T(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}T(ab,"addText");async function XU(t,e){var A,R;const r=$e(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??dc(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await YU(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Kt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((A=l.styles)==null?void 0:A.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=jt.svg(u),y=er(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=s:l.members.length>0&&l.methods.length===0&&(x+=s*2);const w=-v/2,k=-x/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const C=m.rectangle(w-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,x+2*a+S,y),_=u.insert(()=>C,":first-child");_.attr("class","basic label-container outer-path");const L=_.node().getBBox(),O=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,D=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,z=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,F=(O+D+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((N,M,I)=>{var X,W;const $=pt(I[M]),P=$.attr("transform");let B=0;if(P){const K=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(P);K&&(B=parseFloat(K[2]))}let q=B+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if($.attr("class").includes("methods-group")){const ie=Math.max(z,s/2);b?q=Math.max(F,O+D+ie+k+s*2+a)+s*2:q=O+D+ie+k+s*4+a}l.members.length===0&&l.methods.length===0&&((X=r.class)!=null&&X.hideEmptyMembersBox)&&(l.annotations.length>0?q=B-s:q=B),o||(q-=4);let V=w;($.attr("class").includes("label-group")||$.attr("class").includes("annotation-group"))&&(V=-((W=$.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(ie,K,se){window.getComputedStyle(se[K]).textAnchor==="middle"&&(V=0)})),$.attr("transform",`translate(${V}, ${q})`)}),l.members.length>0||l.methods.length>0||g){const N=O+D+k+a,M=m.line(L.x,N,L.x+L.width,N+.001,y);u.insert(()=>M).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const N=O+D+z+k+s*2+a,M=m.line(L.x,b?Math.max(F,N):N,L.x+L.width,(b?Math.max(F,N):N)+.001,y);u.insert(()=>M).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),_.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const N=RegExp(/color\s*:\s*([^;]*)/),M=N.exec(p);if(M){const I=M[0].replace("color","fill");u.selectAll("tspan").attr("style",I)}else if(d){const I=N.exec(d);if(I){const $=I[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}}}return nr(e,_),e.intersect=function(N){return Ht.rect(e,N)},u}T(XU,"classBox");async function KU(t,e){var L,O;const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=gr(e),{themeVariables:h}=$e(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await vl(p,`<<${i.type}>>`,0,e.labelStyle):g=await vl(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await vl(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const D=await vl(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=D;const z=await vl(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=z;const F=await vl(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=F,await vl(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const D=await vl(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=D,await vl(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,x=(((O=p.node())==null?void 0:O.getBBox().height)??200)+s,b=-v/2,w=-x/2,k=jt.svg(p),S=er(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=k.rectangle(b,w,v,x,S),_=p.insert(()=>C,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const D=e.colorIndex??0;p.attr("data-color-id",`color-${D%d.length}`)}if(p.selectAll(".label").each((D,z,F)=>{const A=pt(F[z]),R=A.attr("transform");let N=0,M=0;if(R){const B=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);B&&(N=parseFloat(B[1]),M=parseFloat(B[2]))}const I=M-x/2;let $=b+s/2;(z===0||z===1)&&($=N),A.attr("transform",`translate(${$}, ${I+s})`)}),m>g+y+o){const D=w+g+y+o;let z;if(e.look==="neo"){const R=[[b,D],[b+v,D],[b+v,D+.001],[b,D+.001]];z=k.polygon(R,S)}else z=k.line(b,D,b+v,D,S);p.insert(()=>z).attr("class","divider")}return nr(e,_),e.intersect=function(D){return Ht.rect(e,D)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}T(KU,"requirementBox");async function vl(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=$e(),s=a.htmlLabels??!0,o=await Ua(i,V6(wc(e)),{width:Va(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=pt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}T(vl,"addText");var H6e=T(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function jU(t,e,{config:r}){var z,F;const{labelStyles:n,nodeStyles:i}=Kt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Tr(t,e,gr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(d=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await X_(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await X_(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await X_(o,"assigned"in e&&e.assigned||"",p);e.width=s;const x=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,k=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+w,S=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let _;const{rx:L,ry:O}=e,{cssStyles:D}=e;if(e.look==="handDrawn"){const A=jt.svg(o),R=er(e,{}),N=L||O?A.path(Ou(S,C,b,k,L||0),R):A.rectangle(S,C,b,k,R);_=o.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",D||null)}else{_=o.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",O??5).attr("x",S).attr("y",C).attr("width",b).attr("height",k);const A="priority"in e&&e.priority;if(A){const R=o.append("line"),N=S+2,M=C+Math.floor((L??0)/2),I=C+k-Math.floor((L??0)/2);R.attr("x1",N).attr("y1",M).attr("x2",N).attr("y2",I).attr("stroke-width","4").attr("stroke",H6e(A))}}return nr(e,_),e.height=k,e.intersect=function(A){return Ht.rect(e,A)},o}T(jU,"kanbanItem");async function ZU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Tr(t,e,gr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 + l${-r},0`,"createCylinderPathD"),l8e=b((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),c8e=b((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),AX=5,_X=10;async function RX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightx,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=o8e(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",fa(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),dr(e,g),e.intersect=function(m){const y=jt.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}b(RX,"tiltedCylinder");async function LX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=tr.svg(o),m=rr(e,{}),y=an(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=eu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,dr(e,f),e.intersect=function(g){return jt.polygon(e,d,g)},o}b(LX,"trapezoid");async function IX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),dr(e,x),e.intersect=function(w){return jt.polygon(e,y,w)},u}b(IX,"trapezoidalPentagon");var MX=10,DX=10;async function NX(t,e){var w;const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=h,e.height=d,dr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return he.info("Triangle intersect",e,p,C),jt.polygon(e,p,C)},s}b(NX,"triangle");async function OX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await _r(t,e,wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,x=tr.svg(l),w=rr(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-d/2-T,y:g/2},...hh(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],k=an(C),S=x.path(k,w),E=l.insert(()=>S,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),dr(e,E),e.intersect=function(L){return jt.polygon(e,C,L)},l}b(OX,"waveEdgedRectangle");async function $X(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await _r(t,e,wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=tr.svg(o),m=rr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...hh(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...hh(u/2,-f/2,-u/2,-f/2,d,-1)],v=an(y),T=g.path(v,m),x=o.insert(()=>T,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),dr(e,x),e.intersect=function(w){return jt.polygon(e,y,w)},o}b($X,"waveRectangle");var xi=10;async function PX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-xi,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-xi,10));const{shapeSvg:s,bbox:o,label:l}=await _r(t,e,wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+xi,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+xi,d=u-xi,f=h-xi,p=-d/2,g=-f/2,{cssStyles:m}=e,y=tr.svg(s),v=rr(e,{}),T=[{x:p-xi,y:g-xi},{x:p-xi,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-xi}],x=`M${p-xi},${g-xi} L${p+d},${g-xi} L${p+d},${g+f} L${p-xi},${g+f} L${p-xi},${g-xi} + M${p-xi},${g} L${p+d},${g} + M${p},${g-xi} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(x,v),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${xi/2}, ${xi/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+xi/2-(o.x-(o.left??0))}, ${-(o.height/2)+xi/2-(o.y-(o.top??0))})`),dr(e,C),e.intersect=function(k){return jt.polygon(e,T,k)},s}b(PX,"windowPane");var BX=new Set(["redux-color","redux-dark-color"]),u8e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function A7(t,e){var te,Y,se,J;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=sr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=sr(),{background:ee}=Z,re={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await A7(t,re)}const u=sr();e.useHtmlLabels=u.htmlLabels;let h=((te=u.er)==null?void 0:te.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Qt(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};hs(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(C+k+S+E);C+=Z/I,k+=Z/I,S>0&&(S+=Z/I),E>0&&(E+=Z/I)}const $=C+k+S+E,_=tr.svg(y),R=rr(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let O=0;w.length>0&&(O=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const D=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,$),N=Math.max((O??0)+v.height,(e==null?void 0:e.height)||0),B=-D/2,F=-N/2;if(y.selectAll("g:not(:first-child)").each((Z,ee,re)=>{const ge=mt(re[ee]),ae=ge.attr("transform");let _e=0,Fe=0;if(ae){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ae);ue&&(_e=parseFloat(ue[1]),Fe=parseFloat(ue[2]),ge.attr("class").includes("attribute-name")?_e+=C:ge.attr("class").includes("attribute-keys")?_e+=C+k:ge.attr("class").includes("attribute-comment")&&(_e+=C+k+S))}ge.attr("transform",`translate(${B+h/2+_e}, ${Fe+F+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(F+d/2)+")"),n!=null&&BX.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const G=_.rectangle(B,F,D,N,R),z=y.insert(()=>G,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[Z,ee]of w.entries()){const ge=(Z+1)%2===0&&ee.yOffset!==0,ae=_.rectangle(B,v.height+F+(ee==null?void 0:ee.yOffset),D,ee==null?void 0:ee.rowHeight,{...R,fill:ge?a:s,stroke:o});y.insert(()=>ae,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ge?"even":"odd"}`)}const W=1e-4;let V=P0(B,v.height+F,D+B,v.height+F,W),H=_.polygon(V.map(Z=>[Z.x,Z.y]),R);if(y.insert(()=>H).attr("class","divider"),V=P0(C+B,v.height+F,C+B,N+F,W),H=_.polygon(V.map(Z=>[Z.x,Z.y]),R),y.insert(()=>H).attr("class","divider"),L){const Z=C+k+B;V=P0(Z,v.height+F,Z,N+F,W),H=_.polygon(V.map(ee=>[ee.x,ee.y]),R),y.insert(()=>H).attr("class","divider")}if(M){const Z=C+k+S+B;V=P0(Z,v.height+F,Z,N+F,W),H=_.polygon(V.map(ee=>[ee.x,ee.y]),R),y.insert(()=>H).attr("class","divider")}for(const Z of x){const ee=v.height+F+Z;V=P0(B,ee,D+B,ee,W),H=_.polygon(V.map(re=>[re.x,re.y]),R),y.insert(()=>H).attr("class","divider")}if(dr(e,z),g&&e.look!=="handDrawn")if(n!=null&&u8e.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(J=Z==null?void 0:Z.filter(re=>re.includes("stroke")))==null?void 0:J.map(re=>`${re}`).join("; ");y.selectAll("path").attr("style",ee??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return jt.rect(e,Z)},y}b(A7,"erBox");async function $0(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==ah(e)&&(e=ah(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Ja(o,e,{width:hs(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Fl(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=mt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}b($0,"addText");function P0(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}b(P0,"lineToPolygon");async function FX(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await Qb(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await Qb(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const x=await Qb(u,T,m,[T.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const x=await Qb(h,T,y,[T.parseClassifier()]);y+=x+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}b(FX,"textHelper");async function Qb(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=sr();let s="useHtmlLabels"in e?e.useHtmlLabels:Fl(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Li(o)&&(s=!0);const l=await Ja(i,g_(Qc(o)),{width:hs(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=mt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const x=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(x,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}b(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&mt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}b(Qb,"addText");async function zX(t,e){var _,R;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??Fl(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await FX(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Qt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((_=l.styles)==null?void 0:_.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=tr.svg(u),y=rr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const x=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,C=-T/2;let k=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;x&&(k=a*2);const S=m.rectangle(w-a,C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+k,y),E=u.insert(()=>S,":first-child");E.attr("class","basic label-container outer-path");const L=E.node().getBBox(),M=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,I=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,$=(M+I+C+a-(C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((O,D,N)=>{var V,H;const B=mt(N[D]),F=B.attr("transform");let G=0;if(F){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);Y&&(G=parseFloat(Y[2]))}let z=G+C+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(B.attr("class").includes("methods-group")){const te=Math.max(P,s/2);x?z=Math.max($,M+I+te+C+s*2+a)+s*2:z=M+I+te+C+s*4+a}l.members.length===0&&l.methods.length===0&&((V=r.class)!=null&&V.hideEmptyMembersBox)&&(l.annotations.length>0?z=G-s:z=G),o||(z-=4);let W=w;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(W=-((H=B.node())==null?void 0:H.getBBox().width)/2||0,u.selectAll("text").each(function(te,Y,se){window.getComputedStyle(se[Y]).textAnchor==="middle"&&(W=0)})),B.attr("transform",`translate(${W}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const O=M+I+C+a,D=m.line(L.x,O,L.x+L.width,O+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const O=M+I+P+C+s*2+a,D=m.line(L.x,x?Math.max($,O):O,L.x+L.width,(x?Math.max($,O):O)+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const O=RegExp(/color\s*:\s*([^;]*)/),D=O.exec(p);if(D){const N=D[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=O.exec(d);if(N){const B=N[0].replace("color","fill");u.selectAll("tspan").attr("style",B)}}}return dr(e,E),e.intersect=function(O){return jt.rect(e,O)},u}b(zX,"classBox");async function GX(t,e){var L,M;const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Hl(p,`<<${i.type}>>`,0,e.labelStyle):g=await Hl(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Hl(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const I=await Hl(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=I;const P=await Hl(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const $=await Hl(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=$,await Hl(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const I=await Hl(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=I,await Hl(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,T=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,x=-v/2,w=-T/2,C=tr.svg(p),k=rr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=C.rectangle(x,w,v,T,k),E=p.insert(()=>S,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const I=e.colorIndex??0;p.attr("data-color-id",`color-${I%d.length}`)}if(p.selectAll(".label").each((I,P,$)=>{const _=mt($[P]),R=_.attr("transform");let O=0,D=0;if(R){const G=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);G&&(O=parseFloat(G[1]),D=parseFloat(G[2]))}const N=D-T/2;let B=x+s/2;(P===0||P===1)&&(B=O),_.attr("transform",`translate(${B}, ${N+s})`)}),m>g+y+o){const I=w+g+y+o;let P;if(e.look==="neo"){const R=[[x,I],[x+v,I],[x+v,I+.001],[x,I+.001]];P=C.polygon(R,k)}else P=C.line(x,I,x+v,I,k);p.insert(()=>P).attr("class","divider")}return dr(e,E),e.intersect=function(I){return jt.rect(e,I)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}b(GX,"requirementBox");async function Hl(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Ve(),s=a.htmlLabels??!0,o=await Ja(i,g_(Qc(e)),{width:hs(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=mt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}b(Hl,"addText");var h8e=b(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function WX(t,e,{config:r}){var P,$;const{labelStyles:n,nodeStyles:i}=Qt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await _r(t,e,wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=($=r==null?void 0:r.kanban)==null?void 0:$.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await T7(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await T7(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await T7(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,x=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,C=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,k=-x/2,S=-C/2;u.attr("transform","translate("+(h-x/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-x/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+x/2-v.width-2*a)+", "+(-w+l.height/2)+")");let E;const{rx:L,ry:M}=e,{cssStyles:I}=e;if(e.look==="handDrawn"){const _=tr.svg(o),R=rr(e,{}),O=L||M?_.path(fh(k,S,x,C,L||0),R):_.rectangle(k,S,x,C,R);E=o.insert(()=>O,":first-child"),E.attr("class","basic label-container").attr("style",I||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",M??5).attr("x",k).attr("y",S).attr("width",x).attr("height",C);const _="priority"in e&&e.priority;if(_){const R=o.append("line"),O=k+2,D=S+Math.floor((L??0)/2),N=S+C-Math.floor((L??0)/2);R.attr("x1",O).attr("y1",D).attr("x2",O).attr("y2",N).attr("stroke-width","4").attr("stroke",h8e(_))}}return dr(e,E),e.height=C,e.intersect=function(_){return jt.rect(e,_)},o}b(WX,"kanbanItem");async function qX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await _r(t,e,wr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -253,7 +256,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const x=jt.svg(i),b=er(e,{}),w=x.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Ki(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),nr(e,y),e.calcIntersect=function(x,b){return Ht.rect(x,b)},e.intersect=function(x){return ae.info("Bang intersect",e,x),Ht.rect(e,x)},i}T(ZU,"bang");async function QU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Tr(t,e,gr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const T=tr.svg(i),x=rr(e,{}),w=T.path(v,x);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",fa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),dr(e,y),e.calcIntersect=function(T,x){return jt.rect(T,x)},e.intersect=function(T){return he.info("Bang intersect",e,T),jt.rect(e,T)},i}b(qX,"bang");async function VX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await _r(t,e,wr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -267,7 +270,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const v=jt.svg(i),x=er(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Ki(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),nr(e,m),e.calcIntersect=function(v,x){return Ht.rect(v,x)},e.intersect=function(v){return ae.info("Cloud intersect",e,v),Ht.rect(e,v)},i}T(QU,"cloud");async function JU(t,e){const{labelStyles:r,nodeStyles:n}=Kt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Tr(t,e,gr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const v=tr.svg(i),T=rr(e,{}),x=v.path(y,T);m=i.insert(()=>x,":first-child"),m.attr("class","basic label-container").attr("style",fa(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),dr(e,m),e.calcIntersect=function(v,T){return jt.rect(v,T)},e.intersect=function(v){return he.info("Cloud intersect",e,v),jt.rect(e,v)},i}b(VX,"cloud");async function UX(t,e){const{labelStyles:r,nodeStyles:n}=Qt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await _r(t,e,wr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -287,25 +290,27 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),nr(e,f),e.calcIntersect=function(p,g){return Ht.rect(p,g)},e.intersect=function(p){return Ht.rect(e,p)},i}T(JU,"defaultMindmapNode");async function eH(t,e){const r={padding:e.padding??0};return J_(t,e,r)}T(eH,"mindmapCircle");var Y6e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:SU},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:CU},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:AU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:IU},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:UW},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:HW},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:J_},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:ZU},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:QU},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:xU},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:tU},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:hU},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:uU},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:BU},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:lU},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:XW},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:NU},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:OW},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:kU},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:LU},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:RU},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:JW},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:rU},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:FW},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:zW},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:GW},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:dU},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:VU},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:eU},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:PU},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:gU},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:qW},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:YW},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:qU},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:UU},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:KW},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:FU},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:QW},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:EU},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:vU},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:yU},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:NW},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:BW},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:MU},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:DU},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:WU},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:TU},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:mU}],X6e=T(()=>{const e=[...Object.entries({state:_U,choice:$W,note:bU,rectWithTitle:wU,labelRect:cU,iconSquare:sU,iconCircle:iU,icon:nU,iconRounded:aU,imageSquare:oU,anchor:DW,kanbanItem:jU,mindmapCircle:eH,defaultMindmapNode:JU,classBox:XU,erBox:t7,requirementBox:KU}),...Y6e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),tH=X6e();function rH(t){return t in tH}T(rH,"isValidShape");var lC=new Map;async function cC(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?tH[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Ki(e.look)),e.tooltip&&i.attr("title",e.tooltip),lC.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}T(cC,"insertNode");var K6e=T((t,e)=>{lC.set(e.id,t)},"setNodeElem"),j6e=T(()=>{lC.clear()},"clear"),r7=T(t=>{const e=lC.get(t.id);ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),Z6e=T((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&nH(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&nH(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),Q6e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},J6e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],nH=T((t,e,r,n,i,a,s=!1,o)=>{var g;const l=Q6e[r],u=l&&J6e.includes(l.type);if(!l){ae.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),eAe=T(t=>{var e,r;return typeof t=="string"?t:(r=(e=$e())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),uC=new Map,ca=new Map,tAe=T(()=>{uC.clear(),ca.clear()},"clear"),sb=T(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),iH=T(async(t,e)=>{const r=$e();let n=cn(r);const{labelStyles:i}=Kt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Ua(t,e.label,{style:sb(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),ae.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=pt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=pt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",ml(d,n)),uC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Nu(g,e.startLabelLeft,sb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",ml(y,n)),ca.get(e.id)||ca.set(e.id,{}),ca.get(e.id).startLeft=p,ob(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Nu(g,e.startLabelRight,sb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",ml(y,n)),ca.get(e.id)||ca.set(e.id,{}),ca.get(e.id).startRight=p,ob(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Nu(p,e.endLabelLeft,sb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",ml(y,n)),ca.get(e.id)||ca.set(e.id,{}),ca.get(e.id).endLeft=p,ob(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Nu(p,e.endLabelRight,sb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",ml(y,n)),ca.get(e.id)||ca.set(e.id,{}),ca.get(e.id).endRight=p,ob(f,e.endLabelRight)}return u},"insertEdgeLabel");function ob(t,e){cn($e())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(ob,"setTerminalWidth");var aH=T((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,uC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=$e(),{subGraphTitleTotalMargin:i}=K2(n);if(t.label){const a=uC.get(t.id);let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ca.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ca.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ca.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ca.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),rAe=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),nAe=T((t,e,r)=>{ae.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),dr(e,f),e.calcIntersect=function(p,g){return jt.rect(p,g)},e.intersect=function(p){return jt.rect(e,p)},i}b(UX,"defaultMindmapNode");async function HX(t,e){const r={padding:e.padding??0};return k7(t,e,r)}b(HX,"mindmapCircle");var d8e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:vX},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:gX},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:bX},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:CX},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:PY},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:BY},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:k7},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:qX},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:VX},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:dX},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:YY},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:nX},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:rX},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:LX},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:eX},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:zY},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:EX},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:AY},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:mX},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:wX},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:TX},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:UY},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:XY},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:IY},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:MY},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:DY},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:iX},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:OX},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:HY},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:RX},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:oX},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:NY},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:FY},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:NX},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:PX},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:GY},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:IX},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:VY},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:yX},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:uX},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:cX},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:EY},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:LY},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:kX},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:SX},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:$X},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:fX},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:lX}],f8e=b(()=>{const e=[...Object.entries({state:xX,choice:_Y,note:hX,rectWithTitle:pX,labelRect:tX,iconSquare:QY,iconCircle:KY,icon:jY,iconRounded:ZY,imageSquare:JY,anchor:SY,kanbanItem:WX,mindmapCircle:HX,defaultMindmapNode:UX,classBox:zX,erBox:A7,requirementBox:GX}),...d8e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),YX=f8e();function XX(t){return t in YX}b(XX,"isValidShape");var cS=new Map;async function Jb(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?YX[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",fa(e.look)),e.tooltip&&i.attr("title",e.tooltip),cS.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}b(Jb,"insertNode");var p8e=b((t,e)=>{cS.set(e.id,t)},"setNodeElem"),jX=b(()=>{cS.clear()},"clear"),uS=b(t=>{const e=cS.get(t.id);he.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),Yl=b((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),pa={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},KX={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ex(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=ci(t),e=ci(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}b(ex,"calculateDeltaAndAngle");var ci=b(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),ZX=b(t=>({x:b(function(e,r,n){let i=0;const a=ci(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(pa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=ex(n[n.length-1],n[n.length-2]);i=pa[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(ci(e).x-ci(n[n.length-1]).x),o=Math.abs(ci(e).y-ci(n[n.length-1]).y),l=Math.abs(ci(e).x-ci(n[0]).x),u=Math.abs(ci(e).y-ci(n[0]).y),h=pa[t.arrowTypeStart],d=pa[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(pa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=ex(n[n.length-1],n[n.length-2]);i=pa[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(ci(e).y-ci(n[n.length-1]).y),o=Math.abs(ci(e).x-ci(n[n.length-1]).x),l=Math.abs(ci(e).y-ci(n[0]).y),u=Math.abs(ci(e).x-ci(n[0]).x),h=pa[t.arrowTypeStart],d=pa[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&QX(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&QX(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),m8e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},y8e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],QX=b((t,e,r,n,i,a,s=!1,o)=>{var g;const l=m8e[r],u=l&&y8e.includes(l.type);if(!l){he.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),v8e=b(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ve())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),tx=new Map,Di=new Map,JX=b(()=>{tx.clear(),Di.clear()},"clear"),rx=b(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),hS=b(async(t,e)=>{const r=Ve();let n=An(r);const{labelStyles:i}=Qt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Ja(t,e.label,{style:rx(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),he.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=mt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=mt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Yl(d,n)),tx.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await dh(g,e.startLabelLeft,rx(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=mt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Yl(y,n)),Di.get(e.id)||Di.set(e.id,{}),Di.get(e.id).startLeft=p,nx(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await dh(g,e.startLabelRight,rx(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=mt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Yl(y,n)),Di.get(e.id)||Di.set(e.id,{}),Di.get(e.id).startRight=p,nx(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await dh(p,e.endLabelLeft,rx(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=mt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Yl(y,n)),Di.get(e.id)||Di.set(e.id,{}),Di.get(e.id).endLeft=p,nx(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await dh(p,e.endLabelRight,rx(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=mt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Yl(y,n)),Di.get(e.id)||Di.set(e.id,{}),Di.get(e.id).endRight=p,nx(f,e.endLabelRight)}return u},"insertEdgeLabel");function nx(t,e){An(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}b(nx,"setTerminalWidth");var ej=b((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,tx.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=M0(n);if(t.label){const a=tx.get(t.id);let s=t.x,o=t.y;if(r){const l=Er.calcLabelPosition(r);he.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Di.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Di.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Di.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Di.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),b8e=b((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),x8e=b((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),T8e=b((t,e,r)=>{he.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ae.info("abc88 checking point",a,e),!rAe(e,a)&&!i){const s=nAe(e,n,a);ae.debug("abc88 inside",a,n,s),ae.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?ae.warn("abc88 no intersect",s,r):r.push(s),i=!0}else ae.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ae.debug("returning points",r),r},"cutPathAtIntersect");function oH(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}T(oH,"extractCornerPoints");var lH=T(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),iAe=T(function(t){const{cornerPointPositions:e}=oH(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ae.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else ae.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),aAe=T((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),cH=T(function(t,e,r,n,i,a,s,o=!1){var M;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=$e();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const I in e.cssCompiledStyles)w_(I)||p.push(e.cssCompiledStyles[I]);ae.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),ae.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(ae.info("to cluster abc88",r.get(e.toCluster)),u=sH(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(ae.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=sH(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(I=>!Number.isNaN(I.y));const y=eAe(e.curve);y!=="rounded"&&(m=iAe(m));let v=O2;switch(y){case"linear":v=O2;break;case"basis":v=P2;break;case"cardinal":v=$z;break;case"bumpX":v=Iz;break;case"bumpY":v=Dz;break;case"catmullRom":v=Bz;break;case"monotoneX":v=Yz;break;case"monotoneY":v=Xz;break;case"natural":v=Zz;break;case"step":v=Qz;break;case"stepAfter":v=eG;break;case"stepBefore":v=Jz;break;case"rounded":v=O2;break;default:v=P2}const{x,y:b}=Fq(e),w=$2().x(x).y(b).curve(v);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let S,C=y==="rounded"?uH(hH(m,e),5):w(m);const _=Array.isArray(e.style)?e.style:[e.style];let L=_.find(I=>I==null?void 0:I.startsWith("stroke:")),O="";e.animate&&(O="edge-animation-fast"),e.animation&&(O="edge-animation-"+e.animation);let D=!1;if(e.look==="handDrawn"){const I=jt.svg(t);Object.assign([],m);const $=I.path(C,{roughness:.3,seed:l});k+=" transition",S=pt($).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",_?_.reduce((B,q)=>B+";"+q,""):"");let P=S.attr("d");S.attr("d",P),t.node().appendChild(S.node())}else{const I=p.join(";"),$=_?_.reduce((W,ie)=>W+ie+";",""):"",P=(I?I+";"+$+";":$)+";"+(_?_.reduce((W,ie)=>W+";"+ie,""):"");S=t.append("path").attr("d",C).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",P),L=(M=P.match(/stroke:([^;]+)/))==null?void 0:M[1],D=e.animate===!0||!!e.animation||I.includes("animation");const B=S.node(),q=typeof B.getTotalLength=="function"?B.getTotalLength():0,V=Bq[e.arrowTypeStart]||0,X=Bq[e.arrowTypeEnd]||0;if(e.look==="neo"&&!D){const ie=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?aAe(q,V,X):`0 ${V} ${q-V-X} ${X}`}; stroke-dashoffset: 0;`;S.attr("style",ie+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",e.id),S.attr("data-points",g),S.attr("data-look",Ki(e.look)),e.showPoints&&m.forEach(I=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let z="";($e().flowchart.arrowMarkerAbsolute||$e().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ae.info("arrowTypeStart",e.arrowTypeStart),ae.info("arrowTypeEnd",e.arrowTypeEnd);const F=!D&&(e==null?void 0:e.look)==="neo";Z6e(S,e,z,s,n,F,L);const A=Math.floor(u.length/2),R=u[A];Lr.isLabelCoordinateInPath(R,S.attr("d"))||(h=!0);let N={};return h&&(N.updatedPath=u),N.originalPath=e.points,N},"insertEdge");function uH(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&La[e.arrowTypeStart]){const i=La[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=n7(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&La[e.arrowTypeEnd]){const i=La[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=n7(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}T(hH,"applyMarkerOffsetsToPoints");var sAe=T((t,e,r,n)=>{e.forEach(i=>{RAe[i](t,r,n)})},"insertMarkers"),oAe=T((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),lAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),cAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),uAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),hAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),dAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),fAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),pAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),gAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),mAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),yAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),vAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),bAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),xAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),wAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),CAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),kAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),EAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{he.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(he.info("abc88 checking point",a,e),!x8e(e,a)&&!i){const s=T8e(e,n,a);he.debug("abc88 inside",a,n,s),he.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?he.warn("abc88 no intersect",s,r):r.push(s),i=!0}else he.warn("abc88 outside",a,n),n=a,i||r.push(a)}),he.debug("returning points",r),r},"cutPathAtIntersect");function rj(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}b(rj,"extractCornerPoints");var nj=b(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),w8e=b(function(t){const{cornerPointPositions:e}=rj(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){he.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else he.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),C8e=b((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),_7=b(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Ve();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const B in e.cssCompiledStyles)MR(B)||g.push(e.cssCompiledStyles[B]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const B=h.slice(1,-1),F=B[0],G=B[B.length-1],z=.5,W=Math.abs(h[h.length-1].x-G.x)!Number.isNaN(B.y));const v=v8e(e.curve);v!=="rounded"&&(y=w8e(y));let T=Lb;switch(v){case"linear":T=Lb;break;case"basis":T=Mb;break;case"cardinal":T=Lq;break;case"bumpX":T=kq;break;case"bumpY":T=Eq;break;case"catmullRom":T=Mq;break;case"monotoneX":T=Gq;break;case"monotoneY":T=Wq;break;case"natural":T=Uq;break;case"step":T=Hq;break;case"stepAfter":T=Xq;break;case"stepBefore":T=Yq;break;case"rounded":T=Lb;break;default:T=Mb}const{x,y:w}=ZX(e),C=Ib().x(x).y(w).curve(T);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let S,E=v==="rounded"?ij(aj(y,e),5):C(y);const L=Array.isArray(e.style)?e.style:[e.style];let M=L.find(B=>B==null?void 0:B.startsWith("stroke:")),I="";e.animate&&(I="edge-animation-fast"),e.animation&&(I="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const B=tr.svg(t);Object.assign([],y);const F=B.path(E,{roughness:.3,seed:l});k+=" transition",S=mt(F).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(I?" "+I:"")).attr("style",L?L.reduce((z,W)=>z+";"+W,""):"");let G=S.attr("d");S.attr("d",G),t.node().appendChild(S.node())}else{const B=g.join(";"),F=L?L.reduce((te,Y)=>te+Y+";",""):"",G=(B?B+";"+F+";":F)+";"+(L?L.reduce((te,Y)=>te+";"+Y,""):"");S=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(I?" "+I:"")).attr("style",G),M=(N=G.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||B.includes("animation");const z=S.node(),W=typeof z.getTotalLength=="function"?z.getTotalLength():0,V=KX[e.arrowTypeStart]||0,H=KX[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?C8e(W,V,H):`0 ${V} ${W-V-H} ${H}`}; stroke-dashoffset: 0;`;S.attr("style",Y+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",e.id),S.attr("data-points",m),S.attr("data-look",fa(e.look)),e.showPoints&&y.forEach(B=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",B.x).attr("cy",B.y)});let $="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&($=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,$=$.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),he.info("arrowTypeStart",e.arrowTypeStart),he.info("arrowTypeEnd",e.arrowTypeEnd);const _=!P&&(e==null?void 0:e.look)==="neo";g8e(S,e,$,s,n,_,M);const R=Math.floor(h.length/2),O=h[R];Er.isLabelCoordinateInPath(O,S.attr("d"))||(d=!0);let D={};return d&&(D.updatedPath=h),D.originalPath=e.points,D},"insertEdge");function ij(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&pa[e.arrowTypeStart]){const i=pa[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=R7(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&pa[e.arrowTypeEnd]){const i=pa[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=R7(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}b(aj,"applyMarkerOffsetsToPoints");var S8e=b((t,e,r,n)=>{e.forEach(i=>{Y8e[i](t,r,n)})},"insertMarkers"),k8e=b((t,e,r)=>{he.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),E8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),A8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),_8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),R8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),L8e=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),I8e=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),M8e=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),D8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),N8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),O8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),$8e=b((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),P8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),B8e=b((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),F8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),z8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),G8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),W8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),q8e=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),SAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),V8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),AAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),_Ae=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),RAe={extension:oAe,composition:lAe,aggregation:cAe,dependency:uAe,lollipop:hAe,point:dAe,circle:fAe,cross:pAe,barb:gAe,barbNeo:mAe,only_one:yAe,zero_or_one:vAe,one_or_more:bAe,zero_or_more:xAe,only_one_neo:TAe,zero_or_one_neo:wAe,one_or_more_neo:CAe,zero_or_more_neo:kAe,requirement_arrow:EAe,requirement_contains:AAe,requirement_arrow_neo:SAe,requirement_contains_neo:_Ae},dH=sAe,LAe={common:It,getConfig:lr,insertCluster:j_,insertEdge:cH,insertEdgeLabel:iH,insertMarkers:dH,insertNode:cC,interpolateToCurve:m_,labelHelper:Tr,log:ae,positionEdgeLabel:aH},lb={},fH=T(t=>{for(const e of t)lb[e.name]=e},"registerLayoutLoaders"),IAe=T(()=>{fH([{name:"dagre",loader:T(async()=>await Promise.resolve().then(()=>LPe),"loader")},{name:"cose-bilkent",loader:T(async()=>await Promise.resolve().then(()=>xWe),"loader")}])},"registerDefaultLayoutLoaders");IAe();var Jp=T(async(t,e)=>{if(!(t.layoutAlgorithm in lb))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=lb[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,LAe,{algorithm:r.algorithm})},"render"),cb=T((t="",{fallback:e="dagre"}={})=>{if(t in lb)return t;if(e in lb)return ae.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),i7="comm",pH="rule",gH="decl",DAe="@media",MAe="@import",NAe="@supports",OAe="@namespace",a7="@keyframes",mH="@layer",$Ae="@scope",PAe=Math.abs,ub=String.fromCharCode;function yH(t){return t.trim()}function s7(t,e,r){return t.replace(e,r)}function e0(t,e){return t.charCodeAt(e)|0}function t0(t,e,r){return t.slice(e,r)}function bl(t){return t.length}function vH(t){return t.length}function hC(t,e){return e.push(t),t}var dC=1,r0=1,bH=0,ao=0,bi=0,n0="";function o7(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:dC,column:r0,length:s,return:"",siblings:o}}function BAe(){return bi}function FAe(){return bi=ao>0?e0(n0,--ao):0,r0--,bi===10&&(r0=1,dC--),bi}function Oo(){return bi=ao2||hb(bi)>3?"":" "}function VAe(t,e){for(;--e&&Oo()&&!(bi<48||bi>102||bi>57&&bi<65||bi>70&&bi<97););return pC(t,fC()+(e<6&&$u()==32&&Oo()==32))}function c7(t){for(;Oo();)switch(bi){case t:return ao;case 34:case 39:t!==34&&t!==39&&c7(bi);break;case 40:t===41&&c7(t);break;case 92:Oo();break}return ao}function WAe(t,e){for(;Oo()&&t+bi!==57;)if(t+bi===84&&$u()===47)break;return"/*"+pC(e,ao-1)+"*"+ub(t===47?t:Oo())}function UAe(t){for(;!hb($u());)Oo();return pC(t,ao)}function HAe(t){return GAe(gC("",null,null,null,[""],t=zAe(t),0,[0],t))}function gC(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,x=0,b=0,w="",k=i,S=a,C=n,_=w;y;)switch(g=b,b=Oo()){case 40:g!=108&&e0(_,d-1)==58?(x++,_+="("):_+=l7(b);break;case 41:x--,_+=")";break;case 34:case 39:case 91:_+=l7(b);break;case 9:case 10:case 13:case 32:if(x>0){_+=ub(b);break}_+=qAe(g);break;case 92:_+=VAe(fC()-1,7);continue;case 47:switch($u()){case 42:case 47:hC(YAe(WAe(Oo(),fC()),e,r,l),l),(hb(g||1)==5||hb($u()||1)==5)&&bl(_)&&t0(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:o[u++]=bl(_)*v;case 125*m:case 59:case 0:if(x>0&&b){_+=ub(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(_=s7(_,/\f/g,"")),p>0&&(bl(_)-d||m===0)&&hC(p>32?TH(_+";",n,r,d-1,l):TH(s7(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(hC(C=xH(_,e,r,u,h,i,o,w,k=[],S=[],d,a),a),b===123)if(h===0)gC(_,e,C,C,k,a,d,o,S);else{switch(f){case 99:if(e0(_,3)===110)break;case 108:if(e0(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?gC(t,C,C,n&&hC(xH(t,C,C,0,0,i,o,w,i,k=[],d,S),S),i,S,d,o,n?k:S):gC(_,C,C,C,[""],S,0,o,S)}}u=h=p=0,m=v=1,w=_="",d=s;break;case 58:d=1+bl(_),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&FAe()==125)continue}switch(_+=ub(b),b*m){case 38:v=h>0?1:(_+="\f",-1);break;case 44:if(x>0)break;o[u++]=(bl(_)-1)*v,v=1;break;case 64:$u()===45&&(_+=l7(Oo())),f=$u(),h=d=bl(w=_+=UAe(fC())),b++;break;case 45:g===45&&bl(_)==2&&(m=0)}}return a}function xH(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=vH(p),m=0,y=0,v=0;m0?p[x]+" "+b:s7(b,/&\f/g,p[x])))&&(l[v++]=w);return o7(t,e,r,i===0?pH:o,l,u,h,d)}function YAe(t,e,r,n){return o7(t,e,r,i7,ub(BAe()),t0(t,2,-2),0,n)}function TH(t,e,r,n,i){return o7(t,e,r,gH,t0(t,0,n),t0(t,n+1,-1),n,i)}function u7(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),ZAe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gUe);return{id:wH,diagram:t}},"loader"),QAe={id:wH,detector:jAe,loader:ZAe},JAe=QAe,CH="flowchart",e_e=T((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),t_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RI);return{id:CH,diagram:t}},"loader"),r_e={id:CH,detector:e_e,loader:t_e},n_e=r_e,kH="flowchart-v2",i_e=T((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),a_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RI);return{id:kH,diagram:t}},"loader"),s_e={id:kH,detector:i_e,loader:a_e},o_e=s_e,EH="er",l_e=T(t=>/^\s*erDiagram/.test(t),"detector"),c_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>OUe);return{id:EH,diagram:t}},"loader"),u_e={id:EH,detector:l_e,loader:c_e},h_e=u_e,SH="gitGraph",d_e=T(t=>/^\s*gitGraph/.test(t),"detector"),f_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Gst);return{id:SH,diagram:t}},"loader"),p_e={id:SH,detector:d_e,loader:f_e},g_e=p_e,AH="gantt",m_e=T(t=>/^\s*gantt/.test(t),"detector"),y_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Kot);return{id:AH,diagram:t}},"loader"),v_e={id:AH,detector:m_e,loader:y_e},b_e=v_e,_H="info",x_e=T(t=>/^\s*info/.test(t),"detector"),T_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>nlt);return{id:_H,diagram:t}},"loader"),w_e={id:_H,detector:x_e,loader:T_e},RH="pie",C_e=T(t=>/^\s*pie/.test(t),"detector"),k_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xlt);return{id:RH,diagram:t}},"loader"),E_e={id:RH,detector:C_e,loader:k_e},LH="quadrantChart",S_e=T(t=>/^\s*quadrantChart/.test(t),"detector"),A_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rlt);return{id:LH,diagram:t}},"loader"),__e={id:LH,detector:S_e,loader:A_e},R_e=__e,IH="xychart",L_e=T(t=>/^\s*xychart(-beta)?/.test(t),"detector"),I_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wlt);return{id:IH,diagram:t}},"loader"),D_e={id:IH,detector:L_e,loader:I_e},M_e=D_e,DH="requirement",N_e=T(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),O_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Qlt);return{id:DH,diagram:t}},"loader"),$_e={id:DH,detector:N_e,loader:O_e},P_e=$_e,MH="sequence",B_e=T(t=>/^\s*sequenceDiagram/.test(t),"detector"),F_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Yct);return{id:MH,diagram:t}},"loader"),z_e={id:MH,detector:B_e,loader:F_e},G_e=z_e,NH="class",q_e=T((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),V_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jct);return{id:NH,diagram:t}},"loader"),W_e={id:NH,detector:q_e,loader:V_e},U_e=W_e,OH="classDiagram",H_e=T((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),Y_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tut);return{id:OH,diagram:t}},"loader"),X_e={id:OH,detector:H_e,loader:Y_e},K_e=X_e,$H="state",j_e=T((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),Z_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wut);return{id:$H,diagram:t}},"loader"),Q_e={id:$H,detector:j_e,loader:Z_e},J_e=Q_e,PH="stateDiagram",e7e=T((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),t7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hut);return{id:PH,diagram:t}},"loader"),r7e={id:PH,detector:e7e,loader:t7e},n7e=r7e,BH="journey",i7e=T(t=>/^\s*journey/.test(t),"detector"),a7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pht);return{id:BH,diagram:t}},"loader"),s7e={id:BH,detector:i7e,loader:a7e},o7e=s7e,l7e=T((t,e,r)=>{ae.debug(`rendering svg for syntax error -`);const n=ms(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),vi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),FH={draw:l7e},c7e=FH,u7e={db:{},renderer:FH,parser:{parse:T(()=>{},"parse")}},h7e=u7e,zH="flowchart-elk",d7e=T((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),f7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RI);return{id:zH,diagram:t}},"loader"),p7e={id:zH,detector:d7e,loader:f7e},g7e=p7e,GH="timeline",m7e=T(t=>/^\s*timeline/.test(t),"detector"),y7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vht);return{id:GH,diagram:t}},"loader"),v7e={id:GH,detector:m7e,loader:y7e},b7e=v7e,qH="mindmap",x7e=T(t=>/^\s*mindmap/.test(t),"detector"),T7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>adt);return{id:qH,diagram:t}},"loader"),w7e={id:qH,detector:x7e,loader:T7e},C7e=w7e,VH="kanban",k7e=T(t=>/^\s*kanban/.test(t),"detector"),E7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Edt);return{id:VH,diagram:t}},"loader"),S7e={id:VH,detector:k7e,loader:E7e},A7e=S7e,WH="sankey",_7e=T(t=>/^\s*sankey(-beta)?/.test(t),"detector"),R7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>uft);return{id:WH,diagram:t}},"loader"),L7e={id:WH,detector:_7e,loader:R7e},I7e=L7e,UH="packet",D7e=T(t=>/^\s*packet(-beta)?/.test(t),"detector"),M7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tft);return{id:UH,diagram:t}},"loader"),N7e={id:UH,detector:D7e,loader:M7e},HH="radar",O7e=T(t=>/^\s*radar-beta/.test(t),"detector"),$7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qft);return{id:HH,diagram:t}},"loader"),P7e={id:HH,detector:O7e,loader:$7e},YH="block",B7e=T(t=>/^\s*block(-beta)?/.test(t),"detector"),F7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>m0t);return{id:YH,diagram:t}},"loader"),z7e={id:YH,detector:B7e,loader:F7e},G7e=z7e,XH="treeView",q7e=T(t=>/^\s*treeView-beta/.test(t),"detector"),V7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>O0t);return{id:XH,diagram:t}},"loader"),W7e={id:XH,detector:q7e,loader:V7e},U7e=W7e,KH="architecture",H7e=T(t=>/^\s*architecture/.test(t),"detector"),Y7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>cgt);return{id:KH,diagram:t}},"loader"),X7e={id:KH,detector:H7e,loader:Y7e},K7e=X7e,jH="eventmodeling",j7e=T(t=>/^\s*eventmodeling/.test(t),"detector"),Z7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Egt);return{id:jH,diagram:t}},"loader"),Q7e={id:jH,detector:j7e,loader:Z7e},J7e=Q7e,ZH="ishikawa",eRe=T(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),tRe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qgt);return{id:ZH,diagram:t}},"loader"),rRe={id:ZH,detector:eRe,loader:tRe},QH="venn",nRe=T(t=>/^\s*venn-beta/.test(t),"detector"),iRe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Amt);return{id:QH,diagram:t}},"loader"),aRe={id:QH,detector:nRe,loader:iRe},sRe=aRe,JH="treemap",oRe=T(t=>/^\s*treemap/.test(t),"detector"),lRe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Bmt);return{id:JH,diagram:t}},"loader"),cRe={id:JH,detector:oRe,loader:lRe},eY="wardley-beta",uRe=T(t=>/^\s*wardley-beta/i.test(t),"detector"),hRe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jmt);return{id:eY,diagram:t}},"loader"),dRe={id:eY,detector:uRe,loader:hRe},fRe=dRe,tY=!1,mC=T(()=>{tY||(tY=!0,Pw("error",h7e,t=>t.toLowerCase().trim()==="error"),Pw("---",{db:{clear:T(()=>{},"clear")},styles:{},renderer:{draw:T(()=>{},"draw")},parser:{parse:T(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:T(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),D6(g7e,C7e,K7e),D6(JAe,A7e,K_e,U_e,h_e,b_e,w_e,E_e,P_e,G_e,o_e,n_e,b7e,g_e,n7e,J_e,o7e,R_e,I7e,N7e,M_e,G7e,J7e,U7e,P7e,rRe,cRe,sRe,fRe))},"addDiagrams"),pRe=T(async()=>{ae.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Wh).map(async([r,{detector:n,loader:i}])=>{if(i)try{U6(r)}catch{try{const{diagram:a,id:s}=await i();Pw(s,a,n)}catch(a){throw ae.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Wh[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ae.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ae.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),gRe="graphics-document document";function rY(t,e){t.attr("role",gRe),e!==""&&t.attr("aria-roledescription",e)}T(rY,"setA11yDiagramInfo");function nY(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}T(nY,"addSVGa11yTitleDescription");var h7=(lp=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=lr(),i=I6(e,n);e=QEe(e)+` -`;try{U6(i)}catch{const d=jbe(i);if(!d)throw new IB(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();Pw(f,p)}const{db:a,parser:s,renderer:o,init:l}=U6(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new lp(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},T(lp,"Diagram"),lp),iY=[],mRe=T(()=>{iY.forEach(t=>{t()}),iY=[]},"attachFunctions"),yRe=T(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function aY(t){const e=t.match(LB);if(!e)return{text:t,metadata:{}};let r=N4(e[1],{schema:M4})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}T(aY,"extractFrontMatter");var vRe=T(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),bRe=T(t=>{const{text:e,metadata:r}=aY(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),xRe=T(t=>{const e=Lr.detectInit(t)??{},r=Lr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:qEe(t),directive:e}},"processDirectives");function d7(t){const e=vRe(t),r=bRe(e),n=xRe(r.text),i=ti(r.config,n.directive);return t=yRe(n.text),{code:t,title:r.title,config:i}}T(d7,"preprocessDiagram");function sY(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}T(sY,"toBase64");var TRe=5e4,wRe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",CRe="sandbox",kRe="loose",ERe="http://www.w3.org/2000/svg",SRe="http://www.w3.org/1999/xlink",ARe="http://www.w3.org/1999/xhtml",_Re="100%",RRe="100%",LRe="border:0;margin:0;",IRe="margin:0",DRe="allow-top-navigation-by-user-activation allow-popups",MRe='The "iframe" tag is not supported by your browser.',NRe=["foreignobject"],ORe=["dominant-baseline"];function f7(t){const e=d7(t);return Dw(),wxe(e.config??{}),e}T(f7,"processAndSetConfigs");async function oY(t,e){mC();try{const{code:r,config:n}=f7(t);return{diagramType:(await hY(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}T(oY,"parse");var lY=T((t,e,r=[])=>{const n=OB(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),$Re=T((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=cn(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{uV(l.styles)||o.forEach(u=>{r.insertRule(lY(l.id,u,l.styles),r.cssRules.length)}),uV(l.textStyles)||r.insertRule(lY(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=$6(i)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),U8e=b((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H8e=b((t,e,r)=>{const n=sr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),Y8e={extension:k8e,composition:E8e,aggregation:A8e,dependency:_8e,lollipop:R8e,point:L8e,circle:I8e,cross:M8e,barb:D8e,barbNeo:N8e,only_one:O8e,zero_or_one:$8e,one_or_more:P8e,zero_or_more:B8e,only_one_neo:F8e,zero_or_one_neo:z8e,one_or_more_neo:G8e,zero_or_more_neo:W8e,requirement_arrow:q8e,requirement_contains:U8e,requirement_arrow_neo:V8e,requirement_contains_neo:H8e},L7=S8e,X8e={common:$t,getConfig:sr,insertCluster:oS,insertEdge:_7,insertEdgeLabel:hS,insertMarkers:L7,insertNode:Jb,interpolateToCurve:qR,labelHelper:_r,log:he,positionEdgeLabel:ej},ix={},sj=b(t=>{for(const e of t)ix[e.name]=e},"registerLayoutLoaders"),j8e=b(()=>{sj([{name:"dagre",loader:b(async()=>await Promise.resolve().then(()=>yqe),"loader")},{name:"swimlane",loader:b(async()=>await Promise.resolve().then(()=>Rqe),"loader")},{name:"cose-bilkent",loader:b(async()=>await Promise.resolve().then(()=>bKe),"loader")}])},"registerDefaultLayoutLoaders");j8e();var B0=b(async(t,e,r)=>{if(!(t.layoutAlgorithm in ix))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=ix[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,X8e,{algorithm:n.algorithm},r)},"render"),ax=b((t="",{fallback:e="dagre"}={})=>{if(t in ix)return t;if(e in ix)return he.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),I7="comm",oj="rule",lj="decl",K8e="@media",Z8e="@import",Q8e="@supports",J8e="@namespace",M7="@keyframes",cj="@layer",eIe="@scope",tIe=Math.abs,sx=String.fromCharCode;function uj(t){return t.trim()}function D7(t,e,r){return t.replace(e,r)}function F0(t,e){return t.charCodeAt(e)|0}function z0(t,e,r){return t.slice(e,r)}function Xl(t){return t.length}function hj(t){return t.length}function dS(t,e){return e.push(t),t}var fS=1,G0=1,dj=0,Lo=0,zi=0,W0="";function N7(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:fS,column:G0,length:s,return:"",siblings:o}}function rIe(){return zi}function nIe(){return zi=Lo>0?F0(W0,--Lo):0,G0--,zi===10&&(G0=1,fS--),zi}function cl(){return zi=Lo2||ox(zi)>3?"":" "}function oIe(t,e){for(;--e&&cl()&&!(zi<48||zi>102||zi>57&&zi<65||zi>70&&zi<97););return gS(t,pS()+(e<6&&ph()==32&&cl()==32))}function $7(t){for(;cl();)switch(zi){case t:return Lo;case 34:case 39:t!==34&&t!==39&&$7(zi);break;case 40:t===41&&$7(t);break;case 92:cl();break}return Lo}function lIe(t,e){for(;cl()&&t+zi!==57;)if(t+zi===84&&ph()===47)break;return"/*"+gS(e,Lo-1)+"*"+sx(t===47?t:cl())}function cIe(t){for(;!ox(ph());)cl();return gS(t,Lo)}function uIe(t){return aIe(mS("",null,null,null,[""],t=iIe(t),0,[0],t))}function mS(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,x=0,w="",C=i,k=a,S=n,E=w;y;)switch(g=x,x=cl()){case 40:g!=108&&F0(E,d-1)==58?(T++,E+="("):E+=O7(x);break;case 41:T--,E+=")";break;case 34:case 39:case 91:E+=O7(x);break;case 9:case 10:case 13:case 32:if(T>0){E+=sx(x);break}E+=sIe(g);break;case 92:E+=oIe(pS()-1,7);continue;case 47:switch(ph()){case 42:case 47:dS(hIe(lIe(cl(),pS()),e,r,l),l),(ox(g||1)==5||ox(ph()||1)==5)&&Xl(E)&&z0(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=Xl(E)*v;case 125*m:case 59:case 0:if(T>0&&x){E+=sx(x);break}switch(x){case 0:case 125:y=0;case 59+h:v==-1&&(E=D7(E,/\f/g,"")),p>0&&(Xl(E)-d||m===0)&&dS(p>32?pj(E+";",n,r,d-1,l):pj(D7(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(dS(S=fj(E,e,r,u,h,i,o,w,C=[],k=[],d,a),a),x===123)if(h===0)mS(E,e,S,S,C,a,d,o,k);else{switch(f){case 99:if(F0(E,3)===110)break;case 108:if(F0(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?mS(t,S,S,n&&dS(fj(t,S,S,0,0,i,o,w,i,C=[],d,k),k),i,k,d,o,n?C:k):mS(E,S,S,S,[""],k,0,o,k)}}u=h=p=0,m=v=1,w=E="",d=s;break;case 58:d=1+Xl(E),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&nIe()==125)continue}switch(E+=sx(x),x*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(T>0)break;o[u++]=(Xl(E)-1)*v,v=1;break;case 64:ph()===45&&(E+=O7(cl())),f=ph(),h=d=Xl(w=E+=cIe(pS())),x++;break;case 45:g===45&&Xl(E)==2&&(m=0)}}return a}function fj(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=hj(p),m=0,y=0,v=0;m0?p[T]+" "+x:D7(x,/&\f/g,p[T])))&&(l[v++]=w);return N7(t,e,r,i===0?oj:o,l,u,h,d)}function hIe(t,e,r,n){return N7(t,e,r,I7,sx(rIe()),z0(t,2,-2),0,n)}function pj(t,e,r,n,i){return N7(t,e,r,lj,z0(t,0,n),z0(t,n+1,-1),n,i)}function P7(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),gIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pZe);return{id:gj,diagram:t}},"loader"),mIe={id:gj,detector:pIe,loader:gIe},yIe=mIe,mj="flowchart",vIe=b((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),bIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>lN);return{id:mj,diagram:t}},"loader"),xIe={id:mj,detector:vIe,loader:bIe},TIe=xIe,yj="flowchart-v2",wIe=b((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),CIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>lN);return{id:yj,diagram:t}},"loader"),SIe={id:yj,detector:wIe,loader:CIe},kIe=SIe,vj="swimlane",EIe=b(t=>/^\s*swimlane-beta\b/.test(t),"detector"),AIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RZe);return{id:vj,diagram:t}},"loader"),_Ie={id:vj,detector:EIe,loader:AIe},RIe=_Ie,bj="er",LIe=b(t=>/^\s*erDiagram/.test(t),"detector"),IIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>PZe);return{id:bj,diagram:t}},"loader"),MIe={id:bj,detector:LIe,loader:IIe},DIe=MIe,xj="gitGraph",NIe=b(t=>/^\s*gitGraph/.test(t),"detector"),OIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wdt);return{id:xj,diagram:t}},"loader"),$Ie={id:xj,detector:NIe,loader:OIe},PIe=$Ie,Tj="gantt",BIe=b(t=>/^\s*gantt/.test(t),"detector"),FIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Kft);return{id:Tj,diagram:t}},"loader"),zIe={id:Tj,detector:BIe,loader:FIe},GIe=zIe,wj="info",WIe=b(t=>/^\s*info/.test(t),"detector"),qIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ipt);return{id:wj,diagram:t}},"loader"),VIe={id:wj,detector:WIe,loader:qIe},Cj="pie",UIe=b(t=>/^\s*pie/.test(t),"detector"),HIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tpt);return{id:Cj,diagram:t}},"loader"),YIe={id:Cj,detector:UIe,loader:HIe},Sj="quadrantChart",XIe=b(t=>/^\s*quadrantChart/.test(t),"detector"),jIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rpt);return{id:Sj,diagram:t}},"loader"),KIe={id:Sj,detector:XIe,loader:jIe},ZIe=KIe,kj="xychart",QIe=b(t=>/^\s*xychart(-beta)?/.test(t),"detector"),JIe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vpt);return{id:kj,diagram:t}},"loader"),eMe={id:kj,detector:QIe,loader:JIe},tMe=eMe,Ej="requirement",rMe=b(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),nMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Qpt);return{id:Ej,diagram:t}},"loader"),iMe={id:Ej,detector:rMe,loader:nMe},aMe=iMe,Aj="sequence",sMe=b(t=>/^\s*sequenceDiagram/.test(t),"detector"),oMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Y0t);return{id:Aj,diagram:t}},"loader"),lMe={id:Aj,detector:sMe,loader:oMe},cMe=lMe,_j="class",uMe=b((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),hMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>J0t);return{id:_j,diagram:t}},"loader"),dMe={id:_j,detector:uMe,loader:hMe},fMe=dMe,Rj="classDiagram",pMe=b((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),gMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tgt);return{id:Rj,diagram:t}},"loader"),mMe={id:Rj,detector:pMe,loader:gMe},yMe=mMe,Lj="state",vMe=b((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),bMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vgt);return{id:Lj,diagram:t}},"loader"),xMe={id:Lj,detector:vMe,loader:bMe},TMe=xMe,Ij="stateDiagram",wMe=b((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),CMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hgt);return{id:Ij,diagram:t}},"loader"),SMe={id:Ij,detector:wMe,loader:CMe},kMe=SMe,Mj="journey",EMe=b(t=>/^\s*journey/.test(t),"detector"),AMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pmt);return{id:Mj,diagram:t}},"loader"),_Me={id:Mj,detector:EMe,loader:AMe},RMe=_Me,LMe=b((t,e,r)=>{he.debug(`rendering svg for syntax error +`);const n=Ka(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),bi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Dj={draw:LMe},IMe=Dj,MMe={db:{},renderer:Dj,parser:{parse:b(()=>{},"parse")}},DMe=MMe,Nj="flowchart-elk",NMe=b((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),OMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>lN);return{id:Nj,diagram:t}},"loader"),$Me={id:Nj,detector:NMe,loader:OMe},PMe=$Me,Oj="timeline",BMe=b(t=>/^\s*timeline/.test(t),"detector"),FMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qmt);return{id:Oj,diagram:t}},"loader"),zMe={id:Oj,detector:BMe,loader:FMe},GMe=zMe,$j="mindmap",WMe=b(t=>/^\s*mindmap/.test(t),"detector"),qMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>a1t);return{id:$j,diagram:t}},"loader"),VMe={id:$j,detector:WMe,loader:qMe},UMe=VMe,Pj="kanban",HMe=b(t=>/^\s*kanban/.test(t),"detector"),YMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>k1t);return{id:Pj,diagram:t}},"loader"),XMe={id:Pj,detector:HMe,loader:YMe},jMe=XMe,Bj="sankey",KMe=b(t=>/^\s*sankey(-beta)?/.test(t),"detector"),ZMe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>uyt);return{id:Bj,diagram:t}},"loader"),QMe={id:Bj,detector:KMe,loader:ZMe},JMe=QMe,Fj="packet",eDe=b(t=>/^\s*packet(-beta)?/.test(t),"detector"),tDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tyt);return{id:Fj,diagram:t}},"loader"),rDe={id:Fj,detector:eDe,loader:tDe},zj="radar",nDe=b(t=>/^\s*radar-beta/.test(t),"detector"),iDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wyt);return{id:zj,diagram:t}},"loader"),aDe={id:zj,detector:nDe,loader:iDe},Gj="block",sDe=b(t=>/^\s*block(-beta)?/.test(t),"detector"),oDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>g2t);return{id:Gj,diagram:t}},"loader"),lDe={id:Gj,detector:sDe,loader:oDe},cDe=lDe,Wj="treeView",uDe=b(t=>/^\s*treeView-beta/.test(t),"detector"),hDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>F2t);return{id:Wj,diagram:t}},"loader"),dDe={id:Wj,detector:uDe,loader:hDe},fDe=dDe,qj="architecture",pDe=b(t=>/^\s*architecture/.test(t),"detector"),gDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>fbt);return{id:qj,diagram:t}},"loader"),mDe={id:qj,detector:pDe,loader:gDe},yDe=mDe,Vj="eventmodeling",vDe=b(t=>/^\s*eventmodeling/.test(t),"detector"),bDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rbt);return{id:Vj,diagram:t}},"loader"),xDe={id:Vj,detector:vDe,loader:bDe},TDe=xDe,Uj="ishikawa",wDe=b(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),CDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hbt);return{id:Uj,diagram:t}},"loader"),SDe={id:Uj,detector:wDe,loader:CDe},Hj="venn",kDe=b(t=>/^\s*venn-beta/.test(t),"detector"),EDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ixt);return{id:Hj,diagram:t}},"loader"),ADe={id:Hj,detector:kDe,loader:EDe},_De=ADe,Yj="treemap",RDe=b(t=>/^\s*treemap/.test(t),"detector"),LDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wxt);return{id:Yj,diagram:t}},"loader"),IDe={id:Yj,detector:RDe,loader:LDe},Xj="wardley",MDe=b(t=>/^\s*wardley-beta/i.test(t),"detector"),DDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>eTt);return{id:Xj,diagram:t}},"loader"),NDe={id:Xj,detector:MDe,loader:DDe},ODe=NDe,jj="cynefin",$De=b(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),PDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>yTt);return{id:jj,diagram:t}},"loader"),BDe={id:jj,detector:$De,loader:PDe},Kj="railroad",FDe=b(t=>/^\s*railroad-beta/i.test(t),"detector"),zDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>WTt);return{id:Kj,diagram:t}},"loader"),GDe={id:Kj,detector:FDe,loader:zDe},Zj="railroadEbnf",WDe=b(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),qDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ZTt);return{id:Zj,diagram:t}},"loader"),VDe={id:Zj,detector:WDe,loader:qDe},Qj="railroadAbnf",UDe=b(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),HDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>owt);return{id:Qj,diagram:t}},"loader"),YDe={id:Qj,detector:UDe,loader:HDe},Jj="railroadPeg",XDe=b(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),jDe=b(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ywt);return{id:Jj,diagram:t}},"loader"),KDe={id:Jj,detector:XDe,loader:jDe},eK=!1,yS=b(()=>{eK||(eK=!0,PC("error",DMe,t=>t.toLowerCase().trim()==="error"),PC("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:b(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),a_(PMe,UMe,yDe),a_(yIe,jMe,yMe,fMe,DIe,GIe,VIe,YIe,aMe,cMe,RIe,kIe,TIe,GMe,PIe,kMe,TMe,RMe,ZIe,JMe,rDe,tMe,cDe,TDe,fDe,aDe,SDe,IDe,GDe,VDe,YDe,KDe,_De,ODe,BDe))},"addDiagrams"),ZDe=b(async()=>{he.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Rd).map(async([r,{detector:n,loader:i}])=>{if(i)try{y_(r)}catch{try{const{diagram:a,id:s}=await i();PC(s,a,n)}catch(a){throw he.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Rd[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){he.error(`Failed to load ${e.length} external diagrams`);for(const r of e)he.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),QDe="graphics-document document";function tK(t,e){t.attr("role",QDe),e!==""&&t.attr("aria-roledescription",e)}b(tK,"setA11yDiagramInfo");function rK(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}b(rK,"addSVGa11yTitleDescription");var B7=(Zp=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=sr(),i=i_(e,n);e=x7e(e)+` +`;try{y_(i)}catch{const d=qSe(i);if(!d)throw new NG(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();PC(f,p)}const{db:a,parser:s,renderer:o,init:l}=y_(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new Zp(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},b(Zp,"Diagram"),Zp),nK=[],JDe=b(()=>{nK.forEach(t=>{t()}),nK=[]},"attachFunctions"),eNe=b(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function iK(t){const e=t.match(DG);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` +`).map(s=>s.startsWith(r)?s.slice(r.length):s).join(` +`):e[2];let i=N4(n,{schema:D4})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}b(iK,"extractFrontMatter");var tNe=b(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),rNe=b(t=>{const{text:e,metadata:r}=iK(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),nNe=b(t=>{const e=Er.detectInit(t)??{},r=Er.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:u7e(t),directive:e}},"processDirectives");function F7(t){const e=tNe(t),r=rNe(e),n=nNe(r.text),i=ri(r.config,n.directive);return t=eNe(n.text),{code:t,title:r.title,config:i}}b(F7,"preprocessDiagram");function aK(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}b(aK,"toBase64");var iNe=5e4,aNe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",sNe="sandbox",oNe="loose",lNe="http://www.w3.org/2000/svg",cNe="http://www.w3.org/1999/xlink",uNe="http://www.w3.org/1999/xhtml",hNe="100%",dNe="100%",fNe="border:0;margin:0;",pNe="margin:0",gNe="allow-top-navigation-by-user-activation allow-popups",mNe='The "iframe" tag is not supported by your browser.',yNe=["foreignobject"],vNe=["dominant-baseline"];function z7(t){const e=F7(t);return MC(),zSe(e.config??{}),e}b(z7,"processAndSetConfigs");async function sK(t,e){yS();try{const{code:r,config:n}=z7(t);return{diagramType:(await uK(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}b(sK,"parse");var oK=b((t,e,r=[])=>{const n=kG(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),bNe=b((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=An(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{rH(l.styles)||o.forEach(u=>{r.insertRule(oK(l.id,u,l.styles),r.cssRules.length)}),rH(l.textStyles)||r.insertRule(oK(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=l_(i)+` `}else n+=`${t.themeCSS} -`;return n+$6(r)},"createCssStyles"),PRe=T((t,e)=>u7(HAe(`${t}{${e}}`),KAe([T(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===a7)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[DAe,NAe,mH,$Ae,"@container","@starting-style"],a7].includes(n.type)||(ae.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=i7))},"addNamespace"),XAe])),"compileCSS"),BRe=T((t,e,r,n)=>{const i=$Re(t,r),a=zxe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return PRe(n,a)},"createUserStyles"),FRe=T((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=wc(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),zRe=T((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":RRe,n=sY(`${t}`);return``},"putIntoIFrame"),cY=T((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",ERe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function p7(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}T(p7,"sandboxedIframe");var GRe=T((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),qRe=T(async function(t,e,r){var z,F,A,R,N,M;mC();const n=f7(e);e=n.code;const i=lr();ae.debug(i),e.length>((i==null?void 0:i.maxTextSize)??TRe)&&(e=wRe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=T(()=>{const $=pt(f?o:u).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=pt(document.body);const f=i.securityLevel===CRe,p=i.securityLevel===kRe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const I=p7(pt(r),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);cY(d,t,l,`font-family: ${g}`,SRe)}else{if(GRe(document,t,l,s),f){const I=p7(pt(document.body),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");cY(d,t,l)}let m,y;try{m=await h7.fromText(e,{title:n.title})}catch(I){if(i.suppressErrorRendering)throw h(),I;m=await h7.fromText("error"),y=I}const v=d.select(u).node(),x=m.type,b=v.firstChild,w=b.firstChild,k=(F=(z=m.renderer).getClasses)==null?void 0:F.call(z,e,m),S=BRe(i,x,k,a),C=document.createElement("style");C.innerHTML=S,b.insertBefore(C,w);try{await m.renderer.draw(e,t,"11.15.0",m)}catch(I){throw i.suppressErrorRendering?h():c7e.draw(e,t,"11.15.0"),I}const _=d.select(`${u} svg`),L=(R=(A=m.db).getAccTitle)==null?void 0:R.call(A),O=(M=(N=m.db).getAccDescription)==null?void 0:M.call(N);dY(x,_,L,O),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",ARe);let D=d.select(u).node().innerHTML;if(ae.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),D=FRe(D,f,dc(i.arrowMarkerAbsolute)),f){const I=d.select(u+" svg").node();D=zRe(D,I)}else p||(D=Eu.sanitize(D,{ADD_TAGS:NRe,ADD_ATTR:ORe,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(mRe(),y)throw y;return h(),{diagramType:x,svg:D,bindFunctions:m.db.bindFunctions}},"render");function uY(t={}){var n;const e=li({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),xxe(e),e!=null&&e.theme&&e.theme in hc?e.themeVariables=hc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=hc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?bxe(e):$B();T6(r.logLevel),mC()}T(uY,"initialize");var hY=T((t,e={})=>{const{code:r}=d7(t);return h7.fromText(r,e)},"getDiagramFromText");function dY(t,e,r,n){rY(e,t),nY(e,r,n,e.attr("id"))}T(dY,"addA11yInfo");var gd=Object.freeze({render:qRe,parse:oY,getDiagramFromText:hY,initialize:uY,getConfig:lr,setConfig:PB,getSiteConfig:$B,updateSiteConfig:Txe,reset:T(()=>{Dw()},"reset"),globalReset:T(()=>{Dw(Ep)},"globalReset"),defaultConfig:Ep});T6(lr().logLevel),Dw(lr());var VRe=T((t,e,r)=>{ae.warn(t),x_(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),fY=T(async function(t={querySelector:".mermaid"}){try{await WRe(t)}catch(e){if(x_(e)&&ae.error(e.str),Bs.parseError&&Bs.parseError(e),!t.suppressErrors)throw ae.error("Use the suppressErrors option to suppress these errors"),e}},"run"),WRe=T(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=gd.getConfig();ae.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ae.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ae.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),gd.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Lr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ae.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=UV(Lr.entityDecode(s)).trim().replace(//gi,"
    ");const h=Lr.detectInit(s);h&&ae.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await yY(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){VRe(d,o,Bs.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),pY=T(function(t){gd.initialize(t)},"initialize"),URe=T(async function(t,e,r){ae.warn("mermaid.init is deprecated. Please use run instead."),t&&pY(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await fY(n)},"init"),HRe=T(async(t,{lazyLoad:e=!0}={})=>{mC(),D6(...t),e===!1&&await pRe()},"registerExternalDiagrams"),gY=T(function(){if(Bs.startOnLoad){const{startOnLoad:t}=gd.getConfig();t&&Bs.run().catch(e=>ae.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",gY,!1);var YRe=T(function(t){Bs.parseError=t},"setParseErrorHandler"),yC=[],g7=!1,mY=T(async()=>{if(!g7){for(g7=!0;yC.length>0;){const t=yC.shift();if(t)try{await t()}catch(e){ae.error("Error executing queue",e)}}g7=!1}},"executeQueue"),XRe=T(async(t,e)=>new Promise((r,n)=>{const i=T(()=>new Promise((a,s)=>{gd.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;ae.error("Error parsing",o),(l=Bs.parseError)==null||l.call(Bs,o),s(o),n(o)})}),"performCall");yC.push(i),mY().catch(n)}),"parse"),yY=T((t,e,r)=>new Promise((n,i)=>{const a=T(()=>new Promise((s,o)=>{gd.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;ae.error("Error parsing",l),(u=Bs.parseError)==null||u.call(Bs,l),o(l),i(l)})}),"performCall");yC.push(a),mY().catch(i)}),"render"),KRe=T(()=>Object.keys(Wh).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Bs={startOnLoad:!0,mermaidAPI:gd,parse:XRe,render:yY,init:URe,run:fY,registerExternalDiagrams:HRe,registerLayoutLoaders:fH,initialize:pY,parseError:void 0,contentLoaded:gY,setParseErrorHandler:YRe,detectType:I6,registerIconPacks:XV,getRegisteredDiagramsMetadata:KRe},jRe=Bs;/*! Check if previously processed *//*! +`;return n+l_(r)},"createCssStyles"),xNe=b((t,e)=>P7(uIe(`${t}{${e}}`),fIe([b(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===M7)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[K8e,Q8e,cj,eIe,"@container","@starting-style"],M7].includes(n.type)||(he.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=I7))},"addNamespace"),dIe])),"compileCSS"),TNe=b((t,e,r,n)=>{const i=bNe(t,r),a=ake(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return xNe(n,a)},"createUserStyles"),wNe=b((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Qc(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),CNe=b((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":dNe,n=aK(`${t}`);return``},"putIntoIFrame"),lK=b((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",lNe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function G7(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}b(G7,"sandboxedIframe");var SNe=b((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),kNe=b(async function(t,e,r){var P,$,_,R,O,D;yS();const n=z7(e);e=n.code;const i=sr();he.debug(i),e.length>((i==null?void 0:i.maxTextSize)??iNe)&&(e=aNe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=b(()=>{const B=mt(f?o:u).node();B&&"remove"in B&&B.remove()},"removeTempElements");let d=mt(document.body);const f=i.securityLevel===sNe,p=i.securityLevel===oNe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=G7(mt(r),s);d=mt(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=mt(r);lK(d,t,l,`font-family: ${g}`,cNe)}else{if(SNe(document,t,l,s),f){const N=G7(mt(document.body),s);d=mt(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=mt("body");lK(d,t,l)}let m,y;try{m=await B7.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await B7.fromText("error"),y=N}const v=d.select(u).node(),T=m.type,x=v.firstChild,w=x.firstChild,C=($=(P=m.renderer).getClasses)==null?void 0:$.call(P,e,m),k=TNe(i,T,C,a),S=document.createElement("style");S.innerHTML=k,x.insertBefore(S,w);try{await m.renderer.draw(e,t,"11.16.0",m)}catch(N){throw i.suppressErrorRendering?h():IMe.draw(e,t,"11.16.0"),N}const E=d.select(`${u} svg`),L=(R=(_=m.db).getAccTitle)==null?void 0:R.call(_),M=(D=(O=m.db).getAccDescription)==null?void 0:D.call(O);hK(T,E,L,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",uNe);let I=d.select(u).node().innerHTML;if(he.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),I=wNe(I,f,Fl(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();I=CNe(I,N)}else p||(I=zc.sanitize(I,{ADD_TAGS:yNe,ADD_ATTR:vNe,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(JDe(),y)throw y;return h(),{diagramType:T,svg:I,bindFunctions:m.db.bindFunctions}},"render");function cK(t={}){var n;const e=Ri({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),BSe(e),e!=null&&e.theme&&e.theme in Wc?e.themeVariables=Wc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Wc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?PSe(e):EG();Y6(r.logLevel),yS()}b(cK,"initialize");var uK=b((t,e={})=>{const{code:r}=F7(t);return B7.fromText(r,e)},"getDiagramFromText");function hK(t,e,r,n){tK(e,t),rK(e,r,n,e.attr("id"))}b(hK,"addA11yInfo");var ef=Object.freeze({render:kNe,parse:sK,getDiagramFromText:uK,initialize:cK,getConfig:sr,setConfig:AG,getSiteConfig:EG,updateSiteConfig:FSe,reset:b(()=>{MC()},"reset"),globalReset:b(()=>{MC(u0)},"globalReset"),defaultConfig:u0});Y6(sr().logLevel),MC(sr());var ENe=b((t,e,r)=>{he.warn(t),YR(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),dK=b(async function(t={querySelector:".mermaid"}){try{await ANe(t)}catch(e){if(YR(e)&&he.error(e.str),lo.parseError&&lo.parseError(e),!t.suppressErrors)throw he.error("Use the suppressErrors option to suppress these errors"),e}},"run"),ANe=b(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=ef.getConfig();he.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");he.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(he.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),ef.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Er.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(he.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=zH(Er.entityDecode(s)).trim().replace(//gi,"
    ");const h=Er.detectInit(s);h&&he.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await mK(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){ENe(d,o,lo.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),fK=b(function(t){ef.initialize(t)},"initialize"),_Ne=b(async function(t,e,r){he.warn("mermaid.init is deprecated. Please use run instead."),t&&fK(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await dK(n)},"init"),RNe=b(async(t,{lazyLoad:e=!0}={})=>{yS(),a_(...t),e===!1&&await ZDe()},"registerExternalDiagrams"),pK=b(function(){if(lo.startOnLoad){const{startOnLoad:t}=ef.getConfig();t&&lo.run().catch(e=>he.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",pK,!1);var LNe=b(function(t){lo.parseError=t},"setParseErrorHandler"),vS=[],W7=!1,gK=b(async()=>{if(!W7){for(W7=!0;vS.length>0;){const t=vS.shift();if(t)try{await t()}catch(e){he.error("Error executing queue",e)}}W7=!1}},"executeQueue"),INe=b(async(t,e)=>new Promise((r,n)=>{const i=b(()=>new Promise((a,s)=>{ef.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;he.error("Error parsing",o),(l=lo.parseError)==null||l.call(lo,o),s(o),n(o)})}),"performCall");vS.push(i),gK().catch(n)}),"parse"),mK=b((t,e,r)=>new Promise((n,i)=>{const a=b(()=>new Promise((s,o)=>{ef.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;he.error("Error parsing",l),(u=lo.parseError)==null||u.call(lo,l),o(l),i(l)})}),"performCall");vS.push(a),gK().catch(i)}),"render"),MNe=b(()=>Object.keys(Rd).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),lo={startOnLoad:!0,mermaidAPI:ef,parse:INe,render:mK,init:_Ne,run:dK,registerExternalDiagrams:RNe,registerLayoutLoaders:sj,initialize:fK,parseError:void 0,contentLoaded:pK,setParseErrorHandler:LNe,detectType:i_,registerIconPacks:ZR,getRegisteredDiagramsMetadata:MNe},DNe=lo;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */window.mermaid=jRe,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})();function db(t,e,r){const n=document.createElement("button");return n.type="button",n.textContent=t,n.dataset.okMermaidAction=r,n.setAttribute("aria-label",e),n.setAttribute("title",e),n}function ZRe(){const t=document.createElement("dialog");t.className="ok-mermaid-viewport";const e=document.createElement("div");e.className="ok-mermaid-viewport-toolbar",e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Diagram zoom controls");const r=db("−","Zoom out","zoom-out"),n=db("+","Zoom in","zoom-in"),i=db("100%","Show diagram at 100%","actual"),a=db("Fit","Fit diagram to viewport","fit"),s=db("Close","Close diagram viewer","close"),o=document.createElement("output");o.className="ok-mermaid-viewport-zoom",o.dataset.okMermaidZoom="",o.setAttribute("aria-label","Diagram zoom"),o.setAttribute("aria-live","polite"),e.append(r,n,i,a,o,s);const l=document.createElement("div");l.className="ok-mermaid-viewport-canvas",l.dataset.okMermaidCanvas="",l.tabIndex=0,l.setAttribute("aria-label","Diagram canvas. Drag to pan.");const u=document.createElement("div");return u.className="ok-mermaid-viewport-stage",l.append(u),t.append(e,l),document.body.append(t),{actual:i,canvas:l,closeButton:s,dialog:t,fitButton:a,stage:u,zoom:o,zoomIn:n,zoomOut:r}}const QRe=.01,JRe=8;let vC;function e8e(t,e){if("okMermaidViewportBound"in t.dataset)return;t.dataset.okMermaidViewportBound="",t.tabIndex=0,t.setAttribute("role","button"),t.setAttribute("aria-label",e),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-keyshortcuts","Enter Space"),t.setAttribute("title","Open diagram viewer");const r=()=>(vC||(vC=r8e())).open(t,e);t.addEventListener("click",n=>{var i,a;(a=(i=n.target)==null?void 0:i.closest)!=null&&a.call(i,"a")||r()}),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" "||n.code==="Space")&&(n.preventDefault(),r())})}function t8e(){vC==null||vC.close()}function r8e(){const{actual:t,canvas:e,closeButton:r,dialog:n,fitButton:i,stage:a,zoom:s,zoomIn:o,zoomOut:l}=ZRe(),u={fit:!0,height:1,original:null,pinch:null,pointers:new Map,scale:1,trigger:null,width:1,x:0,y:0};function h(){a.style.width=u.width+"px",a.style.height=u.height+"px",a.style.transform="translate3d("+m7(u.x)+"px, "+m7(u.y)+"px, 0) scale("+m7(u.scale)+")",s.textContent=Math.round(u.scale*100)+"%"}function d(){const x=e.getBoundingClientRect(),b=Math.max(1,x.width-48),w=Math.max(1,x.height-48);u.scale=vY(Math.min(b/u.width,w/u.height)),u.x=(x.width-u.width*u.scale)/2,u.y=(x.height-u.height*u.scale)/2,u.fit=!0,h()}function f(){const x=e.getBoundingClientRect();u.scale=1,u.x=(x.width-u.width)/2,u.y=(x.height-u.height)/2,u.fit=!1,h()}function p(x,b,w){const k=vY(u.scale*x),S=e.getBoundingClientRect(),C=b===void 0?S.width/2:b-S.left,_=w===void 0?S.height/2:w-S.top,L=k/u.scale;u.x=C-(C-u.x)*L,u.y=_-(_-u.y)*L,u.scale=k,u.fit=!1,h()}function g(){if(!u.original)return;u.original.parent.insertBefore(u.original.svg,u.original.next),u.original=null,u.pinch=null,u.pointers.clear(),delete e.dataset.okMermaidPanning;const x=u.trigger;u.trigger=null,x&&x.isConnected!==!1&&x.focus()}function m(){n.open&&n.close()}function y(x,b){const w=x.querySelector("svg");if(!w)return;m();const k=n8e(w);u.width=k.width,u.height=k.height,u.trigger=x,u.original={svg:w,parent:w.parentNode,next:w.nextSibling},n.setAttribute("aria-label",b),a.append(w),n.showModal(),d(),e.focus()}l.addEventListener("click",()=>p(.8)),o.addEventListener("click",()=>p(1.25)),t.addEventListener("click",f),i.addEventListener("click",d),r.addEventListener("click",m),n.addEventListener("close",g),n.addEventListener("cancel",x=>{x.preventDefault(),m()}),n.addEventListener("keydown",x=>{const b=x.key.toLowerCase();if(b==="+"||b==="=")p(1.25);else if(b==="-")p(.8);else if(b==="0")f();else if(b==="f")d();else if(b==="escape")m();else if(b.startsWith("arrow"))u.x+=b==="arrowleft"?-40:b==="arrowright"?40:0,u.y+=b==="arrowup"?-40:b==="arrowdown"?40:0,u.fit=!1,h();else return;x.preventDefault()}),e.addEventListener("wheel",x=>{x.preventDefault(),p(x.deltaY<0?1.1:1/1.1,x.clientX,x.clientY)},{passive:!1}),e.addEventListener("pointerdown",x=>{x.button===0&&(u.pointers.set(x.pointerId,{x:x.clientX,y:x.clientY}),u.pinch=y7(u.pointers),u.fit=!1,e.dataset.okMermaidPanning="",e.setPointerCapture(x.pointerId))}),e.addEventListener("pointermove",x=>{const b=u.pointers.get(x.pointerId);if(b){if(u.pointers.set(x.pointerId,{x:x.clientX,y:x.clientY}),u.pointers.size>1){const w=y7(u.pointers);u.pinch&&w&&u.pinch.distance>0&&(p(w.distance/u.pinch.distance,u.pinch.x,u.pinch.y),u.x+=w.x-u.pinch.x,u.y+=w.y-u.pinch.y),u.pinch=w}else u.x+=x.clientX-b.x,u.y+=x.clientY-b.y;h()}});function v(x){u.pointers.has(x.pointerId)&&(u.pointers.delete(x.pointerId),u.pinch=y7(u.pointers),u.pointers.size||delete e.dataset.okMermaidPanning,(!e.hasPointerCapture||e.hasPointerCapture(x.pointerId))&&e.releasePointerCapture(x.pointerId))}return e.addEventListener("pointerup",v),e.addEventListener("pointercancel",v),window.addEventListener("resize",()=>{n.open&&u.fit&&d()}),{close:m,dialog:n,open:y}}function n8e(t){var n,i,a,s,o;const e=(n=t.viewBox)==null?void 0:n.baseVal,r=t.getBoundingClientRect();return{width:i0(e==null?void 0:e.width)||i0((a=(i=t.width)==null?void 0:i.baseVal)==null?void 0:a.value)||i0(r.width)||1,height:i0(e==null?void 0:e.height)||i0((o=(s=t.height)==null?void 0:s.baseVal)==null?void 0:o.value)||i0(r.height)||1}}function i0(t){const e=Number(t);return Number.isFinite(e)&&e>0?e:0}function vY(t){return Math.min(JRe,Math.max(QRe,t))}function m7(t){return Math.round(t*1e3)/1e3}function y7(t){if(t.size<2)return null;const[e,r]=Array.from(t.values());return{distance:Math.hypot(r.x-e.x,r.y-e.y),x:(e.x+r.x)/2,y:(e.y+r.y)/2}}(function(){var sbe;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-sidebar-resize-handle]"),o=document.querySelector("[data-viewer-settings]"),l=document.querySelector("[data-viewer-settings-trigger]"),u=document.querySelector("[data-viewer-settings-menu]"),h=document.querySelector("[data-navigation-mode-toggle]"),d=document.querySelector("[data-theme-custom-fields]"),f=document.querySelector("[data-frontmatter-visibility]"),p=document.querySelector("[data-accessibility-font]"),g=document.querySelector("[data-accessibility-size]"),m=document.querySelector("[data-accessibility-spacing]"),y=document.querySelector("[data-accessibility-motion]"),v=document.querySelector("[data-readable-line-length]"),x=document.querySelector("[data-high-contrast]"),b=document.querySelector("[data-underline-links]"),w=document.querySelector("[data-workspace-rail]"),k=document.querySelector("[data-workspace-scroll-track]"),S=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const C=window.matchMedia("(prefers-reduced-motion: reduce)"),_=window.matchMedia("(max-width: 680px)"),L="openknowledge.viewer.editorOrder",O="openknowledge.viewer.theme",D="openknowledge.viewer.frontmatter",z="openknowledge.viewer.accessibility",F="openknowledge.viewer.navigationMode",A="beside";let R=A;const N=Ne(t.dataset.linkPrefix||""),M=QP(t.dataset.noteRoot||N||window.location.pathname).toString(36),I="openknowledge.viewer.panelWidths."+M,$="openknowledge.viewer.sidebarWidth."+M,P=D1t(),B=Ve();let q=nt();const V=In(),X=w1t(V,"path"),W=C1t(V),ie=dp(),K=Qe(),se=["default","night","paper","ocean","rose","custom"],te="night",Z={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},ee={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},ne={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},oe={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},fe={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},Ae={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let Re=Promise.resolve(),Ge=0,Ce=0,be=0;const Fe={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!A2e()},run:function(){const G=A2e();G&&m6(G)}};function ye(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function He(G,H){return G?G.closest?G.closest(H):G.parentElement?G.parentElement.closest(H):null:null}function xe(G,H,J){return Math.min(Math.max(G,H),J)}function Ve(){const G=Ze(I);return G&&typeof G=="object"&&!Array.isArray(G)?G:{}}function Je(){const G=JSON.stringify(B);try{window.localStorage.setItem(I,G)}catch{}Y(I,G)}function nt(){const G=Ze($),H=G&&typeof G=="object"?G.width:G;return Jt(H)}function tt(){if(!q)return;const G=JSON.stringify(q);try{window.localStorage.setItem($,G)}catch{}Y($,G)}function Ze(G){const H=[Ee(G),Se(G)];for(const J of H)if(J)try{return JSON.parse(J)}catch{}return null}function Ee(G){try{return window.localStorage.getItem(G)}catch{return null}}function Se(G){const H=encodeURIComponent(G)+"=",J=document.cookie?document.cookie.split("; "):[];for(const de of J)if(de.startsWith(H))try{return decodeURIComponent(de.slice(H.length))}catch{return null}return null}function Y(G,H){try{document.cookie=encodeURIComponent(G)+"="+encodeURIComponent(H)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function ce(G){return G==="beside"||G==="replace"?G:A}function j(){return ce(Ze(F))}function pe(G){const H=JSON.stringify(ce(G));try{window.localStorage.setItem(F,H)}catch{}Y(F,H)}function re(){return R==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function Pe(G){R=ce(G),document.documentElement.dataset.viewerNavigationMode=R,h&&(h.dataset.mode=R,h.setAttribute("aria-pressed",R==="beside"?"true":"false"),h.setAttribute("aria-label","Link behavior: "+(R==="beside"?"Open beside":"Open in current panel")),h.title=re()),F2e()}function ve(G){const H=R==="beside";return G?!H:H}function Ue(){Pe(j()),!(!h||h.dataset.modeBound==="true")&&(h.dataset.modeBound="true",h.addEventListener("click",function(){const G=R==="beside"?"replace":"beside";pe(G),Pe(G)}))}function Me(){const G=Ze(O);return G&&typeof G=="object"&&!Array.isArray(G)?qe(G):qe({preset:te,custom:fe})}function qe(G){const H=se.includes(G.preset)?G.preset:te,J=Object.assign({},fe);return Object.keys(fe).forEach(function(de){Dt(G.custom&&G.custom[de])&&(J[de]=G.custom[de].toLowerCase())}),{preset:H,custom:J}}function Le(G){const H=qe(G),J=JSON.stringify(H);try{window.localStorage.setItem(O,J)}catch{}Y(O,J)}function Ke(){const G=Ze(D);return G&&typeof G=="object"&&!Array.isArray(G)&&typeof G.visible=="boolean"?G.visible:!0}function De(G){const H=JSON.stringify({visible:!!G});try{window.localStorage.setItem(D,H)}catch{}Y(D,H)}function it(){const G=Ze(z);return G&&typeof G=="object"&&!Array.isArray(G)?Te(G):Te(oe)}function Te(G){const H=G&&typeof G=="object"?G:{};return{font:Object.prototype.hasOwnProperty.call(Z,H.font)?H.font:oe.font,size:Object.prototype.hasOwnProperty.call(ee,H.size)?H.size:oe.size,spacing:Object.prototype.hasOwnProperty.call(ne,H.spacing)?H.spacing:oe.spacing,motion:["system","reduced","full"].includes(H.motion)?H.motion:oe.motion,readableLineLength:typeof H.readableLineLength=="boolean"?H.readableLineLength:oe.readableLineLength,highContrast:typeof H.highContrast=="boolean"?H.highContrast:oe.highContrast,underlineLinks:typeof H.underlineLinks=="boolean"?H.underlineLinks:oe.underlineLinks}}function ct(G){const H=Te(G),J=JSON.stringify(H);try{window.localStorage.setItem(z,J)}catch{}Y(z,J)}function we(G){const H=Te(G),J=ee[H.size],de=ne[H.spacing];document.documentElement.dataset.viewerFont=H.font,document.documentElement.dataset.viewerFontSize=H.size,document.documentElement.dataset.viewerMotion=H.motion,document.documentElement.dataset.viewerContrast=H.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=H.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",Z[H.font]),document.documentElement.style.setProperty("--ok-document-font-size",J.value),document.documentElement.style.setProperty("--ok-document-scale",J.scale),document.documentElement.style.setProperty("--ok-document-line-height",de.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",de.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",H.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",H.highContrast),document.body.classList.toggle("is-links-underlined",H.underlineLinks),Et(H)}function Et(G){p&&(p.value=G.font),g&&(g.value=G.size),m&&(m.value=G.spacing),y&&(y.value=G.motion),v&&(v.checked=G.readableLineLength),x&&(x.checked=G.highContrast),b&&(b.checked=G.underlineLinks)}function yt(){const G=document.documentElement.dataset.viewerMotion||"system";return G==="reduced"||G==="system"&&C.matches}function ot(G){document.body.classList.toggle("is-frontmatter-hidden",!G),f&&(f.checked=G)}function Dt(G){return/^#[0-9a-f]{6}$/i.test(String(G||""))}function vt(G){const H=Dt(G)?G.slice(1):fe.accent.slice(1);return[parseInt(H.slice(0,2),16),parseInt(H.slice(2,4),16),parseInt(H.slice(4,6),16)]}function ut(G,H,J){const de=vt(G),Ie=vt(H);return"#"+de.map(function(We,ft){return Math.round(We+(Ie[ft]-We)*J)}).map(function(We){return We.toString(16).padStart(2,"0")}).join("")}function le(G){return At(G)>.48?"#121715":"#f3f7f4"}function At(G){const H=vt(G);return(.2126*H[0]+.7152*H[1]+.0722*H[2])/255}function dt(G){const H=qe(G);document.documentElement.dataset.viewerTheme=H.preset;const J=H.preset==="custom"&&At(H.custom.surface)<=.48;document.documentElement.style.colorScheme=H.preset==="night"||J?"dark":"light",ht(),H.preset==="custom"&&St(H.custom),Nr(H),W1t()}function ht(){Object.keys(Ae).forEach(function(G){Ae[G].forEach(function(H){document.documentElement.style.removeProperty(H)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(G){document.documentElement.style.removeProperty(G)})}function St(G){Object.keys(Ae).forEach(function(J){Ae[J].forEach(function(de){document.documentElement.style.setProperty(de,G[J])})});const H=vt(G.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",H),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+H+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+H+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+H+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+H+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+H+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+H+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+H+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+vt(G.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",ut(G.surface,G.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",le(G.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",ut(G.page,G.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",ut(G.page,G.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",ut(G.page,G.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",ut(G.surface,G.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",ut(G.surface,G.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+H+", .78)")}function Nr(G){document.querySelectorAll("[data-theme-option]").forEach(function(H){const J=H.dataset.themeOption===G.preset;H.classList.toggle("is-selected",J),H.setAttribute("aria-checked",J?"true":"false")}),d&&(d.hidden=G.preset!=="custom",d.querySelectorAll("[data-theme-custom-value]").forEach(function(H){const J=H.dataset.themeCustomValue;G.custom[J]&&(H.value=G.custom[J])}))}function me(){return Math.min(360,Math.max(260,window.innerWidth-24))}function et(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function lt(G){const H=ye();return!!(G&&H.length===1&&H[0]===G)}function Rt(G){return lt(G)?Math.max(me(),window.innerWidth-et()*2):Math.max(Ft(),1180)}function Ft(){return Math.max(me(),or("var(--ok-note-panel-default-width)",650))}function or(G,H){const J=document.createElement("div");J.style.position="absolute",J.style.left="-10000px",J.style.top="-10000px",J.style.visibility="hidden",J.style.pointerEvents="none",J.style.width=G,document.body.append(J);const de=J.getBoundingClientRect().width;return J.remove(),Number.isFinite(de)&&de>0?de:H}function ir(G,H){const J=Number(G);return Number.isFinite(J)?Math.round(xe(J,me(),Rt(H))):null}function xr(){return or("var(--ok-sidebar-min-width)",280)}function sr(){const G=or("var(--ok-sidebar-max-width)",560);return Math.max(xr(),Math.min(G,window.innerWidth-320))}function Rr(){return or("var(--ok-sidebar-width)",window.innerWidth*.25)}function Jt(G){const H=Number(G);return!Number.isFinite(H)||H<=0?null:Math.round(xe(H,xr(),sr()))}function Ir(G){return Jt(G)||Jt(Rr())||xr()}function ln(G){const H=Ir(G);return document.body.style.setProperty("--ok-sidebar-user-width",H+"px"),s&&(s.setAttribute("aria-valuemin",String(Math.round(xr()))),s.setAttribute("aria-valuemax",String(Math.round(sr()))),s.setAttribute("aria-valuenow",String(H))),bw(),H}function Or(G){return q=Ir(G),ln(q)}function Ca(G){return ir(B[G.dataset.notePath],G)}function Pa(G){const H=Ca(G);if(!H){G.style.removeProperty("--note-panel-width"),delete G.dataset.panelWidth;return}G.style.setProperty("--note-panel-width",H+"px"),G.dataset.panelWidth=String(H)}function Wi(G){var H;document.body.classList.toggle("is-sidebar-open",G),n&&(n.setAttribute("aria-hidden",G?"false":"true"),n.inert=!G),i&&i.setAttribute("aria-expanded",G?"true":"false"),G&&sc(((H=ko())==null?void 0:H.dataset.notePath)||al()[0]||"",!0)}function _i(){Wi(!document.body.classList.contains("is-sidebar-open"))}function $t(G,H){if(h6())return S1t(G,H);let J;try{J=new URL(G,window.location.href)}catch{return null}const de=ke();if(J.origin!==window.location.origin||!J.pathname.startsWith(de))return null;const Ie=J.pathname.slice(de.length)||"index.md";if(!Bt(Ie))return null;try{return decodeURIComponent(Ie)}catch{return Ie}}function bt(G,H){return G+H.split("/").map(encodeURIComponent).join("/")}function Bt(G){return/\.(md|markdown)$/i.test(String(G).split("?")[0].split("#")[0])}function Tt(G){return h6()?k1t(G):bt(ke(),G)}function pr(G){return bt(Ri(),G)}function ke(){return N+"/file/"}function Ri(){return N+"/api/file/"}function Ne(G){const H=String(G||"").replace(/\/+$/,"");return H?H.startsWith("/")?H:"/"+H:""}function In(){var J;const G=(J=window.OpenKnowledgeStaticData)==null?void 0:J.notes;if(Array.isArray(G))return G;const H=document.querySelector("[data-static-notes]");if(!H)return[];try{const de=JSON.parse(H.textContent||"[]");return Array.isArray(de)?de:[]}catch{return[]}}function dp(){const G=new Set;return V.forEach(function(H){H.path&&G.add(H.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(H){H.dataset.treePath&&G.add(H.dataset.treePath)}),G}function Jv(){document.querySelectorAll(".knowledge-tree").forEach(function(G){if(G.dataset.treePrepared==="true")return;G.dataset.treePrepared="true";const H=[];Array.from(G.querySelectorAll(".tree-row")).forEach(function(J){var ft;const de=e2(J);for(;H.length&&H[H.length-1].indent>=de;)H.pop();if(J.dataset.treeParentPath=((ft=H[H.length-1])==null?void 0:ft.path)||"",!J.classList.contains("tree-directory"))return;const Ie=String(J.textContent||"").trim(),Be=H.concat([{name:Ie}]).map(function(mt){return mt.name}).join("/");J.dataset.treeDirectoryPath=Be,J.setAttribute("aria-expanded","false"),J.tabIndex=0,J.title="Expand "+Be;const We=f6("chevron-down","tree-directory-icon");We.setAttribute("aria-hidden","true"),J.prepend(We),J.addEventListener("click",function(){Tu(J,J.getAttribute("aria-expanded")!=="true")}),J.addEventListener("keydown",function(mt){if(mt.key==="ArrowRight"){mt.preventDefault(),Tu(J,!0);return}if(mt.key==="ArrowLeft"){mt.preventDefault(),Tu(J,!1);return}(mt.key==="Enter"||mt.key===" ")&&(mt.preventDefault(),Tu(J,J.getAttribute("aria-expanded")!=="true"))}),H.push({indent:de,name:Ie,path:Be})}),zn(G)}),oc()}function e2(G){const H=G.style.getPropertyValue("--indent"),J=parseFloat(H);return Number.isFinite(J)?J:0}function Tu(G,H){G.setAttribute("aria-expanded",H?"true":"false"),G.title=(H?"Collapse ":"Expand ")+G.dataset.treeDirectoryPath;const J=G.closest(".knowledge-tree");J&&zn(J)}function zn(G){const H=Object.create(null);G.querySelectorAll("[data-tree-directory-path]").forEach(function(J){H[J.dataset.treeDirectoryPath]=J}),G.querySelectorAll(".tree-row").forEach(function(J){const Ie=(J.dataset.treeParentPath||"").split("/").filter(Boolean);let Be="",We=!1;Ie.forEach(function(ft){Be=Be?Be+"/"+ft:ft;const mt=H[Be];mt&&mt.getAttribute("aria-expanded")!=="true"&&(We=!0)}),J.hidden=We})}function il(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(G){G.setAttribute("aria-expanded","false"),G.title="Expand "+G.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(zn)}function sc(G,H){const J=String(G||""),de=J.split("/").slice(0,-1),Ie=new Set;if(de.forEach(function(Be,We){Ie.add(de.slice(0,We+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Be){Be.querySelectorAll("[data-tree-directory-path]").forEach(function(We){Ie.has(We.dataset.treeDirectoryPath)&&(We.setAttribute("aria-expanded","true"),We.title="Collapse "+We.dataset.treeDirectoryPath)}),Be.querySelectorAll("[data-tree-path]").forEach(function(We){const ft=We.dataset.treePath===J;We.classList.toggle("is-current-file",ft),ft?(We.setAttribute("aria-current","page"),We.title=We.dataset.treePath):(We.removeAttribute("aria-current"),We.title=re())}),zn(Be)}),H&&n){const Be=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(We){return We.dataset.treePath===J});Be&&window.requestAnimationFrame(function(){Be.scrollIntoView({block:"center",behavior:yt()?"auto":"smooth"})})}}function oc(){const G=n==null?void 0:n.querySelector(".file-sidebar-head"),H=G==null?void 0:G.querySelector("[data-sidebar-close]");if(!G||!H||G.querySelector("[data-sidebar-collapse]"))return;const J=document.createElement("div");J.className="file-sidebar-actions";const de=document.createElement("button");de.type="button",de.className="file-sidebar-collapse",de.dataset.sidebarCollapse="",de.textContent="Collapse all",de.addEventListener("click",il),H.before(J),J.append(de,H)}function fp(G){const H=G.join("/");return[H+"/index.md",H+"/index.markdown"].find(function(J){return ie.has(J)})||""}function Ot(G){const H=String(G||"index.md"),J=H.split("/").filter(Boolean),de=J[J.length-1]||"index.md",Ie=/^index\.(md|markdown)$/i.test(de)&&J.length>1,Be=Ie?J.slice(0,-1):J,We=document.createElement("nav");return We.className="note-path note-breadcrumbs",We.dataset.noteBreadcrumbs="",We.dataset.breadcrumbsReady="true",We.dataset.notePathValue=H,We.setAttribute("aria-label","Note path"),We.title=H,Be.forEach(function(ft,mt){if(mt>0){const tr=document.createElement("span");tr.className="note-breadcrumb-separator",tr.setAttribute("aria-hidden","true"),tr.textContent="/",We.append(tr)}const Ct=mt===Be.length-1,Yt=fp(Be.slice(0,mt+1)),Qt=Ct?H:Yt,zt=Ct&&!Ie?ft.replace(/\.(md|markdown)$/i,""):ft;if(Qt){const tr=document.createElement("a");tr.className="note-breadcrumb-link"+(Ct?" note-breadcrumb-current":""),tr.href=Tt(Qt),tr.dataset.directLink="true",tr.textContent=zt,Ct&&tr.setAttribute("aria-current","page"),We.append(tr);return}const Ut=document.createElement("span");Ut.className="note-breadcrumb-label",Ut.textContent=zt,We.append(Ut)}),We}function _e(G){const H=G.querySelector("[data-note-breadcrumbs], .note-path");!H||H.dataset.breadcrumbsReady==="true"||H.replaceWith(Ot(G.dataset.notePath))}function Qe(){var J;const G=(J=window.OpenKnowledgeStaticData)==null?void 0:J.graph;if(G)return{nodes:Array.isArray(G.nodes)?G.nodes:[],edges:Array.isArray(G.edges)?G.edges:[]};const H=document.querySelector("[data-knowledge-graph]");if(!H)return{nodes:[],edges:[]};try{const de=JSON.parse(H.textContent||"{}");return{nodes:Array.isArray(de.nodes)?de.nodes:[],edges:Array.isArray(de.edges)?de.edges:[]}}catch{return{nodes:[],edges:[]}}}function xt(){const G=document.querySelector("[data-knowledge-graph-view]"),H=document.querySelector("[data-knowledge-graph-sidebar]");if(!G)return;G.replaceChildren(),H==null||H.replaceChildren();const J=document.createElement("div");J.className="knowledge-graph-info";const de=document.createElement("h2");de.textContent="Knowledge graph";const Ie=document.createElement("p");Ie.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Be=document.createElement("p");if(Be.className="knowledge-graph-status",Be.dataset.knowledgeGraphStatus="",Be.setAttribute("aria-live","polite"),Be.textContent=K.nodes.length?K.nodes.length+(K.nodes.length===1?" note":" notes"):"No notes",J.append(de,Ie,Be),(H||G).append(J),!K.nodes.length){const Yt=document.createElement("p");Yt.className="empty",Yt.textContent="No Markdown files found.",G.append(Yt);return}const We=900,ft=640,mt=b1t(K.nodes),Lt=p1t(K,We,ft,mt),Ct=document.createElement("canvas");Ct.className="knowledge-graph-canvas",Ct.dataset.knowledgeGraphCanvas="true",Ct.width=We,Ct.height=ft,Ct.tabIndex=0,Ct.setAttribute("role","img"),Ct.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),G.append(Ct),Vt(Ct,K,Lt,mt,We,ft,Be).start()}function Vt(G,H,J,de,Ie,Be,We){const ft=G.getContext("2d"),mt=Object.create(null);H.nodes.forEach(function(rr){rr&&typeof rr.path=="string"&&(mt[rr.path]=!0)});const Lt=H.edges.filter(function(rr){return rr&&mt[rr.source]&&mt[rr.target]&&J[rr.source]&&J[rr.target]}),Ct=H.nodes.filter(function(rr){return rr&&typeof rr.path=="string"&&J[rr.path]}).map(function(rr){const pn=J[rr.path],cc=g2e(rr,de);return{node:rr,path:rr.path,label:cc,fullLabel:m2e(rr,de),radius:rr.path==="index.md"?16:10,labelOffset:rr.path==="index.md"?31:25,baseX:pn.x,baseY:pn.y,x:pn.x,y:pn.y,z:0,vx:0,vy:0}}),Yt=Object.create(null);Ct.forEach(function(rr){Yt[rr.path]=rr});let Qt="",zt=Ct.findIndex(function(rr){return rr.path==="index.md"});zt<0&&(zt=0);let Ut=null,tr=0;const _r=function(rr){const pn=rr&&Yt[rr]?rr:"";if(pn!==Qt)if(Qt=pn,G.dataset.activeGraphPath=Qt,G.style.cursor=Qt?"pointer":"default",Qt){const cc=Ct.findIndex(function(x6){return x6.path===Qt});cc>=0&&(zt=cc);const kw=Yt[Qt],obe=Lt.filter(function(x6){return x6.source===Qt||x6.target===Qt}).length,lbe=obe+(obe===1?" connection":" connections");We&&(We.textContent=kw.fullLabel+" · "+lbe+" · Enter to open"),G.setAttribute("aria-label","Selected "+kw.fullLabel+" with "+lbe+". Use arrow keys to move and Enter to open.")}else We&&(We.textContent=H.nodes.length+(H.nodes.length===1?" note":" notes")),G.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},vn=function(){const rr=Math.max(1,Math.min(window.devicePixelRatio||1,2));G.width=Math.round(Ie*rr),G.height=Math.round(Be*rr),ft.setTransform(rr,0,0,rr,0,0)},Tn=function(rr){const pn=G.getBoundingClientRect();return!pn.width||!pn.height?{x:0,y:0}:{x:(rr.clientX-pn.left)*(Ie/pn.width),y:(rr.clientY-pn.top)*(Be/pn.height)}},mi=function(rr){Ut=rr;const pn=aa(Ct,rr);_r(pn?pn.path:"")};G.addEventListener("pointermove",function(rr){mi(Tn(rr))}),G.addEventListener("pointerleave",function(){Ut=null,document.activeElement!==G&&_r("")}),G.addEventListener("click",function(rr){const pn=aa(Ct,Tn(rr));pn&&vp(pn.path,!0,ve(!1))}),G.addEventListener("focus",function(){Ct[zt]&&_r(Ct[zt].path)}),G.addEventListener("blur",function(){_r(Ut?Qt:"")}),G.addEventListener("keydown",function(rr){if(!Ct.length)return;if(rr.key==="Enter"||rr.key===" "){Qt&&(rr.preventDefault(),vp(Qt,!0,ve(!1)));return}if(rr.key!=="ArrowRight"&&rr.key!=="ArrowDown"&&rr.key!=="ArrowLeft"&&rr.key!=="ArrowUp")return;rr.preventDefault();const pn=rr.key==="ArrowRight"||rr.key==="ArrowDown"?1:-1;zt=(zt+pn+Ct.length)%Ct.length,_r(Ct[zt].path)});const ol=function(){G.isConnected&&(tr=window.requestAnimationFrame(ol),dr(Ct,Lt,Yt,Qt,Ie,Be),yn(ft,Ct,Lt,Yt,Qt,Ie,Be))};return{start:function(){ft&&(vn(),yn(ft,Ct,Lt,Yt,Qt,Ie,Be),tr=window.requestAnimationFrame(ol))},stop:function(){tr&&window.cancelAnimationFrame(tr)}}}function dr(G,H,J,de,Ie,Be){const We=de?J[de]:null;G.forEach(function(mt){const Lt=mt===We?1:0,Ct=mt===We?.052:.034;mt.vx+=(mt.baseX-mt.x)*Ct,mt.vy+=(mt.baseY-mt.y)*Ct,mt.z+=(Lt-mt.z)*.095});const ft=We?fr(We.z):0;H.forEach(function(mt){const Lt=J[mt.source],Ct=J[mt.target];if(!Lt||!Ct)return;const Yt=Ct.x-Lt.x||.01,Qt=Ct.y-Lt.y||.01,zt=Math.max(1,Math.sqrt(Yt*Yt+Qt*Qt)),Ut=We&&(mt.source===We.path||mt.target===We.path),tr=104+(Ut?28*ft:0),_r=(zt-tr)*(Ut?.0015:.0011),vn=Yt/zt,Tn=Qt/zt;Lt.vx+=vn*_r,Lt.vy+=Tn*_r,Ct.vx-=vn*_r,Ct.vy-=Tn*_r});for(let mt=0;mt.02){const mt=Jr(We,We.fullLabel);G.forEach(function(Lt){if(Lt===We)return;const Ct=ZP(mt,Jr(Lt,Lt.label));if(!Ct)return;const Yt=Lt.x-We.x||.01,Qt=Lt.y-We.y||.01,zt=Math.max(1,Math.sqrt(Yt*Yt+Qt*Qt)),Ut=Math.min(3.2,(Math.max(Ct.x,Ct.y)*.026+.8)*ft);Lt.vx+=Yt/zt*Ut,Lt.vy+=Qt/zt*Ut})}G.forEach(function(mt){mt.x+=mt.vx,mt.y+=mt.vy,dw(mt,Ie,Be),mn(mt,We?5.5:4.2);const Lt=We?.58:.66;mt.vx*=Lt,mt.vy*=Lt,Math.abs(mt.vx)<.018&&(mt.vx=0),Math.abs(mt.vy)<.018&&(mt.vy=0)})}function fr(G){const H=xe(G,0,1);return H*H*(3-2*H)}function mn(G,H){const J=Math.sqrt(G.vx*G.vx+G.vy*G.vy);if(J<=H||J<=0)return;const de=H/J;G.vx*=de,G.vy*=de}function yn(G,H,J,de,Ie,Be,We){const ft=Ie?de[Ie]:null,mt=Ba();G.clearRect(0,0,Be,We),G.lineCap="round",G.lineJoin="round",J.forEach(function(Lt){const Ct=de[Lt.source],Yt=de[Lt.target];if(!Ct||!Yt)return;const Qt=ft&&(Lt.source===ft.path||Lt.target===ft.path);G.beginPath(),G.moveTo(Ct.x,Ct.y),G.lineTo(Yt.x,Yt.y),G.strokeStyle=Qt?mt.edgeActive:ft?mt.edgeMuted:mt.edge,G.lineWidth=Qt?2.35:1.05,G.stroke()}),H.slice().sort(function(Lt,Ct){return Lt.z-Ct.z}).forEach(function(Lt){const Ct=Lt===ft,Yt=1+Lt.z*.22,Qt=Lt.radius*Yt,zt=Ct?Lt.fullLabel:Lt.label;G.save(),G.globalAlpha=1,G.beginPath(),G.arc(Lt.x,Lt.y-Lt.z*6,Qt,0,Math.PI*2),G.fillStyle=mt.nodeBg,G.fill(),G.strokeStyle=Ct?mt.nodeActiveBorder:mt.nodeBorder,G.lineWidth=Ct?3:Lt.path==="index.md"?2:1.55,G.stroke(),G.font=(Ct?"600 13px":"400 12px")+" "+mt.fontBody,G.textBaseline="middle",G.textAlign=f1t(Lt.x,t2(zt),Be);const Ut=G.textAlign==="start"?Math.max(16,Lt.x-t2(zt)/2):G.textAlign==="end"?Math.min(Be-16,Lt.x+t2(zt)/2):Lt.x,tr=Lt.y+Lt.labelOffset+Lt.z*4;G.fillStyle=Ct?mt.labelActive:mt.label,G.fillText(zt,Ut,tr),G.restore()})}function Ba(){const G=document.documentElement.dataset.viewerContrast==="high";return{fontBody:Kr("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:G?Kr("--ok-color-text","#202322"):Kr("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:G?Kr("--ok-color-muted","#707773"):Kr("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:Kr("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:Kr("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:G?Kr("--ok-color-text","#202322"):Kr("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:Kr("--ok-color-graph-node-active-border","#0f7a4d"),label:G?Kr("--ok-color-text","#202322"):Kr("--ok-color-graph-label","#5f6b66"),labelActive:G?Kr("--ok-color-text","#202322"):Kr("--ok-color-graph-label-active","#26302c")}}function Kr(G,H){return getComputedStyle(document.documentElement).getPropertyValue(G).trim()||H}function aa(G,H){for(let J=G.length-1;J>=0;J-=1){const de=G[J],Ie=H.x-de.x,Be=H.y-de.y,We=de.radius*(1+de.z*.22)+6;if(Ie*Ie+Be*Be<=We*We||d1t(H,Jr(de,de.z>.6?de.fullLabel:de.label)))return de}return null}function Jr(G,H){const J=t2(H),de=G.y+G.labelOffset-10,Ie=Math.max(G.radius+8,J/2+9);return{left:G.x-Ie,right:G.x+Ie,top:Math.min(G.y-G.radius-8,de),bottom:Math.max(G.y+G.radius+8,de+22)}}function d1t(G,H){return G.x>=H.left&&G.x<=H.right&&G.y>=H.top&&G.y<=H.bottom}function f1t(G,H,J){return G-H/2<16?"start":G+H/2>J-16?"end":"center"}function p1t(G,H,J,de){const Ie=G.nodes.filter(function(zt){return zt&&typeof zt.path=="string"&&zt.path.length>0}),Be=Object.create(null);if(Ie.length===0)return Be;if(Ie.length===1)return Be[Ie[0].path]={x:H/2,y:J/2},Be;const We={x:H/2,y:J/2},ft=Object.create(null),mt=Object.create(null);Ie.forEach(function(zt){ft[zt.path]=!0,mt[zt.path]=0});const Lt=[];G.edges.forEach(function(zt){!zt||!ft[zt.source]||!ft[zt.target]||(Lt.push(zt),mt[zt.source]+=1,mt[zt.target]+=1)});const Ct=g1t(Ie,H,J),Yt=Ie.map(function(zt){const Ut=f2e(zt.path),tr=Ct[Ut]||We,_r=QP(zt.path),vn=_r%360/360*Math.PI*2,Tn=26+_r%74;return{node:zt,group:Ut,label:g2e(zt,de),radius:zt.path==="index.md"?16:10,x:tr.x+Math.cos(vn)*Tn,y:tr.y+Math.sin(vn)*Tn,vx:0,vy:0}}),Qt=Object.create(null);Yt.forEach(function(zt){Qt[zt.node.path]=zt});for(let zt=0;zt<220;zt+=1){for(let Ut=0;Ut0?.006:.018;Ut.vx+=(We.x-Ut.x)*vn,Ut.vy+=(We.y-Ut.y)*vn,Ut.vx+=(tr.x-Ut.x)*Tn,Ut.vy+=(tr.y-Ut.y)*Tn,Ut.x+=Ut.vx,Ut.y+=Ut.vy,dw(Ut,H,J),Ut.vx*=.62,Ut.vy*=.62})}return m1t(Yt,H,J),v1t(Yt,H,J),Yt.forEach(function(zt){Be[zt.node.path]={x:zt.x,y:zt.y}}),Be}function g1t(G,H,J){const de=Object.create(null);G.forEach(function(Ct){const Yt=f2e(Ct.path);de[Yt]=(de[Yt]||0)+1});const Ie=Object.keys(de).sort(function(Ct,Yt){return de[Yt]===de[Ct]?Ct.localeCompare(Yt):de[Yt]-de[Ct]}),Be=Object.create(null);if(Ie.length===0)return Be;const We=Math.max(1,Math.ceil(Math.sqrt(Ie.length*(H/J)))),ft=Math.max(1,Math.ceil(Ie.length/We)),mt=H/We,Lt=J/ft;return Ie.forEach(function(Ct,Yt){const Qt=Yt%We,zt=Math.floor(Yt/We),Ut=QP(Ct),tr=(Ut%31-15)*.9,_r=((Ut>>5)%31-15)*.9;Be[Ct]={x:mt*(Qt+.5)+tr,y:Lt*(zt+.5)+_r}}),Be}function f2e(G){const H=u6(G);return H.length<=1?".":H.length>=3?H.slice(0,2).join("/"):H[0]}function m1t(G,H,J){let de=1/0,Ie=-1/0,Be=1/0,We=-1/0;G.forEach(function(_r){de=Math.min(de,_r.x),Ie=Math.max(Ie,_r.x),Be=Math.min(Be,_r.y),We=Math.max(We,_r.y)});const ft=74,mt=58,Lt=Math.max(1,Ie-de),Ct=Math.max(1,We-Be),Yt=Math.min((H-ft*2)/Lt,(J-mt*2)/Ct,1.28),Qt=(de+Ie)/2,zt=(Be+We)/2,Ut=H/2,tr=J/2;G.forEach(function(_r){_r.x=xe(Ut+(_r.x-Qt)*Yt,ft,H-ft),_r.y=xe(tr+(_r.y-zt)*Yt,mt,J-mt),dw(_r,H,J)})}function y1t(G,H){const J=G.map(jP);for(let de=0;deH-14&&(G.x-=de.right-(H-14)),de.top<18&&(G.y+=18-de.top),de.bottom>J-18&&(G.y-=de.bottom-(J-18))}function QP(G){let H=2166136261;const J=String(G||"");for(let de=0;de>>0}function b1t(G){const H=Object.create(null);G.forEach(function(de){if(!de||typeof de.path!="string")return;const Ie=p2e(de);H[Ie]||(H[Ie]=[]),H[Ie].push(de)});const J=Object.create(null);return Object.keys(H).forEach(function(de){const Ie=H[de];if(Ie.length===1){J[Ie[0].path]=de;return}const Be=Ie.map(function(We){return We.path});Ie.forEach(function(We){J[We.path]=T1t(We.path,Be)})}),J}function p2e(G){const H=String(G.title||"").trim();return H&&H.toLowerCase()!=="index"?H:x1t(G.path)}function x1t(G){const H=u6(G);if(H.length===0)return String(G||"");const J=H[H.length-1];return J.toLowerCase()==="index"&&H.length>1?H.slice(-2).join("/"):J}function T1t(G,H){const J=u6(G);for(let de=1;de<=J.length;de+=1){const Ie=J.slice(-de).join("/");if(H.every(function(We){return We===G||u6(We).slice(-de).join("/")!==Ie}))return Ie}return J.join("/")||String(G||"")}function u6(G){return String(G||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function g2e(G,H){const J=m2e(G,H);return J.length>22?J.slice(0,21)+"...":J}function m2e(G,H){return H[G.path]||p2e(G)}function w1t(G,H){const J=Object.create(null);return G.forEach(function(de){de&&typeof de[H]=="string"&&(J[de[H]]=de)}),J}function C1t(G){const H=Object.create(null);return G.forEach(function(J){J&&typeof J.htmlPath=="string"&&typeof J.path=="string"&&y2e(J.htmlPath).forEach(function(de){H[de]===void 0&&(H[de]=J.path)})}),H}function h6(){return V.length>0}function d6(G){const H=String(G).lastIndexOf(".");return H<0?zh(G+"/index.html"):zh(G.slice(0,H)+".html")}function y2e(G){const H=zh(G),J=[];if(fw(J,H),/\.html$/i.test(H)){const de=H.slice(0,-5);fw(J,de),/\/index\.html$/i.test(H)?fw(J,H.slice(0,H.length-10)):/^index\.html$/i.test(H)&&fw(J,"")}return J.slice().forEach(function(de){fw(J,de.toLowerCase())}),J}function fw(G,H){const J=zh(H);G.includes(J)||G.push(J)}function k1t(G){var Be;const H=al()[0]||((Be=document.querySelector("[data-note-path]"))==null?void 0:Be.dataset.notePath)||"index.md",J=d6(H),de=d6(G),Ie=J.includes("/")?J.slice(0,J.lastIndexOf("/")+1):"";return E1t(Ie,de)}function E1t(G,H){const J=zh(G).split("/").filter(Boolean),de=zh(H).split("/").filter(Boolean);for(;J.length&&de.length&&J[0]===de[0];)J.shift(),de.shift();return J.map(function(){return".."}).concat(de).join("/")||"."}function zh(G){const H=String(G||"").replace(/\\/g,"/").split("/"),J=[];return H.forEach(function(de){if(!(!de||de===".")){if(de===".."){J.pop();return}J.push(de)}}),J.join("/")}function S1t(G,H){const J=String(G||"").trim();if(!J||J.startsWith("#"))return null;const de=J.split("#")[0].split("?")[0];if(!de)return H||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(de)&&!de.startsWith("/")){const Be=d6(H||al()[0]||"index.md"),We=Be.includes("/")?Be.slice(0,Be.lastIndexOf("/")+1):"";return v2e(We+de)}let Ie;try{Ie=new URL(de,window.location.href)}catch{return null}return Ie.origin!==window.location.origin?null:v2e(A1t(Ie))}function v2e(G){const H=zh(G);return W[H]||W[H.toLowerCase()]||null}function A1t(G){var Be;const H=((Be=document.querySelector("[data-note-path]"))==null?void 0:Be.dataset.notePath)||al()[0]||"index.md";let J=b2e(window.location.pathname),de=b2e(G.pathname);const Ie=_1t(J,H);return Ie&&de.toLowerCase().startsWith(Ie.toLowerCase())&&(de=de.slice(Ie.length)),zh(de)}function _1t(G,H){const J=String(G||"").toLowerCase(),de=y2e(d6(H)).filter(Boolean).sort(function(Ie,Be){return Be.length-Ie.length});for(const Ie of de){const Be=["/"+Ie,"/"+Ie+"/"];for(const We of Be)if(J.endsWith(We.toLowerCase()))return G.slice(0,G.length-We.length+1)}return G.slice(0,G.lastIndexOf("/")+1)}function b2e(G){try{return decodeURIComponent(G||"")}catch{return G||""}}function R1t(G){const H=t.dataset.noteRoot||"",J=H.includes("\\")?"\\":"/",de=H.replace(/[\\/]+$/,""),Ie=String(G||"").split("/").join(J);return de?de+J+Ie:Ie}function x2e(G){const H=String(G||"").replace(/\\/g,"/");return(H.startsWith("/")?"/":"")+H.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function L1t(G){const H=x2e(G);return"file://"+(H.startsWith("/")?"":"/")+H}function I1t(G,H){const J=R1t(H),de=x2e(J),Ie=de.startsWith("/")?de:"/"+de,Be=L1t(J);switch(G.id){case"code":return"vscode://file"+Ie;case"cursor":return"cursor://file"+Ie;case"windsurf":return"windsurf://file"+Ie;case"zed":return"zed://file"+Ie;case"obsidian":return"obsidian://open?path="+encodeURIComponent(J);case"sublime":return"sublime://open?url="+encodeURIComponent(Be);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Be);case"nova":return"nova://open?path="+encodeURIComponent(J);case"intellij":return"idea://open?file="+encodeURIComponent(J);case"webstorm":return"webstorm://open?file="+encodeURIComponent(J);default:return Be}}function D1t(){var de;const G=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],H=(de=window.OpenKnowledgeStaticData)==null?void 0:de.editors;if(Array.isArray(H)&&H.length)return H;const J=document.querySelector("[data-editor-options]");if(!J)return G;try{const Ie=JSON.parse(J.textContent||"[]");return Array.isArray(Ie)&&Ie.length?Ie:G}catch{return G}}function M1t(G){return P.find(function(H){return H.id===G})||P[0]}function T2e(G){return G.short||G.name.slice(0,2)}function w2e(G,H){if(G.replaceChildren(),G.dataset.hasIcon=H.icon?"true":"false",!H.icon){G.textContent=T2e(H);return}const J=document.createElement("img");J.className="editor-icon",J.src=H.icon,J.alt="",J.decoding="async",J.draggable=!1,J.addEventListener("error",function(){G.dataset.hasIcon="false",G.replaceChildren(),G.textContent=T2e(H)},{once:!0}),G.append(J)}function f6(G,H){const J=document.createElementNS("http://www.w3.org/2000/svg","svg");if(J.setAttribute("class",H+" control-icon"),J.setAttribute("data-icon",G),J.setAttribute("viewBox","0 0 24 24"),J.setAttribute("aria-hidden","true"),G==="chevron-down"){const Be=document.createElementNS("http://www.w3.org/2000/svg","path");return Be.setAttribute("d","m6 9 6 6 6-6"),J.append(Be),J}if(G==="github"){const Be=document.createElementNS("http://www.w3.org/2000/svg","path");return Be.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),J.append(Be),J}const de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M18 6 6 18");const Ie=document.createElementNS("http://www.w3.org/2000/svg","path");return Ie.setAttribute("d","m6 6 12 12"),J.append(de,Ie),J}function C2e(){let G=[];try{G=JSON.parse(window.localStorage.getItem(L)||"[]")}catch{G=[]}Array.isArray(G)||(G=[]);const H=new Set(P.map(function(de){return de.id})),J=G.filter(function(de,Ie){return typeof de=="string"&&H.has(de)&&G.indexOf(de)===Ie});return P.forEach(function(de){J.includes(de.id)||J.push(de.id)}),J}function N1t(){return C2e().map(M1t).filter(Boolean)}function k2e(G){const H=[G].concat(C2e().filter(function(J){return J!==G}));try{window.localStorage.setItem(L,JSON.stringify(H))}catch{return}}function O1t(){const G=document.createElement("div");G.className="editor-picker",G.dataset.editorPicker="";const H=document.createElement("div");H.className="editor-trigger",H.dataset.editorTrigger="",H.setAttribute("role","group");const J=document.createElement("a");J.className="editor-open",J.href="#",J.dataset.editorOpen="",J.dataset.directLink="true",J.title="Open in editor";const de=document.createElement("span");de.className="editor-mark",de.dataset.editorMark="",de.setAttribute("aria-hidden","true"),de.textContent="--",J.append(de);const Ie=document.createElement("button");Ie.className="editor-menu-trigger",Ie.type="button",Ie.dataset.editorMenuTrigger="",Ie.setAttribute("aria-haspopup","menu"),Ie.setAttribute("aria-expanded","false"),Ie.setAttribute("aria-label","Choose editor"),Ie.title="Choose editor",Ie.append(f6("chevron-down","editor-caret")),H.append(J,Ie);const Be=document.createElement("div");return Be.className="editor-menu",Be.dataset.editorMenu="",Be.hidden=!0,Be.setAttribute("role","menu"),G.append(H,Be),G}function $1t(G,H){if(!H)return null;const J=document.createElement("a");return J.className="source-open",J.href=H,J.dataset.sourceOpen="",J.dataset.directLink="true",J.target="_blank",J.rel="noreferrer",J.title="Open on GitHub",J.setAttribute("aria-label","Open "+G+" on GitHub"),J.append(f6("github","source-icon")),J}function JP(G){const H=G.querySelector("[data-editor-trigger]"),J=G.querySelector("[data-editor-open]"),de=G.querySelector("[data-editor-menu-trigger]"),Ie=G.querySelector("[data-editor-mark]"),Be=G.querySelector("[data-editor-menu]"),We=N1t(),ft=We[0],mt=G.closest("[data-note-path]"),Lt=(mt==null?void 0:mt.dataset.notePath)||"";if(!(!H||!J||!de||!Ie||!Be||!ft||!Lt)){if(w2e(Ie,ft),H.setAttribute("aria-label","Editor: "+ft.name),J.href=I1t(ft,Lt),J.title="Open "+Lt+" in "+ft.name,J.setAttribute("aria-label","Open "+Lt+" in "+ft.name),de.title="Choose editor",de.setAttribute("aria-label","Choose editor for "+Lt),G.dataset.primaryEditor=ft.id,Be.replaceChildren(),E2e(Be,ft,!0),We.length>1){const Ct=document.createElement("div");Ct.className="editor-menu-separator",Ct.setAttribute("role","separator"),Be.append(Ct)}We.slice(1).forEach(function(Ct){E2e(Be,Ct,!1)})}}function E2e(G,H,J){const de=document.createElement("button");de.className="editor-menu-item"+(J?" is-selected":""),de.type="button",de.dataset.editorOption=H.id,de.setAttribute("role","menuitemradio"),de.setAttribute("aria-checked",J?"true":"false");const Ie=document.createElement("span");Ie.className="editor-option-mark",w2e(Ie,H);const Be=document.createElement("span");Be.className="editor-option-label",Be.textContent=H.name,de.append(Ie,Be),G.append(de)}function S2e(){document.querySelectorAll("[data-editor-picker]").forEach(JP)}function pw(G,H){const J=G.querySelector("[data-editor-menu-trigger]"),de=G.querySelector("[data-editor-menu]");!J||!de||(H&&(gw(G),JP(G)),de.hidden=!H,J.setAttribute("aria-expanded",H?"true":"false"))}function gw(G){document.querySelectorAll("[data-editor-picker]").forEach(function(H){H!==G&&pw(H,!1)})}function mw(G){!l||!u||(u.hidden=!G,l.setAttribute("aria-expanded",G?"true":"false"))}function P1t(){if(!u)return null;const G=u.querySelector("[data-settings-reset]");if(G)return G;const H=document.createElement("div");H.className="viewer-settings-footer";const J=document.createElement("button");return J.type="button",J.className="viewer-settings-reset",J.dataset.settingsReset="",J.textContent="Reset to defaults",H.append(J),u.append(H),J}function B1t(){if(!o||!l||!u||o.dataset.settingsBound==="true")return;o.dataset.settingsBound="true";let G=Me(),H=Ke(),J=it();dt(G),ot(H),we(J);const de=P1t();de&&de.addEventListener("click",function(){G=qe({preset:te,custom:fe}),H=!0,J=Te(oe),R=A,Le(G),De(H),ct(J),pe(R),dt(G),ot(H),we(J),Pe(R)}),l.addEventListener("click",function(Be){Be.preventDefault(),Be.stopPropagation(),mw(u.hidden)}),l.addEventListener("keydown",function(Be){if(Be.key!=="ArrowDown"&&Be.key!=="Enter"&&Be.key!==" ")return;Be.preventDefault(),mw(!0);const We=u.querySelector("[data-theme-option].is-selected")||u.querySelector("[data-theme-option]");We&&We.focus()}),u.addEventListener("click",function(Be){const We=He(Be.target,"[data-theme-option]");We&&(Be.preventDefault(),G=qe({preset:We.dataset.themeOption,custom:G.custom}),Le(G),dt(G))}),u.addEventListener("keydown",function(Be){if(Be.key==="Escape"){Be.preventDefault(),mw(!1),l.focus();return}if(Be.key!=="Enter"&&Be.key!==" ")return;const We=He(Be.target,"[data-theme-option]");We&&(Be.preventDefault(),G=qe({preset:We.dataset.themeOption,custom:G.custom}),Le(G),dt(G))}),u.querySelectorAll("[data-theme-custom-value]").forEach(function(Be){Be.addEventListener("input",function(){const We=Be.dataset.themeCustomValue;if(!fe[We]||!Dt(Be.value))return;const ft=Object.assign({},G.custom);ft[We]=Be.value.toLowerCase(),G=qe({preset:"custom",custom:ft}),Le(G),dt(G)})}),f&&f.addEventListener("change",function(){H=f.checked,De(H),ot(H)});function Ie(Be,We){J=Te(Object.assign({},J,{[Be]:We})),ct(J),we(J)}p&&p.addEventListener("change",function(){Ie("font",p.value)}),g&&g.addEventListener("change",function(){Ie("size",g.value)}),m&&m.addEventListener("change",function(){Ie("spacing",m.value)}),y&&y.addEventListener("change",function(){Ie("motion",y.value)}),v&&v.addEventListener("change",function(){Ie("readableLineLength",v.checked)}),x&&x.addEventListener("change",function(){Ie("highContrast",x.checked)}),b&&b.addEventListener("change",function(){Ie("underlineLinks",b.checked)})}function ko(){return e.querySelector(".note-panel.is-active-panel")}function F1t(){return He(document.activeElement,"[data-note-path]")}function A2e(){return F1t()||ko()}function Gh(G){!G||!e.contains(G)||(ye().forEach(function(H){const J=H===G;H.classList.toggle("is-active-panel",J),H.dataset.activePanel=J?"true":"false",J||H.querySelectorAll("[data-editor-picker]").forEach(function(de){pw(de,!1)})}),pp(),sc(G.dataset.notePath,!1))}function eB(){const G=ye();G.length&&(ko()||Gh(G[G.length-1]))}function z1t(G){!G||G.dataset.resizeHandlesBound==="true"||(G.dataset.resizeHandlesBound="true",["left","right"].forEach(function(H){const J=document.createElement("button");J.type="button",J.className="note-resize-handle note-resize-handle-"+H,J.dataset.panelResizeHandle=H,J.setAttribute("aria-label","Resize note panel from the "+H),J.title="Resize panel",J.addEventListener("pointerdown",Eyt),J.addEventListener("keydown",function(de){kyt(G,H,de)}),G.append(J)}),_2e(G),G.addEventListener("scroll",function(){_2e(G)},{passive:!0}))}function _2e(G){G&&G.style.setProperty("--note-panel-scroll-top",Math.max(0,G.scrollTop||0)+"px")}function G1t(G){if(!G||G.dataset.editorBound==="true")return;G.dataset.editorBound="true",JP(G);const H=G.querySelector("[data-editor-menu-trigger]"),J=G.querySelector("[data-editor-menu]");!H||!J||(H.addEventListener("click",function(de){de.preventDefault(),de.stopPropagation(),pw(G,J.hidden)}),H.addEventListener("keydown",function(de){if(de.key!=="ArrowDown"&&de.key!=="Enter"&&de.key!==" ")return;de.preventDefault(),pw(G,!0);const Ie=J.querySelector("[data-editor-option]");Ie&&Ie.focus()}),J.addEventListener("click",function(de){const Ie=He(de.target,"[data-editor-option]");Ie&&(de.preventDefault(),de.stopPropagation(),k2e(Ie.dataset.editorOption),S2e(),gw())}),J.addEventListener("keydown",function(de){if(de.key==="Escape"){de.preventDefault(),pw(G,!1),H.focus();return}if(de.key!=="Enter"&&de.key!==" ")return;const Ie=He(de.target,"[data-editor-option]");Ie&&(de.preventDefault(),k2e(Ie.dataset.editorOption),S2e(),gw(),H.focus())}))}function al(){return ye().map(function(G){return G.dataset.notePath})}function R2e(){const G=new URLSearchParams(window.location.search);return G.get("empty")==="1"?[]:[$t(window.location.href)||al()[0]||"index.md"].concat(G.getAll("stack").filter(Boolean))}function L2e(){return I2e(window.location.href)}function I2e(G){let H;try{H=new URL(G,window.location.href)}catch{return""}return(H.searchParams.get("ok-highlight")||"").trim()}function D2e(G,H){if(!G.length){const de=new URL(Tt("index.md"),window.location.href);return de.searchParams.set("empty","1"),de}const J=new URL(Tt(G[0]||"index.md"),window.location.href);return G.slice(1).forEach(function(de){J.searchParams.append("stack",de)}),H&&J.searchParams.set("ok-highlight",H),J}function r2(){const G=ye().length,H=G===0;t.classList.toggle("is-empty",H),t.classList.toggle("is-single-panel",G===1),t.classList.toggle("is-multi-panel",G>1),r&&(r.hidden=!H),ye().forEach(Pa),eB(),q1t(),v6(),bw()}function q1t(){const G=al();ye().forEach(function(H,J){const de=H.querySelector("[data-close-panel]");if(!de)return;const Ie=G.filter(function(Be,We){return We!==J});de.href=D2e(Ie).href})}function yw(){return Math.max(0,t.scrollWidth-t.clientWidth)}function vw(){return!!(w&&k&&S&&ye().length>1&&yw()>1&&!t.classList.contains("is-empty"))}function bw(){window.requestAnimationFrame(V1t)}function V1t(){if(!w||!k||!S)return;if(!vw()){w.hidden=!0,w.setAttribute("aria-hidden","true"),S.style.width="",S.style.setProperty("--thumb-x","0px"),S.setAttribute("aria-valuemax","0"),S.setAttribute("aria-valuenow","0");return}w.hidden=!1,w.setAttribute("aria-hidden","false");const G=k.getBoundingClientRect().width;if(G<=0)return;const H=yw(),J=xe(G*(t.clientWidth/t.scrollWidth),44,G),de=Math.max(0,G-J),Ie=H>0?t.scrollLeft/H*de:0;S.style.width=J+"px",S.style.setProperty("--thumb-x",xe(Ie,0,de)+"px"),S.setAttribute("aria-valuemax",String(Math.round(H))),S.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function tB(G,H){if(!vw())return;const J=k.getBoundingClientRect(),de=S.getBoundingClientRect(),Ie=Math.max(0,J.width-de.width),Be=yw(),We=xe(G-J.left-H,0,Ie);t.scrollLeft=Ie>0?We/Ie*Be:0}function pp(){const G=ye(),H=ko()||G[G.length-1];if(!H){document.title="Knowledge base - Open Knowledge";return}const J=(H==null?void 0:H.dataset.noteTitle)||(H==null?void 0:H.dataset.notePath)||"Open Knowledge";document.title=J+" - Open Knowledge"}function xw(G,H,J){const de=D2e(G,J),Ie={stack:G};window.history.pushState(Ie,"",de)}function W1t(){t8e(),window.clearTimeout(be),be=window.setTimeout(function(){M2e(e,!0)},60)}function gp(G,H,J){return G.getPropertyValue(H).trim()||J}function U1t(){const G=window.getComputedStyle(document.documentElement),H=gp(G,"--ok-color-page","#ffffff"),J=gp(G,"--ok-color-surface",H),de=gp(G,"--ok-color-text","#202322"),Ie=gp(G,"--ok-color-muted","#707773"),Be=gp(G,"--ok-color-accent","#0b7a53"),We=gp(G,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:H,primaryColor:J,primaryTextColor:de,primaryBorderColor:We,lineColor:Ie,secondaryColor:H,secondaryTextColor:de,secondaryBorderColor:We,tertiaryColor:J,tertiaryTextColor:de,tertiaryBorderColor:We,mainBkg:J,nodeBorder:Be,clusterBkg:H,clusterBorder:We,titleColor:de,edgeLabelBackground:J,textColor:de,fontFamily:gp(G,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function H1t(G){var J,de;const H=[];return(J=G==null?void 0:G.matches)!=null&&J.call(G,"[data-mermaid-source]")&&H.push(G),(de=G==null?void 0:G.querySelectorAll)==null||de.call(G,"[data-mermaid-source]").forEach(function(Ie){H.push(Ie)}),H}function Y1t(G){var Be;const H=He(G,"[data-mermaid-diagram]");if(H)return H;const J=document.createElement("figure");J.className="ok-mermaid",J.dataset.mermaidDiagram="";const de=document.createElement("div");de.className="ok-mermaid-output",de.dataset.mermaidOutput="",de.setAttribute("role","img"),de.setAttribute("aria-label","Mermaid diagram"),de.hidden=!0;const Ie=document.createElement("p");return Ie.className="ok-mermaid-error",Ie.dataset.mermaidError="",Ie.setAttribute("role","status"),Ie.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Ie.hidden=!0,G.parentNode.insertBefore(J,G),J.append(de,Ie,G),J._openKnowledgeMermaidSource=String(((Be=G.querySelector("code"))==null?void 0:Be.textContent)||G.textContent||""),J}function X1t(G){var Ie,Be;const H=He(G,"[data-note-path]"),J=((Be=(Ie=H==null?void 0:H.querySelector(".note-body h1"))==null?void 0:Ie.textContent)==null?void 0:Be.trim())||(H==null?void 0:H.dataset.noteTitle)||"document",de=Array.from((H==null?void 0:H.querySelectorAll("[data-mermaid-diagram]"))||[G]);return"Mermaid diagram "+(Math.max(0,de.indexOf(G))+1)+" in "+J}function M2e(G,H){if(!window.mermaid||typeof window.mermaid.render!="function")return;const J=H1t(G).map(Y1t).filter(function(Ie){const Be=Ie.dataset.mermaidState||"";return H||Be!=="queued"&&Be!=="rendering"&&Be!=="rendered"});if(!J.length)return;const de=++Ce;J.forEach(function(Ie){Ie.dataset.mermaidState="queued",Ie._openKnowledgeMermaidRequest=de}),Re=Re.catch(function(){}).then(function(){return K1t(J,de)})}async function K1t(G,H){try{window.mermaid.initialize(U1t())}catch{G.forEach(function(J){const de=J.querySelector("[data-mermaid-source]"),Ie=J.querySelector("[data-mermaid-output]"),Be=J.querySelector("[data-mermaid-error]");J._openKnowledgeMermaidRequest!==H||!de||!Ie||!Be||(Ie.hidden=!0,de.hidden=!1,Be.hidden=!1,J.dataset.mermaidState="error")});return}for(const J of G){if(J._openKnowledgeMermaidRequest!==H)continue;const de=J.querySelector("[data-mermaid-source]"),Ie=J.querySelector("[data-mermaid-output]"),Be=J.querySelector("[data-mermaid-error]");if(!(!de||!Ie||!Be)){J.dataset.mermaidState="rendering",Ie.setAttribute("aria-busy","true");try{const We=await window.mermaid.render("ok-mermaid-"+ ++Ge,J._openKnowledgeMermaidSource);if(J._openKnowledgeMermaidRequest!==H)continue;Ie.innerHTML=We.svg,typeof We.bindFunctions=="function"&&We.bindFunctions(Ie),Ie.hidden=!1,de.hidden=!0,Be.hidden=!0,e8e(Ie,X1t(J)),J.dataset.mermaidState="rendered"}catch{if(J._openKnowledgeMermaidRequest!==H)continue;J.dataset.mermaidRendered!=="true"&&(Ie.hidden=!0,de.hidden=!1,Be.hidden=!1),J.dataset.mermaidState="error"}finally{Ie.removeAttribute("aria-busy")}J.dataset.mermaidState==="rendered"&&(J.dataset.mermaidRendered="true")}}}function j1t(G){G.querySelectorAll("table").forEach(function(H){var Yt,Qt,zt;if(H.dataset.okTableEnhanced==="true")return;const J=(Qt=(Yt=H.tHead)==null?void 0:Yt.rows)==null?void 0:Qt[0],de=(zt=H.tBodies)==null?void 0:zt[0];if(!J||!de)return;const Ie=Array.prototype.slice.call(J.cells),Be=Array.prototype.slice.call(de.rows);if(!Ie.length||!Be.length)return;H.classList.add("ok-table"),H.dataset.okTable="",H.dataset.okTableEnhanced="true",Be.forEach(function(Ut,tr){Ut.dataset.okTableOriginalIndex=String(tr)});const We=Z1t(H),ft={query:"",filters:Ie.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},mt=document.createElement("span");mt.className="ok-table-count",mt.dataset.okTableCount="";function Lt(){let Ut=0;Be.forEach(function(tr){const _r=!ft.query||yp(tr.textContent).includes(ft.query),vn=ft.filters.every(function(mi,ol){return!mi||yp(mp(tr.cells[ol]))===mi}),Tn=_r&&vn;tr.hidden=!Tn,Tn&&(Ut+=1)}),mt.textContent=Ut===Be.length?$2e(Be.length):Ut+" / "+$2e(Be.length)}Ie.forEach(function(Ut,tr){J1t(Ut,de,Ie,Be,ft,tr)});const Ct=Q1t(Ie,Be,ft,mt,Lt);We.insertBefore(Ct,We.firstChild),Lt()})}function Z1t(G){let H=He(G,"[data-ok-table-wrap]");if(!H){H=document.createElement("div"),H.className="ok-table-wrap",H.dataset.okTableWrap="";const J=document.createElement("div");return J.className="ok-table-scroller",G.parentNode.insertBefore(H,G),H.append(J),J.append(G),H}if(!He(G,".ok-table-scroller")){const J=document.createElement("div");J.className="ok-table-scroller",G.parentNode.insertBefore(J,G),J.append(G)}return H}function Q1t(G,H,J,de,Ie){const Be=document.createElement("div");Be.className="ok-table-tools",Be.dataset.okTableControls="";const We=document.createElement("input");We.className="ok-table-search",We.type="search",We.placeholder="Filter table",We.setAttribute("aria-label","Filter table rows"),We.addEventListener("input",function(){J.query=yp(We.value),Ie()}),Be.append(We);const ft=document.createElement("div");ft.className="ok-table-filter-list";const mt=[];let Lt,Ct;function Yt(){const Qt=J.filters.filter(Boolean).length;Lt&&(Lt.textContent=Qt?"Filters ("+Qt+")":"Filters"),Ct&&(Ct.disabled=Qt===0)}if(G.forEach(function(Qt,zt){const Ut=tyt(H,zt);if(Ut.length<2||Ut.length>30)return;const tr=document.createElement("select"),_r=mp(Qt)||"Column "+(zt+1);tr.setAttribute("aria-label","Filter by "+_r);const vn=document.createElement("option");vn.value="",vn.textContent=_r+": All",tr.append(vn),Ut.forEach(function(Tn){const mi=document.createElement("option");mi.value=yp(Tn),mi.textContent=Tn,tr.append(mi)}),tr.addEventListener("change",function(){J.filters[zt]=tr.value,Yt(),Ie()}),mt.push(tr),ft.append(tr)}),ft.children.length){const Qt=document.createElement("details");Qt.className="ok-table-filter-menu";const zt=document.createElement("summary");zt.className="ok-table-filter-trigger",zt.setAttribute("role","button"),zt.setAttribute("aria-label","Table filters"),Lt=document.createElement("span"),Lt.textContent="Filters",zt.append(Lt);const Ut=document.createElement("div");Ut.className="ok-table-filter-panel",Ct=document.createElement("button"),Ct.className="ok-table-clear",Ct.type="button",Ct.textContent="Clear filters",Ct.addEventListener("click",function(){J.filters=J.filters.map(function(){return""}),mt.forEach(function(tr){tr.value=""}),Yt(),Ie(),mt[0]&&mt[0].focus()}),Ut.append(ft,Ct),Qt.append(zt,Ut),Qt.addEventListener("keydown",function(tr){tr.key==="Escape"&&(Qt.open=!1,zt.focus())}),Be.append(Qt),Yt()}return Be.append(de),Be}function J1t(G,H,J,de,Ie,Be){if(G.dataset.okTableSort="",G.tabIndex=0,G.setAttribute("aria-label","Sort by "+(mp(G)||"column "+(Be+1))),!G.querySelector(".ok-table-sort-indicator")){const ft=document.createElement("span");ft.className="ok-table-sort-indicator",ft.setAttribute("aria-hidden","true"),G.append(ft)}function We(ft){ft&&He(ft.target,"a[href], button, input, textarea, select, [contenteditable='true']")||eyt(H,J,de,Ie,Be)}G.addEventListener("click",We),G.addEventListener("keydown",function(ft){ft.key!=="Enter"&&ft.key!==" "||(ft.preventDefault(),We(ft))})}function eyt(G,H,J,de,Ie){const Be=de.sortColumn===Ie&&de.sortDirection==="asc"?"desc":"asc";de.sortColumn=Ie,de.sortDirection=Be,H.forEach(function(ft){ft.removeAttribute("aria-sort"),ft.removeAttribute("data-sort-direction")}),H[Ie].setAttribute("aria-sort",Be==="asc"?"ascending":"descending"),H[Ie].dataset.sortDirection=Be;const We=Be==="asc"?1:-1;J.sort(function(ft,mt){const Lt=N2e(mp(ft.cells[Ie]),mp(mt.cells[Ie]));return Lt!==0?Lt*We:Number(ft.dataset.okTableOriginalIndex||0)-Number(mt.dataset.okTableOriginalIndex||0)}),J.forEach(function(ft){G.append(ft)})}function tyt(G,H){const J=new Set,de=[];return G.forEach(function(Ie){const Be=mp(Ie.cells[H]),We=yp(Be);!We||J.has(We)||Be.length>80||(J.add(We),de.push(Be))}),de.sort(function(Ie,Be){return N2e(Ie,Be)})}function N2e(G,H){const J=yp(G),de=yp(H);if(!J&&de)return 1;if(J&&!de)return-1;const Ie=O2e(J),Be=O2e(de);return Ie!==null&&Be!==null&&Ie!==Be?Ie-Be:J.localeCompare(de,void 0,{numeric:!0,sensitivity:"base"})}function O2e(G){const H=String(G||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(H)?Number(H.replace(/%$/,"")):null}function mp(G){return String((G==null?void 0:G.textContent)||"").replace(/\s+/g," ").trim()}function yp(G){return mp({textContent:String(G||"")}).toLocaleLowerCase()}function $2e(G){return G+(G===1?" row":" rows")}function n2(){var H;const G=ye();G.forEach(function(J){J.querySelectorAll(".note-body a.is-active-note").forEach(function(de){de.classList.remove("is-active-note"),de.removeAttribute("aria-current")})}),G.forEach(function(J,de){var Be;const Ie=(Be=G[de+1])==null?void 0:Be.dataset.notePath;Ie&&J.querySelectorAll(".note-body a[href]").forEach(function(We){$t(We.getAttribute("href")||We.href,J.dataset.notePath)===Ie&&(We.classList.add("is-active-note"),We.setAttribute("aria-current","true"))})}),sc(((H=ko()||G[G.length-1])==null?void 0:H.dataset.notePath)||"",!1)}function p6(G){Gh(G),window.requestAnimationFrame(function(){G.scrollIntoView({block:"nearest",inline:"end",behavior:yt()?"auto":"smooth"}),G.focus({preventScroll:!0})})}function rB(G){(G||document).querySelectorAll("mark.ok-search-highlight").forEach(function(J){const de=J.parentNode;de&&(J.replaceWith.apply(J,Array.prototype.slice.call(J.childNodes)),de.normalize())})}function i2(G,H){rB(e);const J=String(H||"").trim(),de=G==null?void 0:G.querySelector(".note-body");!de||!J||window.requestAnimationFrame(function(){const Ie=ryt(de,J);if(!Ie)return;const Be=document.createElement("mark");Be.className="ok-search-highlight",Be.dataset.searchHighlight="",Be.append(Ie.extractContents()),Ie.insertNode(Be),Be.scrollIntoView({block:"center",inline:"nearest",behavior:yt()?"auto":"smooth"}),G.focus({preventScroll:!0})})}function ryt(G,H){const J=iyt(H);if(!J)return null;const de=nyt(G),Ie=de.text.indexOf(J);if(Ie<0)return null;let Be=Ie,We=Ie+J.length;for(;BeBe&&de.text[We-1]===" ";)We--;const ft=de.positions[Be],mt=de.positions[We-1];if(!ft||!mt)return null;const Lt=document.createRange();return Lt.setStart(ft.node,ft.start),Lt.setEnd(mt.node,mt.end),Lt}function nyt(G){const H=document.createTreeWalker(G,NodeFilter.SHOW_TEXT),J=[],de=[];let Ie=!0,Be;for(;Be=H.nextNode();){if(He(Be.parentElement,"[hidden], [aria-hidden='true']"))continue;const We=Be.nodeValue||"";for(let ft=0;ft0?G:Ir(q)}function gyt(G){if(!(!s||_.matches||G.button!==0)){Eo={pointerId:G.pointerId,startX:G.clientX,startWidth:pyt(),moved:!1},document.body.classList.add("is-sidebar-resizing"),window.addEventListener("pointermove",W2e),window.addEventListener("pointerup",y6),window.addEventListener("pointercancel",y6),window.addEventListener("blur",H2e),G.preventDefault();try{s.setPointerCapture(G.pointerId)}catch{}}}function W2e(G){if(!Eo||G.pointerId!==Eo.pointerId)return;const H=G.clientX-Eo.startX;Eo.moved=Eo.moved||Math.abs(H)>2,Or(Eo.startWidth+H),G.preventDefault()}function U2e(G){if(!Eo)return;const H=Eo.moved;try{G!==void 0&&(s==null||s.releasePointerCapture(G))}catch{}Eo=null,document.body.classList.remove("is-sidebar-resizing"),window.removeEventListener("pointermove",W2e),window.removeEventListener("pointerup",y6),window.removeEventListener("pointercancel",y6),window.removeEventListener("blur",H2e),H&&tt()}function y6(G){!Eo||G.pointerId!==Eo.pointerId||U2e(G.pointerId)}function H2e(){U2e()}function myt(G){const H=(G.key||"").toLowerCase(),J=G.shiftKey?64:24;let de=Ir(q);if(H==="arrowleft")de-=J;else if(H==="arrowright")de+=J;else if(H==="home")de=xr();else if(H==="end")de=sr();else return;G.preventDefault(),G.stopPropagation(),Or(de),tt()}function Y2e(G){return G.code==="Space"||G.key===" "||G.key==="Spacebar"}function yyt(G){return!!He(G,"input, textarea, select, [contenteditable='true']")}function vyt(G){return!!He(G,"a[href], button, input, textarea, select, [contenteditable='true'], [role='button']")}function X2e(){return V2e.matches&&ye().length>1&&!t.classList.contains("is-empty")}function iB(){return ww&&X2e()}function v6(){t.classList.toggle("is-space-panning",iB())}function byt(G){!Y2e(G)||G.defaultPrevented||G.metaKey||G.ctrlKey||G.shiftKey||G.altKey||vyt(G.target)||X2e()&&(ww=!0,v6(),G.preventDefault())}function xyt(G){!Y2e(G)||!ww||(ww=!1,v6(),G.preventDefault())}function Tyt(){ww=!1,v6()}function K2e(){a2=Date.now()+350,window.setTimeout(function(){Date.now()>=a2&&(a2=0)},360)}function wyt(G){return!a2||Date.now()>a2?!1:(a2=0,G.preventDefault(),G.stopPropagation(),!0)}function j2e(G){return G.getBoundingClientRect().width||Ca(G)||Ft()}function Z2e(G,H){const J=ir(H,G);return!J||!G?null:(G.style.setProperty("--note-panel-width",J+"px"),G.dataset.panelWidth=String(J),G.dataset.notePath&&(B[G.dataset.notePath]=J),bw(),J)}function Cyt(G,H,J){return(G==="left"?-H:H)*(J?2:1)}function kyt(G,H,J){const de=(J.key||"").toLowerCase(),Ie=j2e(G),Be=J.shiftKey?64:24;let We=Ie;if(de==="arrowleft")We+=H==="left"?Be:-Be;else if(de==="arrowright")We+=H==="right"?Be:-Be;else if(de==="home")We=me();else if(de==="end")We=Rt(G);else return;J.preventDefault(),J.stopPropagation();const ft=Z2e(G,We);ft&&(H==="left"&&!lt(G)&&(t.scrollLeft+=ft-Ie),Je())}function Eyt(G){const H=He(G.target,"[data-panel-resize-handle]"),J=H==null?void 0:H.closest("[data-note-path]");if(!(!H||!J||G.button!==0)){Li={pointerId:G.pointerId,panel:J,handle:H,edge:H.dataset.panelResizeHandle==="left"?"left":"right",centered:lt(J),startX:G.clientX,startWidth:j2e(J),startScrollLeft:t.scrollLeft,moved:!1},Gh(J),J.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",Q2e),window.addEventListener("pointerup",b6),window.addEventListener("pointercancel",b6),window.addEventListener("blur",ebe),G.preventDefault(),G.stopPropagation();try{H.setPointerCapture(G.pointerId)}catch{}}}function Q2e(G){if(!Li||G.pointerId!==Li.pointerId)return;const H=G.clientX-Li.startX;Math.abs(H)>2&&(Li.moved=!0);const J=Li.startWidth+Cyt(Li.edge,H,Li.centered),de=Z2e(Li.panel,J);de&&(Li.edge==="left"&&!Li.centered&&(t.scrollLeft=Li.startScrollLeft+(de-Li.startWidth)),G.preventDefault())}function J2e(G){if(!Li)return;const H=Li.moved;Li.panel.classList.remove("is-panel-resizing");try{G!==void 0&&Li.handle.releasePointerCapture(G)}catch{}Li=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",Q2e),window.removeEventListener("pointerup",b6),window.removeEventListener("pointercancel",b6),window.removeEventListener("blur",ebe),H&&(Je(),K2e())}function b6(G){!Li||G.pointerId!==Li.pointerId||J2e(G.pointerId)}function ebe(){J2e()}function Syt(G){return(G.pointerType||"mouse")!=="mouse"||!V2e.matches||G.button!==0||ye().length<2||G.defaultPrevented||G.metaKey||G.ctrlKey||G.shiftKey||G.altKey?!1:iB()?!yyt(G.target):!He(G.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function Ayt(G){if(!Syt(G))return;const H=iB();sl={pointerId:G.pointerId,startX:G.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:H},t.classList.add("is-drag-scrolling"),H&&G.preventDefault();try{t.setPointerCapture(G.pointerId)}catch{}}function _yt(G){if(!sl||G.pointerId!==sl.pointerId)return;const H=G.clientX-sl.startX;Math.abs(H)<3&&!sl.moved||(sl.moved=!0,t.scrollLeft=sl.startScrollLeft-H,G.preventDefault())}function tbe(G){if(!sl||G.pointerId!==sl.pointerId)return;const H=sl;try{t.releasePointerCapture(G.pointerId)}catch{}(H.moved||H.fromSpacePan)&&K2e(),sl=null,t.classList.remove("is-drag-scrolling")}function Ryt(G){if(!vw()||G.button!==0)return;const H=S.getBoundingClientRect();lc={pointerId:G.pointerId,thumbOffset:xe(G.clientX-H.left,0,H.width)},w.classList.add("is-rail-dragging"),window.addEventListener("pointermove",aB),window.addEventListener("pointerup",s2),window.addEventListener("pointercancel",s2),window.addEventListener("blur",nbe),tB(G.clientX,lc.thumbOffset),G.preventDefault();try{S.setPointerCapture(G.pointerId)}catch{}}function Lyt(G){if(!vw()||G.button!==0||He(G.target,"[data-workspace-scroll-thumb]"))return;const H=S.getBoundingClientRect();tB(G.clientX,H.width/2),G.preventDefault()}function aB(G){!lc||G.pointerId!==lc.pointerId||(tB(G.clientX,lc.thumbOffset),G.preventDefault())}function rbe(G){const H=G??lc.pointerId;try{S.releasePointerCapture(H)}catch{}lc=null,w.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",aB),window.removeEventListener("pointerup",s2),window.removeEventListener("pointercancel",s2),window.removeEventListener("blur",nbe)}function s2(G){!lc||G.pointerId!==lc.pointerId||rbe(G.pointerId)}function nbe(){lc&&rbe()}function Iyt(G){if(!vw())return;const H=Math.max(48,t.clientWidth*.12),J=Math.max(120,t.clientWidth*.72);let de=t.scrollLeft;const Ie=(G.key||"").toLowerCase();if(Ie==="arrowleft")de-=H;else if(Ie==="arrowright")de+=H;else if(Ie==="pageup")de-=J;else if(Ie==="pagedown")de+=J;else if(Ie==="home")de=0;else if(Ie==="end")de=yw();else return;G.preventDefault(),t.scrollLeft=xe(de,0,yw())}if(ln(q),Wi(document.body.classList.contains("is-sidebar-open")),t.addEventListener("pointerdown",Ayt),t.addEventListener("pointermove",_yt),t.addEventListener("pointerup",tbe),t.addEventListener("pointercancel",tbe),t.addEventListener("scroll",bw),window.addEventListener("keydown",byt,!0),window.addEventListener("keyup",xyt,!0),window.addEventListener("blur",Tyt),window.addEventListener("resize",function(){ln(q),bw()}),k&&S&&(k.addEventListener("pointerdown",Lyt),S.addEventListener("pointerdown",Ryt),S.addEventListener("pointermove",aB),S.addEventListener("pointerup",s2),S.addEventListener("pointercancel",s2),S.addEventListener("keydown",Iyt)),t.addEventListener("click",function(G){if(wyt(G))return;const H=He(G.target,"[data-note-path]");H&&Gh(H);const J=He(G.target,"[data-close-panel]");if(J){const Lt=J.closest("[data-note-path]");if(!Lt)return;G.preventDefault(),m6(Lt);return}const de=He(G.target,'.ok-source-ref a[href^="#"]');if(de){const Lt=de.closest("[data-note-path]"),Ct=decodeURIComponent((de.getAttribute("href")||"").slice(1)),Yt=Lt?Array.prototype.find.call(Lt.querySelectorAll("[id]"),function(Qt){return Qt.id===Ct}):null;if(Yt){const Qt=Yt.closest("[data-source-ledger]");Qt&&(Qt.open=!0),G.preventDefault(),Yt.scrollIntoView({block:"nearest"});return}}const Ie=He(G.target,"[data-tree-path]"),Be=He(G.target,"[data-graph-path]");if(Ie||Be){if(G.defaultPrevented||G.button!==0||G.metaKey||G.ctrlKey||G.altKey)return;G.preventDefault(),vp((Ie==null?void 0:Ie.dataset.treePath)||Be.dataset.graphPath,!0,ve(G.shiftKey),"",ko());return}const We=He(G.target,"a[href]");if(!We||We.dataset.directLink==="true"||G.defaultPrevented||G.button!==0||G.metaKey||G.ctrlKey||G.altKey)return;const ft=We.closest("[data-note-path]");if(!ft)return;const mt=$t(We.getAttribute("href")||We.href,ft.dataset.notePath);mt&&(G.preventDefault(),vp(mt,!0,ve(G.shiftKey),"",ft))}),t.addEventListener("keydown",function(G){if(G.key!=="Enter"||!G.shiftKey||G.metaKey||G.ctrlKey||G.altKey)return;const H=He(G.target,".note-body a[href]"),J=H==null?void 0:H.closest("[data-note-path]");if(!H||!J)return;const de=$t(H.getAttribute("href")||H.href,J.dataset.notePath);de&&(G.preventDefault(),vp(de,!0,ve(!0),"",J))}),t.addEventListener("focusin",function(G){const H=He(G.target,"[data-note-path]");H&&Gh(H)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Fe),i){const G={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:_i},H=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",_i),H){H.register(G);const J=H.format(G);i.title="File explorer ("+J+")",i.setAttribute("aria-keyshortcuts",H.ariaKeyShortcut(G)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(de){de.textContent=J})}}a&&a.addEventListener("click",function(){Wi(!1),i==null||i.focus()}),s&&(s.addEventListener("pointerdown",gyt),s.addEventListener("keydown",myt)),n&&n.addEventListener("click",function(G){const H=He(G.target,"[data-tree-path]"),J=H||He(G.target,"a[href]");if(!J||G.defaultPrevented||G.button!==0||G.metaKey||G.ctrlKey||G.altKey)return;const de=(H==null?void 0:H.dataset.treePath)||$t(J.getAttribute("href")||J.href);de&&(G.preventDefault(),ibe(J),vp(de,!0,ve(G.shiftKey),"",ko()),_.matches&&Wi(!1))});function ibe(G){const H=He(G,".search");if(!H)return;const J=H.querySelector(".search-input"),de=H.querySelector(".search-results"),Ie=H.querySelector(".search-status");J&&(J.value=""),Ie&&(Ie.textContent=""),de&&(de.hidden=!0,de.replaceChildren())}window.addEventListener("popstate",function(){const G=R2e();q2e(G,L2e())}),document.addEventListener("click",function(G){const H=He(G.target,".search-result[href]");if(H){if(G.defaultPrevented||G.button!==0||G.metaKey||G.ctrlKey||G.altKey)return;const J=$t(H.getAttribute("href")||H.href);if(J){G.preventDefault();const de=G.shiftKey||H.dataset.openBeside==="true",Ie=ve(de);delete H.dataset.openBeside,ibe(H),vp(J,!0,Ie,I2e(H.getAttribute("href")||H.href),ko());return}}He(G.target,"[data-editor-picker]")||gw(),He(G.target,"[data-viewer-settings]")||mw(!1)}),document.addEventListener("keydown",function(G){G.key==="Escape"&&(gw(),mw(!1),Wi(!1))});const Cw=R2e(),abe=L2e();Ue(),B1t(),Jv(),xt(),ye().forEach(z2e),eB(),Cw.length!==1||Cw[0]!==((sbe=ye()[0])==null?void 0:sbe.dataset.notePath)?(window.history.replaceState({stack:Cw},"",window.location.href),q2e(Cw,abe)):(window.history.replaceState({stack:Cw},"",window.location.href),r2(),n2(),pp(),i2(ko(),abe))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(A=>{A.textContent=i.format(a)})):document.addEventListener("keydown",A=>{(A.metaKey||A.ctrlKey)&&!A.altKey&&A.key.toLowerCase()==="k"&&(A.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(A){const R=A.querySelector(".search-input"),N=A.querySelector(".search-results"),M=A.querySelector(".search-status");if(!R||!N||!M)return;const I=A.dataset.searchUrl||"/api/search";let $=0,P=null,B=-1,q=0,V="";m(R,N),K(!1),A===r&&(V=o(),V&&(R.value=V,window.requestAnimationFrame(()=>{R.focus(),R.select(),W(V)}))),R.addEventListener("input",()=>{if(V="",l(),window.clearTimeout($),te(-1,!1),!R.value.trim()){ie(!0);return}$=window.setTimeout(X,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){ie(!0);return}y(N).length>0?se(!0):X()}),R.addEventListener("keydown",Z=>{const ee=y(N);if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(!ee.length)return;Z.preventDefault();const ne=Z.key==="ArrowDown"?1:-1,oe=B<0?ne>0?0:ee.length-1:(B+ne+ee.length)%ee.length;te(oe,!0),se(!0);return}if(Z.key==="Enter"){const ne=v(N,B);if(!ne)return;Z.preventDefault(),ne.dataset.openBeside=Z.shiftKey?"true":"false",ne.click(),K(!0);return}Z.key==="Escape"&&(!N.hidden||R.value)&&(Z.preventDefault(),K(!0))}),N.addEventListener("mousemove",Z=>{const ee=x(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&te(ne,!1)}),N.addEventListener("focusin",Z=>{const ee=x(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&te(ne,!1)}),N.addEventListener("click",Z=>{!x(Z.target)||b(Z)||K(!0)}),document.addEventListener("pointerdown",Z=>{!N.hidden&&!A.contains(Z.target)&&K(!0)}),document.addEventListener("focusin",Z=>{!N.hidden&&!A.contains(Z.target)&&K(!0)});async function X(){const Z=R.value.trim();if(!Z){ie(document.activeElement===R);return}const ee=++q;if(te(-1,!1),e.length>0){u(N,M,k(Z),Z,se,te);return}P&&P.abort(),P=new AbortController,M.textContent="Searching...";try{const ne=await fetch(I+"?q="+encodeURIComponent(Z)+"&limit=12",{signal:P.signal});if(!ne.ok)throw new Error("search request failed");const oe=await ne.json();if(ee!==q||R.value.trim()!==Z)return;u(N,M,oe.results||[],Z,se,te)}catch(ne){if(ne.name==="AbortError")return;M.textContent="Search failed.",te(-1,!1),se(!1)}}async function W(Z){var Ae;const ee=String(Z||"").trim();if(!ee)return;const ne=++q,oe=((Ae=document.querySelector("[data-note-path]"))==null?void 0:Ae.dataset.notePath)||"";if(te(-1,!1),e.length>0){const Re=S(ee,oe);u(N,M,Re,ee,se,te,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Re.length+" note"+(Re.length===1?"":"s")+' tagged "'+ee+'"'});return}P&&P.abort(),P=new AbortController,M.textContent="Finding tagged notes...";const fe=new URLSearchParams({tag:ee,limit:"30"});oe&&fe.set("exclude",oe);try{const Re=await fetch(I+"?"+fe.toString(),{signal:P.signal});if(!Re.ok)throw new Error("tag search request failed");const Ge=await Re.json();if(ne!==q||V!==ee)return;const Ce=Ge.results||[];u(N,M,Ce,ee,se,te,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Ce.length+" note"+(Ce.length===1?"":"s")+' tagged "'+ee+'"'})}catch(Re){if(Re.name==="AbortError")return;M.textContent="Tag lookup failed.",te(-1,!1),se(!1)}}function ie(Z){q+=1,window.clearTimeout($),P&&(P.abort(),P=null);const ee=p();M.textContent=ee.length?"Top files":"",u(N,M,ee,"",se,te,{emptyStatus:"",keepOpenWhenEmpty:Z,statusText:ee.length?"Top files":""}),se(Z&&ee.length>0)}function K(Z){q+=1,window.clearTimeout($),P&&(P.abort(),P=null),Z&&(R.value="",V="",l()),M.textContent="",N.replaceChildren(),te(-1,!1),se(!1)}function se(Z){N.hidden=!Z,R.setAttribute("aria-expanded",Z?"true":"false"),Z||R.removeAttribute("aria-activedescendant")}function te(Z,ee){const ne=y(N);B=ne.length?(Z+ne.length)%ne.length:-1,ne.forEach((oe,fe)=>{const Ae=fe===B;oe.classList.toggle("is-active",Ae),oe.setAttribute("aria-selected",Ae?"true":"false"),Ae&&(R.setAttribute("aria-activedescendant",oe.id),ee&&oe.scrollIntoView({block:"nearest"}))}),B<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let A;try{A=new URL(window.location.href)}catch{return}A.searchParams.has("ok-tag")&&(A.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",A))}function u(A,R,N,M,I,$,P){const B=P||{},q=h(N);if(A.replaceChildren(),q.length===0){const V=B.emptyStatus??'No results for "'+M+'".';if(R.textContent=V,V){const X=document.createElement("div");X.className="search-empty",X.textContent=V,A.append(X)}$(-1,!1),I(!!B.keepOpenWhenEmpty);return}R.textContent=B.statusText||q.length+" document"+(q.length===1?"":"s"),I(!0),q.forEach((V,X)=>{const W=document.createElement("a");W.className="search-result",W.href=V.highlightURL||V.url||O(V.path),W.id=A.id+"-option-"+X,W.setAttribute("role","option"),W.setAttribute("aria-selected","false"),W.title=d();const ie=document.createElement("span");ie.className="search-result-title-row";const K=document.createElement("span");if(K.className="search-result-title",f(K,V.title||V.path,M),ie.append(K),V.matchCount>1){const te=document.createElement("span");te.className="search-result-count",te.textContent=V.matchCount+" matches",ie.append(te)}W.append(ie);const se=document.createElement("span");if(se.className="search-result-meta",se.textContent=[V.path,V.type,V.matchCount===1?V.heading:""].filter(Boolean).join(" - "),W.append(se),V.snippet){const te=document.createElement("span");te.className="search-result-snippet",f(te,V.snippet,M),W.append(te)}if(V.headings.length>1){const te=document.createElement("span");te.className="search-result-headings",te.textContent=V.headings.slice(0,3).join(" · "),W.append(te)}A.append(W)}),$(0,!1)}function h(A){const R=[],N=new Map;return A.forEach((M,I)=>{const $=M.path||"__result-"+I;let P=N.get($);P||(P=Object.assign({},M,{matchCount:0,headings:[]}),N.set($,P),R.push(P)),P.matchCount+=1,M.heading&&!P.headings.includes(M.heading)&&P.headings.push(M.heading),!P.snippet&&M.snippet&&(P.snippet=M.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(A,R,N){const M=String(R||""),I=String(N||"").trim();if(!I){A.textContent=M;return}const $=M.toLocaleLowerCase(),P=I.toLocaleLowerCase();let B=0,q=$.indexOf(P);for(;q>=0;){q>B&&A.append(document.createTextNode(M.slice(B,q)));const V=document.createElement("mark");V.className="search-result-highlight",V.textContent=M.slice(q,q+I.length),A.append(V),B=q+I.length,q=$.indexOf(P,B)}B=12)break}return R.sort(function($,P){return g($.path)!==g(P.path)?g($.path)?1:-1:0})}function g(A){return String(A||"").split("/").pop().toLowerCase()==="index.md"}function m(A,R){R.id||(R.id=(A.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),A.setAttribute("role","combobox"),A.setAttribute("aria-autocomplete","list"),A.setAttribute("aria-controls",R.id),A.setAttribute("aria-expanded","false")}function y(A){return Array.from(A.querySelectorAll(".search-result[href]"))}function v(A,R){const N=y(A);return N.length?N[R>=0?R:0]||N[0]:null}function x(A){return A?A.closest?A.closest(".search-result[href]"):A.parentElement?A.parentElement.closest(".search-result[href]"):null:null}function b(A){return A.button!==0||A.metaKey||A.ctrlKey||A.shiftKey||A.altKey}function w(){var N;const A=(N=window.OpenKnowledgeStaticData)==null?void 0:N.notes;if(Array.isArray(A))return A;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const M=JSON.parse(R.textContent||"[]");return Array.isArray(M)?M:[]}catch{return[]}}function k(A){const R=C(A);return e.map(function(N){const M=_(N.body||""),I=_(N.frontmatter||""),$=N.title||N.path||"",P=N.path||"",B=[I,M].filter(Boolean).join(" "),q=C([$,P,B].join(" ")),V=C($).includes(R),X=C(P).includes(R);if(!q.includes(R))return null;const ie=(V?3:0)+(X?2:0)+1;return{path:P,title:$,snippet:L(B,A),score:g(P)?ie*.55:ie}}).filter(Boolean).sort(function(N,M){return M.score!==N.score?M.score-N.score:g(N.path)!==g(M.path)?g(N.path)?1:-1:N.path.localeCompare(M.path)}).slice(0,12)}function S(A,R){const N=C(A).trim();return e.filter(function(M){return M.path!==R&&Array.isArray(M.tags)&&M.tags.some(function(I){return C(I).trim()===N})}).map(function(M){return{path:M.path,title:M.title||M.path,url:O(M.path),type:"tagged note"}}).sort(function(M,I){return M.path.localeCompare(I.path)})}function C(A){return String(A||"").toLowerCase()}function _(A){const R=document.createElement("div");return R.innerHTML=A,R.textContent||""}function L(A,R){const N=String(A||"").replace(/\s+/g," ").trim();if(!N)return"";const M=N.toLowerCase().indexOf(String(R||"").toLowerCase()),I=Math.max(0,M<0?0:M-48),$=Math.min(N.length,I+140);return(I>0?"...":"")+N.slice(I,$)+($15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(i8e,"-$1").toLowerCase(),s8e={"&":"&",">":">","<":"<",'"':""","'":"'"},o8e=/[&><"']/g,Ia=t=>String(t).replace(o8e,e=>s8e[e]),bC=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?bC(t.body[0]):t:t.type==="font"?bC(t.body):t,l8e=new Set(["mathord","textord","atom"]),Sc=t=>l8e.has(bC(t).type),c8e=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xC={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function u8e(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function h8e(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return u8e(e)}function d8e(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:h8e(n)}class v7{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(xC)){var n=xC[r];n&&d8e(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Mt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=c8e(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Pu{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return xl[f8e[this.id]]}sub(){return xl[p8e[this.id]]}fracNum(){return xl[g8e[this.id]]}fracDen(){return xl[m8e[this.id]]}cramp(){return xl[y8e[this.id]]}text(){return xl[v8e[this.id]]}isTight(){return this.size>=2}}var b7=0,TC=1,a0=2,Ac=3,fb=4,so=5,s0=6,Ha=7,xl=[new Pu(b7,0,!1),new Pu(TC,0,!0),new Pu(a0,1,!1),new Pu(Ac,1,!0),new Pu(fb,2,!1),new Pu(so,2,!0),new Pu(s0,3,!1),new Pu(Ha,3,!0)],f8e=[fb,so,fb,so,s0,Ha,s0,Ha],p8e=[so,so,so,so,Ha,Ha,Ha,Ha],g8e=[a0,Ac,fb,so,s0,Ha,s0,Ha],m8e=[Ac,Ac,so,so,Ha,Ha,Ha,Ha],y8e=[TC,TC,Ac,Ac,so,so,Ha,Ha],v8e=[b7,TC,a0,Ac,a0,Ac,a0,Ac],Dr={DISPLAY:xl[b7],TEXT:xl[a0],SCRIPT:xl[fb],SCRIPTSCRIPT:xl[s0]},x7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function b8e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var wC=[];x7.forEach(t=>t.blocks.forEach(e=>wC.push(...e)));function bY(t){for(var e=0;e=wC[e]&&t<=wC[e+1])return!0;return!1}var Ni=t=>t+" "+t,o0=80,x8e=function(e,r){return"M95,"+(622+e+r)+` + */window.mermaid=DNe,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})();function lx(t,e,r){const n=document.createElement("button");return n.type="button",n.textContent=t,n.dataset.okMermaidAction=r,n.setAttribute("aria-label",e),n.setAttribute("title",e),n}function NNe(){const t=document.createElement("dialog");t.className="ok-mermaid-viewport";const e=document.createElement("div");e.className="ok-mermaid-viewport-toolbar",e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Diagram zoom controls");const r=lx("−","Zoom out","zoom-out"),n=lx("+","Zoom in","zoom-in"),i=lx("100%","Show diagram at 100%","actual"),a=lx("Fit","Fit diagram to viewport","fit"),s=lx("Close","Close diagram viewer","close"),o=document.createElement("output");o.className="ok-mermaid-viewport-zoom",o.dataset.okMermaidZoom="",o.setAttribute("aria-label","Diagram zoom"),o.setAttribute("aria-live","polite"),e.append(r,n,i,a,o,s);const l=document.createElement("div");l.className="ok-mermaid-viewport-canvas",l.dataset.okMermaidCanvas="",l.tabIndex=0,l.setAttribute("aria-label","Diagram canvas. Drag to pan.");const u=document.createElement("div");return u.className="ok-mermaid-viewport-stage",l.append(u),t.append(e,l),document.body.append(t),{actual:i,canvas:l,closeButton:s,dialog:t,fitButton:a,stage:u,zoom:o,zoomIn:n,zoomOut:r}}const ONe=.01,$Ne=8;let bS;function PNe(t,e){if("okMermaidViewportBound"in t.dataset)return;t.dataset.okMermaidViewportBound="",t.tabIndex=0,t.setAttribute("role","button"),t.setAttribute("aria-label",e),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-keyshortcuts","Enter Space"),t.setAttribute("title","Open diagram viewer");const r=()=>(bS||(bS=FNe())).open(t,e);t.addEventListener("click",n=>{var i,a;(a=(i=n.target)==null?void 0:i.closest)!=null&&a.call(i,"a")||r()}),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" "||n.code==="Space")&&(n.preventDefault(),r())})}function BNe(){bS==null||bS.close()}function FNe(){const{actual:t,canvas:e,closeButton:r,dialog:n,fitButton:i,stage:a,zoom:s,zoomIn:o,zoomOut:l}=NNe(),u={fit:!0,height:1,original:null,pinch:null,pointers:new Map,scale:1,trigger:null,width:1,x:0,y:0};function h(){a.style.width=u.width+"px",a.style.height=u.height+"px",a.style.transform="translate3d("+q7(u.x)+"px, "+q7(u.y)+"px, 0) scale("+q7(u.scale)+")",s.textContent=Math.round(u.scale*100)+"%"}function d(){const T=e.getBoundingClientRect(),x=Math.max(1,T.width-48),w=Math.max(1,T.height-48);u.scale=yK(Math.min(x/u.width,w/u.height)),u.x=(T.width-u.width*u.scale)/2,u.y=(T.height-u.height*u.scale)/2,u.fit=!0,h()}function f(){const T=e.getBoundingClientRect();u.scale=1,u.x=(T.width-u.width)/2,u.y=(T.height-u.height)/2,u.fit=!1,h()}function p(T,x,w){const C=yK(u.scale*T),k=e.getBoundingClientRect(),S=x===void 0?k.width/2:x-k.left,E=w===void 0?k.height/2:w-k.top,L=C/u.scale;u.x=S-(S-u.x)*L,u.y=E-(E-u.y)*L,u.scale=C,u.fit=!1,h()}function g(){if(!u.original)return;u.original.parent.insertBefore(u.original.svg,u.original.next),u.original=null,u.pinch=null,u.pointers.clear(),delete e.dataset.okMermaidPanning;const T=u.trigger;u.trigger=null,T&&T.isConnected!==!1&&T.focus()}function m(){n.open&&n.close()}function y(T,x){const w=T.querySelector("svg");if(!w)return;m();const C=zNe(w);u.width=C.width,u.height=C.height,u.trigger=T,u.original={svg:w,parent:w.parentNode,next:w.nextSibling},n.setAttribute("aria-label",x),a.append(w),n.showModal(),d(),e.focus()}l.addEventListener("click",()=>p(.8)),o.addEventListener("click",()=>p(1.25)),t.addEventListener("click",f),i.addEventListener("click",d),r.addEventListener("click",m),n.addEventListener("close",g),n.addEventListener("cancel",T=>{T.preventDefault(),m()}),n.addEventListener("keydown",T=>{const x=T.key.toLowerCase();if(x==="+"||x==="=")p(1.25);else if(x==="-")p(.8);else if(x==="0")f();else if(x==="f")d();else if(x==="escape")m();else if(x.startsWith("arrow"))u.x+=x==="arrowleft"?-40:x==="arrowright"?40:0,u.y+=x==="arrowup"?-40:x==="arrowdown"?40:0,u.fit=!1,h();else return;T.preventDefault()}),e.addEventListener("wheel",T=>{T.preventDefault(),p(T.deltaY<0?1.1:1/1.1,T.clientX,T.clientY)},{passive:!1}),e.addEventListener("pointerdown",T=>{T.button===0&&(u.pointers.set(T.pointerId,{x:T.clientX,y:T.clientY}),u.pinch=V7(u.pointers),u.fit=!1,e.dataset.okMermaidPanning="",e.setPointerCapture(T.pointerId))}),e.addEventListener("pointermove",T=>{const x=u.pointers.get(T.pointerId);if(x){if(u.pointers.set(T.pointerId,{x:T.clientX,y:T.clientY}),u.pointers.size>1){const w=V7(u.pointers);u.pinch&&w&&u.pinch.distance>0&&(p(w.distance/u.pinch.distance,u.pinch.x,u.pinch.y),u.x+=w.x-u.pinch.x,u.y+=w.y-u.pinch.y),u.pinch=w}else u.x+=T.clientX-x.x,u.y+=T.clientY-x.y;h()}});function v(T){u.pointers.has(T.pointerId)&&(u.pointers.delete(T.pointerId),u.pinch=V7(u.pointers),u.pointers.size||delete e.dataset.okMermaidPanning,(!e.hasPointerCapture||e.hasPointerCapture(T.pointerId))&&e.releasePointerCapture(T.pointerId))}return e.addEventListener("pointerup",v),e.addEventListener("pointercancel",v),window.addEventListener("resize",()=>{n.open&&u.fit&&d()}),{close:m,dialog:n,open:y}}function zNe(t){var n,i,a,s,o;const e=(n=t.viewBox)==null?void 0:n.baseVal,r=t.getBoundingClientRect();return{width:q0(e==null?void 0:e.width)||q0((a=(i=t.width)==null?void 0:i.baseVal)==null?void 0:a.value)||q0(r.width)||1,height:q0(e==null?void 0:e.height)||q0((o=(s=t.height)==null?void 0:s.baseVal)==null?void 0:o.value)||q0(r.height)||1}}function q0(t){const e=Number(t);return Number.isFinite(e)&&e>0?e:0}function yK(t){return Math.min($Ne,Math.max(ONe,t))}function q7(t){return Math.round(t*1e3)/1e3}function V7(t){if(t.size<2)return null;const[e,r]=Array.from(t.values());return{distance:Math.hypot(r.x-e.x,r.y-e.y),x:(e.x+r.x)/2,y:(e.y+r.y)/2}}(function(){var C4e;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-sidebar-resize-handle]"),o=document.querySelector("[data-viewer-settings]"),l=document.querySelector("[data-viewer-settings-trigger]"),u=document.querySelector("[data-viewer-settings-menu]"),h=document.querySelector("[data-navigation-mode-toggle]"),d=document.querySelector("[data-theme-custom-fields]"),f=document.querySelector("[data-frontmatter-visibility]"),p=document.querySelector("[data-accessibility-font]"),g=document.querySelector("[data-accessibility-size]"),m=document.querySelector("[data-accessibility-spacing]"),y=document.querySelector("[data-accessibility-motion]"),v=document.querySelector("[data-readable-line-length]"),T=document.querySelector("[data-high-contrast]"),x=document.querySelector("[data-underline-links]"),w=document.querySelector("[data-workspace-rail]"),C=document.querySelector("[data-workspace-scroll-track]"),k=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const S=window.matchMedia("(prefers-reduced-motion: reduce)"),E=window.matchMedia("(max-width: 680px)"),L="openknowledge.viewer.editorOrder",M="openknowledge.viewer.theme",I="openknowledge.viewer.frontmatter",P="openknowledge.viewer.accessibility",$="openknowledge.viewer.navigationMode",_="beside";let R=_;const O=ze(t.dataset.linkPrefix||""),D=Hz(t.dataset.noteRoot||O||window.location.pathname).toString(36),N="openknowledge.viewer.panelWidths."+D,B="openknowledge.viewer.sidebarWidth."+D,F=tCt(),G=Le();let z=ce();const W=Fr(),V=Uwt(W,"path"),H=Hwt(W),te=nn(),Y=rt(),se=["default","night","paper","ocean","rose","custom"],J="night",Z={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},ee={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},re={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},ge={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},ae={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},_e={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let Fe=Promise.resolve(),qe=0,ue=0,de=0;const Ce={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!VCe()},run:function(){const q=VCe();q&&W6(q)}};function me(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function $e(q,K){return q?q.closest?q.closest(K):q.parentElement?q.parentElement.closest(K):null:null}function we(q,K,ie){return Math.min(Math.max(q,K),ie)}function Le(){const q=ke(N);return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}function Ye(){const q=JSON.stringify(G);try{window.localStorage.setItem(N,q)}catch{}U(N,q)}function ce(){const q=ke(B),K=q&&typeof q=="object"?q.width:q;return ir(K)}function ye(){if(!z)return;const q=JSON.stringify(z);try{window.localStorage.setItem(B,q)}catch{}U(B,q)}function ke(q){const K=[le(q),pe(q)];for(const ie of K)if(ie)try{return JSON.parse(ie)}catch{}return null}function le(q){try{return window.localStorage.getItem(q)}catch{return null}}function pe(q){const K=encodeURIComponent(q)+"=",ie=document.cookie?document.cookie.split("; "):[];for(const Te of ie)if(Te.startsWith(K))try{return decodeURIComponent(Te.slice(K.length))}catch{return null}return null}function U(q,K){try{document.cookie=encodeURIComponent(q)+"="+encodeURIComponent(K)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function oe(q){return q==="beside"||q==="replace"?q:_}function Q(){return oe(ke($))}function fe(q){const K=JSON.stringify(oe(q));try{window.localStorage.setItem($,K)}catch{}U($,K)}function j(){return R==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function Be(q){R=oe(q),document.documentElement.dataset.viewerNavigationMode=R,h&&(h.dataset.mode=R,h.setAttribute("aria-pressed",R==="beside"?"true":"false"),h.setAttribute("aria-label","Link behavior: "+(R==="beside"?"Open beside":"Open in current panel")),h.title=j()),r4e()}function Se(q){const K=R==="beside";return q?!K:K}function He(){Be(Q()),!(!h||h.dataset.modeBound==="true")&&(h.dataset.modeBound="true",h.addEventListener("click",function(){const q=R==="beside"?"replace":"beside";fe(q),Be(q)}))}function De(){const q=ke(M);return q&&typeof q=="object"&&!Array.isArray(q)?We(q):We({preset:J,custom:ae})}function We(q){const K=se.includes(q.preset)?q.preset:J,ie=Object.assign({},ae);return Object.keys(ae).forEach(function(Te){Nt(q.custom&&q.custom[Te])&&(ie[Te]=q.custom[Te].toLowerCase())}),{preset:K,custom:ie}}function Ne(q){const K=We(q),ie=JSON.stringify(K);try{window.localStorage.setItem(M,ie)}catch{}U(M,ie)}function Ze(){const q=ke(I);return q&&typeof q=="object"&&!Array.isArray(q)&&typeof q.visible=="boolean"?q.visible:!0}function Pe(q){const K=JSON.stringify({visible:!!q});try{window.localStorage.setItem(I,K)}catch{}U(I,K)}function nt(){const q=ke(P);return q&&typeof q=="object"&&!Array.isArray(q)?Ie(q):Ie(ge)}function Ie(q){const K=q&&typeof q=="object"?q:{};return{font:Object.prototype.hasOwnProperty.call(Z,K.font)?K.font:ge.font,size:Object.prototype.hasOwnProperty.call(ee,K.size)?K.size:ge.size,spacing:Object.prototype.hasOwnProperty.call(re,K.spacing)?K.spacing:ge.spacing,motion:["system","reduced","full"].includes(K.motion)?K.motion:ge.motion,readableLineLength:typeof K.readableLineLength=="boolean"?K.readableLineLength:ge.readableLineLength,highContrast:typeof K.highContrast=="boolean"?K.highContrast:ge.highContrast,underlineLinks:typeof K.underlineLinks=="boolean"?K.underlineLinks:ge.underlineLinks}}function pt(q){const K=Ie(q),ie=JSON.stringify(K);try{window.localStorage.setItem(P,ie)}catch{}U(P,ie)}function Re(q){const K=Ie(q),ie=ee[K.size],Te=re[K.spacing];document.documentElement.dataset.viewerFont=K.font,document.documentElement.dataset.viewerFontSize=K.size,document.documentElement.dataset.viewerMotion=K.motion,document.documentElement.dataset.viewerContrast=K.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=K.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",Z[K.font]),document.documentElement.style.setProperty("--ok-document-font-size",ie.value),document.documentElement.style.setProperty("--ok-document-scale",ie.scale),document.documentElement.style.setProperty("--ok-document-line-height",Te.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",Te.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",K.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",K.highContrast),document.body.classList.toggle("is-links-underlined",K.underlineLinks),kt(K)}function kt(q){p&&(p.value=q.font),g&&(g.value=q.size),m&&(m.value=q.spacing),y&&(y.value=q.motion),v&&(v.checked=q.readableLineLength),T&&(T.checked=q.highContrast),x&&(x.checked=q.underlineLinks)}function bt(){const q=document.documentElement.dataset.viewerMotion||"system";return q==="reduced"||q==="system"&&S.matches}function lt(q){document.body.classList.toggle("is-frontmatter-hidden",!q),f&&(f.checked=q)}function Nt(q){return/^#[0-9a-f]{6}$/i.test(String(q||""))}function Ct(q){const K=Nt(q)?q.slice(1):ae.accent.slice(1);return[parseInt(K.slice(0,2),16),parseInt(K.slice(2,4),16),parseInt(K.slice(4,6),16)]}function dt(q,K,ie){const Te=Ct(q),Ge=Ct(K);return"#"+Te.map(function(Ke,yt){return Math.round(Ke+(Ge[yt]-Ke)*ie)}).map(function(Ke){return Ke.toString(16).padStart(2,"0")}).join("")}function ve(q){return _t(q)>.48?"#121715":"#f3f7f4"}function _t(q){const K=Ct(q);return(.2126*K[0]+.7152*K[1]+.0722*K[2])/255}function gt(q){const K=We(q);document.documentElement.dataset.viewerTheme=K.preset;const ie=K.preset==="custom"&&_t(K.custom.surface)<=.48;document.documentElement.style.colorScheme=K.preset==="night"||ie?"dark":"light",ft(),K.preset==="custom"&&Et(K.custom),Nr(K),fCt()}function ft(){Object.keys(_e).forEach(function(q){_e[q].forEach(function(K){document.documentElement.style.removeProperty(K)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(q){document.documentElement.style.removeProperty(q)})}function Et(q){Object.keys(_e).forEach(function(ie){_e[ie].forEach(function(Te){document.documentElement.style.setProperty(Te,q[ie])})});const K=Ct(q.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",K),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+K+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+K+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+K+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+K+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+K+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+K+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+K+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+Ct(q.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",dt(q.surface,q.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",ve(q.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",dt(q.page,q.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",dt(q.page,q.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",dt(q.page,q.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",dt(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",dt(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+K+", .78)")}function Nr(q){document.querySelectorAll("[data-theme-option]").forEach(function(K){const ie=K.dataset.themeOption===q.preset;K.classList.toggle("is-selected",ie),K.setAttribute("aria-checked",ie?"true":"false")}),d&&(d.hidden=q.preset!=="custom",d.querySelectorAll("[data-theme-custom-value]").forEach(function(K){const ie=K.dataset.themeCustomValue;q.custom[ie]&&(K.value=q.custom[ie])}))}function Ae(){return Math.min(360,Math.max(260,window.innerWidth-24))}function tt(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function ct(q){const K=me();return!!(q&&K.length===1&&K[0]===q)}function Mt(q){return ct(q)?Math.max(Ae(),window.innerWidth-tt()*2):Math.max(Wt(),1180)}function Wt(){return Math.max(Ae(),gr("var(--ok-note-panel-default-width)",650))}function gr(q,K){const ie=document.createElement("div");ie.style.position="absolute",ie.style.left="-10000px",ie.style.top="-10000px",ie.style.visibility="hidden",ie.style.pointerEvents="none",ie.style.width=q,document.body.append(ie);const Te=ie.getBoundingClientRect().width;return ie.remove(),Number.isFinite(Te)&&Te>0?Te:K}function lr(q,K){const ie=Number(q);return Number.isFinite(ie)?Math.round(we(ie,Ae(),Mt(K))):null}function Tr(){return gr("var(--ok-sidebar-min-width)",280)}function fr(){const q=gr("var(--ok-sidebar-max-width)",560);return Math.max(Tr(),Math.min(q,window.innerWidth-320))}function Or(){return gr("var(--ok-sidebar-width)",window.innerWidth*.25)}function ir(q){const K=Number(q);return!Number.isFinite(K)||K<=0?null:Math.round(we(K,Tr(),fr()))}function cr(q){return ir(q)||ir(Or())||Tr()}function Vr(q){const K=cr(q);return document.body.style.setProperty("--ok-sidebar-user-width",K+"px"),s&&(s.setAttribute("aria-valuemin",String(Math.round(Tr()))),s.setAttribute("aria-valuemax",String(Math.round(fr()))),s.setAttribute("aria-valuenow",String(K))),bC(),K}function at(q){return z=cr(q),Vr(z)}function vt(q){return lr(G[q.dataset.notePath],q)}function zt(q){const K=vt(q);if(!K){q.style.removeProperty("--note-panel-width"),delete q.dataset.panelWidth;return}q.style.setProperty("--note-panel-width",K+"px"),q.dataset.panelWidth=String(K)}function br(q){var K;document.body.classList.toggle("is-sidebar-open",q),n&&(n.setAttribute("aria-hidden",q?"false":"true"),n.inert=!q),i&&i.setAttribute("aria-expanded",q?"true":"false"),q&&Bs(((K=Qo())==null?void 0:K.dataset.notePath)||Dl()[0]||"",!0)}function Wr(){br(!document.body.classList.contains("is-sidebar-open"))}function xt(q,K){if(P6())return jwt(q,K);let ie;try{ie=new URL(q,window.location.href)}catch{return null}const Te=Me();if(ie.origin!==window.location.origin||!ie.pathname.startsWith(Te))return null;const Ge=ie.pathname.slice(Te.length)||"index.md";if(!Rt(Ge))return null;try{return decodeURIComponent(Ge)}catch{return Ge}}function ht(q,K){return q+K.split("/").map(encodeURIComponent).join("/")}function Rt(q){return/\.(md|markdown)$/i.test(String(q).split("?")[0].split("#")[0])}function ut(q){return P6()?Ywt(q):ht(Me(),q)}function Kt(q){return ht(Yr(),q)}function Me(){return O+"/file/"}function Yr(){return O+"/api/file/"}function ze(q){const K=String(q||"").replace(/\/+$/,"");return K?K.startsWith("/")?K:"/"+K:""}function Fr(){var ie;const q=(ie=window.OpenKnowledgeStaticData)==null?void 0:ie.notes;if(Array.isArray(q))return q;const K=document.querySelector("[data-static-notes]");if(!K)return[];try{const Te=JSON.parse(K.textContent||"[]");return Array.isArray(Te)?Te:[]}catch{return[]}}function nn(){const q=new Set;return W.forEach(function(K){K.path&&q.add(K.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(K){K.dataset.treePath&&q.add(K.dataset.treePath)}),q}function _i(){document.querySelectorAll(".knowledge-tree").forEach(function(q){if(q.dataset.treePrepared==="true")return;q.dataset.treePrepared="true";const K=[];Array.from(q.querySelectorAll(".tree-row")).forEach(function(ie){var yt;const Te=ln(ie);for(;K.length&&K[K.length-1].indent>=Te;)K.pop();if(ie.dataset.treeParentPath=((yt=K[K.length-1])==null?void 0:yt.path)||"",!ie.classList.contains("tree-directory"))return;const Ge=String(ie.textContent||"").trim(),Xe=K.concat([{name:Ge}]).map(function(wt){return wt.name}).join("/");ie.dataset.treeDirectoryPath=Xe,ie.setAttribute("aria-expanded","false"),ie.tabIndex=0,ie.title="Expand "+Xe;const Ke=F6("chevron-down","tree-directory-icon");Ke.setAttribute("aria-hidden","true"),ie.prepend(Ke),ie.addEventListener("click",function(){cn(ie,ie.getAttribute("aria-expanded")!=="true")}),ie.addEventListener("keydown",function(wt){if(wt.key==="ArrowRight"){wt.preventDefault(),cn(ie,!0);return}if(wt.key==="ArrowLeft"){wt.preventDefault(),cn(ie,!1);return}(wt.key==="Enter"||wt.key===" ")&&(wt.preventDefault(),cn(ie,ie.getAttribute("aria-expanded")!=="true"))}),K.push({indent:Te,name:Ge,path:Xe})}),Xr(q)}),io()}function ln(q){const K=q.style.getPropertyValue("--indent"),ie=parseFloat(K);return Number.isFinite(ie)?ie:0}function cn(q,K){q.setAttribute("aria-expanded",K?"true":"false"),q.title=(K?"Collapse ":"Expand ")+q.dataset.treeDirectoryPath;const ie=q.closest(".knowledge-tree");ie&&Xr(ie)}function Xr(q){const K=Object.create(null);q.querySelectorAll("[data-tree-directory-path]").forEach(function(ie){K[ie.dataset.treeDirectoryPath]=ie}),q.querySelectorAll(".tree-row").forEach(function(ie){const Ge=(ie.dataset.treeParentPath||"").split("/").filter(Boolean);let Xe="",Ke=!1;Ge.forEach(function(yt){Xe=Xe?Xe+"/"+yt:yt;const wt=K[Xe];wt&&wt.getAttribute("aria-expanded")!=="true"&&(Ke=!0)}),ie.hidden=Ke})}function Ea(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(q){q.setAttribute("aria-expanded","false"),q.title="Expand "+q.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(Xr)}function Bs(q,K){const ie=String(q||""),Te=ie.split("/").slice(0,-1),Ge=new Set;if(Te.forEach(function(Xe,Ke){Ge.add(Te.slice(0,Ke+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Xe){Xe.querySelectorAll("[data-tree-directory-path]").forEach(function(Ke){Ge.has(Ke.dataset.treeDirectoryPath)&&(Ke.setAttribute("aria-expanded","true"),Ke.title="Collapse "+Ke.dataset.treeDirectoryPath)}),Xe.querySelectorAll("[data-tree-path]").forEach(function(Ke){const yt=Ke.dataset.treePath===ie;Ke.classList.toggle("is-current-file",yt),yt?(Ke.setAttribute("aria-current","page"),Ke.title=Ke.dataset.treePath):(Ke.removeAttribute("aria-current"),Ke.title=j())}),Xr(Xe)}),K&&n){const Xe=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(Ke){return Ke.dataset.treePath===ie});Xe&&window.requestAnimationFrame(function(){Xe.scrollIntoView({block:"center",behavior:bt()?"auto":"smooth"})})}}function io(){const q=n==null?void 0:n.querySelector(".file-sidebar-head"),K=q==null?void 0:q.querySelector("[data-sidebar-close]");if(!q||!K||q.querySelector("[data-sidebar-collapse]"))return;const ie=document.createElement("div");ie.className="file-sidebar-actions";const Te=document.createElement("button");Te.type="button",Te.className="file-sidebar-collapse",Te.dataset.sidebarCollapse="",Te.textContent="Collapse all",Te.addEventListener("click",Ea),K.before(ie),ie.append(Te,K)}function Oc(q){const K=q.join("/");return[K+"/index.md",K+"/index.markdown"].find(function(ie){return te.has(ie)})||""}function Bt(q){const K=String(q||"index.md"),ie=K.split("/").filter(Boolean),Te=ie[ie.length-1]||"index.md",Ge=/^index\.(md|markdown)$/i.test(Te)&&ie.length>1,Xe=Ge?ie.slice(0,-1):ie,Ke=document.createElement("nav");return Ke.className="note-path note-breadcrumbs",Ke.dataset.noteBreadcrumbs="",Ke.dataset.breadcrumbsReady="true",Ke.dataset.notePathValue=K,Ke.setAttribute("aria-label","Note path"),Ke.title=K,Xe.forEach(function(yt,wt){if(wt>0){const ur=document.createElement("span");ur.className="note-breadcrumb-separator",ur.setAttribute("aria-hidden","true"),ur.textContent="/",Ke.append(ur)}const Lt=wt===Xe.length-1,Zt=Oc(Xe.slice(0,wt+1)),ar=Lt?K:Zt,qt=Lt&&!Ge?yt.replace(/\.(md|markdown)$/i,""):yt;if(ar){const ur=document.createElement("a");ur.className="note-breadcrumb-link"+(Lt?" note-breadcrumb-current":""),ur.href=ut(ar),ur.dataset.directLink="true",ur.textContent=qt,Lt&&ur.setAttribute("aria-current","page"),Ke.append(ur);return}const Xt=document.createElement("span");Xt.className="note-breadcrumb-label",Xt.textContent=qt,Ke.append(Xt)}),Ke}function Oe(q){const K=q.querySelector("[data-note-breadcrumbs], .note-path");!K||K.dataset.breadcrumbsReady==="true"||K.replaceWith(Bt(q.dataset.notePath))}function rt(){var ie;const q=(ie=window.OpenKnowledgeStaticData)==null?void 0:ie.graph;if(q)return{nodes:Array.isArray(q.nodes)?q.nodes:[],edges:Array.isArray(q.edges)?q.edges:[]};const K=document.querySelector("[data-knowledge-graph]");if(!K)return{nodes:[],edges:[]};try{const Te=JSON.parse(K.textContent||"{}");return{nodes:Array.isArray(Te.nodes)?Te.nodes:[],edges:Array.isArray(Te.edges)?Te.edges:[]}}catch{return{nodes:[],edges:[]}}}function St(){const q=document.querySelector("[data-knowledge-graph-view]"),K=document.querySelector("[data-knowledge-graph-sidebar]");if(!q)return;q.replaceChildren(),K==null||K.replaceChildren();const ie=document.createElement("div");ie.className="knowledge-graph-info";const Te=document.createElement("h2");Te.textContent="Knowledge graph";const Ge=document.createElement("p");Ge.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Xe=document.createElement("p");if(Xe.className="knowledge-graph-status",Xe.dataset.knowledgeGraphStatus="",Xe.setAttribute("aria-live","polite"),Xe.textContent=Y.nodes.length?Y.nodes.length+(Y.nodes.length===1?" note":" notes"):"No notes",ie.append(Te,Ge,Xe),(K||q).append(ie),!Y.nodes.length){const Zt=document.createElement("p");Zt.className="empty",Zt.textContent="No Markdown files found.",q.append(Zt);return}const Ke=900,yt=640,wt=Wwt(Y.nodes),Ot=Pwt(Y,Ke,yt,wt),Lt=document.createElement("canvas");Lt.className="knowledge-graph-canvas",Lt.dataset.knowledgeGraphCanvas="true",Lt.width=Ke,Lt.height=yt,Lt.tabIndex=0,Lt.setAttribute("role","img"),Lt.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),q.append(Lt),Ut(Lt,Y,Ot,wt,Ke,yt,Xe).start()}function Ut(q,K,ie,Te,Ge,Xe,Ke){const yt=q.getContext("2d"),wt=Object.create(null);K.nodes.forEach(function(hr){hr&&typeof hr.path=="string"&&(wt[hr.path]=!0)});const Ot=K.edges.filter(function(hr){return hr&&wt[hr.source]&&wt[hr.target]&&ie[hr.source]&&ie[hr.target]}),Lt=K.nodes.filter(function(hr){return hr&&typeof hr.path=="string"&&ie[hr.path]}).map(function(hr){const In=ie[hr.path],Pc=MCe(hr,Te);return{node:hr,path:hr.path,label:Pc,fullLabel:DCe(hr,Te),radius:hr.path==="index.md"?16:10,labelOffset:hr.path==="index.md"?31:25,baseX:In.x,baseY:In.y,x:In.x,y:In.y,z:0,vx:0,vy:0}}),Zt=Object.create(null);Lt.forEach(function(hr){Zt[hr.path]=hr});let ar="",qt=Lt.findIndex(function(hr){return hr.path==="index.md"});qt<0&&(qt=0);let Xt=null,ur=0;const Br=function(hr){const In=hr&&Zt[hr]?hr:"";if(In!==ar)if(ar=In,q.dataset.activeGraphPath=ar,q.style.cursor=ar?"pointer":"default",ar){const Pc=Lt.findIndex(function(H6){return H6.path===ar});Pc>=0&&(qt=Pc);const SC=Zt[ar],S4e=Ot.filter(function(H6){return H6.source===ar||H6.target===ar}).length,k4e=S4e+(S4e===1?" connection":" connections");Ke&&(Ke.textContent=SC.fullLabel+" · "+k4e+" · Enter to open"),q.setAttribute("aria-label","Selected "+SC.fullLabel+" with "+k4e+". Use arrow keys to move and Enter to open.")}else Ke&&(Ke.textContent=K.nodes.length+(K.nodes.length===1?" note":" notes")),q.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},On=function(){const hr=Math.max(1,Math.min(window.devicePixelRatio||1,2));q.width=Math.round(Ge*hr),q.height=Math.round(Xe*hr),yt.setTransform(hr,0,0,hr,0,0)},Fn=function(hr){const In=q.getBoundingClientRect();return!In.width||!In.height?{x:0,y:0}:{x:(hr.clientX-In.left)*(Ge/In.width),y:(hr.clientY-In.top)*(Xe/In.height)}},Bi=function(hr){Xt=hr;const In=Aa(Lt,hr);Br(In?In.path:"")};q.addEventListener("pointermove",function(hr){Bi(Fn(hr))}),q.addEventListener("pointerleave",function(){Xt=null,document.activeElement!==q&&Br("")}),q.addEventListener("click",function(hr){const In=Aa(Lt,Fn(hr));In&&a0(In.path,!0,Se(!1))}),q.addEventListener("focus",function(){Lt[qt]&&Br(Lt[qt].path)}),q.addEventListener("blur",function(){Br(Xt?ar:"")}),q.addEventListener("keydown",function(hr){if(!Lt.length)return;if(hr.key==="Enter"||hr.key===" "){ar&&(hr.preventDefault(),a0(ar,!0,Se(!1)));return}if(hr.key!=="ArrowRight"&&hr.key!=="ArrowDown"&&hr.key!=="ArrowLeft"&&hr.key!=="ArrowUp")return;hr.preventDefault();const In=hr.key==="ArrowRight"||hr.key==="ArrowDown"?1:-1;qt=(qt+In+Lt.length)%Lt.length,Br(Lt[qt].path)});const Ol=function(){q.isConnected&&(ur=window.requestAnimationFrame(Ol),er(Lt,Ot,Zt,ar,Ge,Xe),Nn(yt,Lt,Ot,Zt,ar,Ge,Xe))};return{start:function(){yt&&(On(),Nn(yt,Lt,Ot,Zt,ar,Ge,Xe),ur=window.requestAnimationFrame(Ol))},stop:function(){ur&&window.cancelAnimationFrame(ur)}}}function er(q,K,ie,Te,Ge,Xe){const Ke=Te?ie[Te]:null;q.forEach(function(wt){const Ot=wt===Ke?1:0,Lt=wt===Ke?.052:.034;wt.vx+=(wt.baseX-wt.x)*Lt,wt.vy+=(wt.baseY-wt.y)*Lt,wt.z+=(Ot-wt.z)*.095});const yt=Ke?xr(Ke.z):0;K.forEach(function(wt){const Ot=ie[wt.source],Lt=ie[wt.target];if(!Ot||!Lt)return;const Zt=Lt.x-Ot.x||.01,ar=Lt.y-Ot.y||.01,qt=Math.max(1,Math.sqrt(Zt*Zt+ar*ar)),Xt=Ke&&(wt.source===Ke.path||wt.target===Ke.path),ur=104+(Xt?28*yt:0),Br=(qt-ur)*(Xt?.0015:.0011),On=Zt/qt,Fn=ar/qt;Ot.vx+=On*Br,Ot.vy+=Fn*Br,Lt.vx-=On*Br,Lt.vy-=Fn*Br});for(let wt=0;wt.02){const wt=bn(Ke,Ke.fullLabel);q.forEach(function(Ot){if(Ot===Ke)return;const Lt=Uz(wt,bn(Ot,Ot.label));if(!Lt)return;const Zt=Ot.x-Ke.x||.01,ar=Ot.y-Ke.y||.01,qt=Math.max(1,Math.sqrt(Zt*Zt+ar*ar)),Xt=Math.min(3.2,(Math.max(Lt.x,Lt.y)*.026+.8)*yt);Ot.vx+=Zt/qt*Xt,Ot.vy+=ar/qt*Xt})}q.forEach(function(wt){wt.x+=wt.vx,wt.y+=wt.vy,dC(wt,Ge,Xe),Dn(wt,Ke?5.5:4.2);const Ot=Ke?.58:.66;wt.vx*=Ot,wt.vy*=Ot,Math.abs(wt.vx)<.018&&(wt.vx=0),Math.abs(wt.vy)<.018&&(wt.vy=0)})}function xr(q){const K=we(q,0,1);return K*K*(3-2*K)}function Dn(q,K){const ie=Math.sqrt(q.vx*q.vx+q.vy*q.vy);if(ie<=K||ie<=0)return;const Te=K/ie;q.vx*=Te,q.vy*=Te}function Nn(q,K,ie,Te,Ge,Xe,Ke){const yt=Ge?Te[Ge]:null,wt=os();q.clearRect(0,0,Xe,Ke),q.lineCap="round",q.lineJoin="round",ie.forEach(function(Ot){const Lt=Te[Ot.source],Zt=Te[Ot.target];if(!Lt||!Zt)return;const ar=yt&&(Ot.source===yt.path||Ot.target===yt.path);q.beginPath(),q.moveTo(Lt.x,Lt.y),q.lineTo(Zt.x,Zt.y),q.strokeStyle=ar?wt.edgeActive:yt?wt.edgeMuted:wt.edge,q.lineWidth=ar?2.35:1.05,q.stroke()}),K.slice().sort(function(Ot,Lt){return Ot.z-Lt.z}).forEach(function(Ot){const Lt=Ot===yt,Zt=1+Ot.z*.22,ar=Ot.radius*Zt,qt=Lt?Ot.fullLabel:Ot.label;q.save(),q.globalAlpha=1,q.beginPath(),q.arc(Ot.x,Ot.y-Ot.z*6,ar,0,Math.PI*2),q.fillStyle=wt.nodeBg,q.fill(),q.strokeStyle=Lt?wt.nodeActiveBorder:wt.nodeBorder,q.lineWidth=Lt?3:Ot.path==="index.md"?2:1.55,q.stroke(),q.font=(Lt?"600 13px":"400 12px")+" "+wt.fontBody,q.textBaseline="middle",q.textAlign=$wt(Ot.x,K2(qt),Xe);const Xt=q.textAlign==="start"?Math.max(16,Ot.x-K2(qt)/2):q.textAlign==="end"?Math.min(Xe-16,Ot.x+K2(qt)/2):Ot.x,ur=Ot.y+Ot.labelOffset+Ot.z*4;q.fillStyle=Lt?wt.labelActive:wt.label,q.fillText(qt,Xt,ur),q.restore()})}function os(){const q=document.documentElement.dataset.viewerContrast==="high";return{fontBody:fn("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:q?fn("--ok-color-text","#202322"):fn("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:q?fn("--ok-color-muted","#707773"):fn("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:fn("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:fn("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:q?fn("--ok-color-text","#202322"):fn("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:fn("--ok-color-graph-node-active-border","#0f7a4d"),label:q?fn("--ok-color-text","#202322"):fn("--ok-color-graph-label","#5f6b66"),labelActive:q?fn("--ok-color-text","#202322"):fn("--ok-color-graph-label-active","#26302c")}}function fn(q,K){return getComputedStyle(document.documentElement).getPropertyValue(q).trim()||K}function Aa(q,K){for(let ie=q.length-1;ie>=0;ie-=1){const Te=q[ie],Ge=K.x-Te.x,Xe=K.y-Te.y,Ke=Te.radius*(1+Te.z*.22)+6;if(Ge*Ge+Xe*Xe<=Ke*Ke||Owt(K,bn(Te,Te.z>.6?Te.fullLabel:Te.label)))return Te}return null}function bn(q,K){const ie=K2(K),Te=q.y+q.labelOffset-10,Ge=Math.max(q.radius+8,ie/2+9);return{left:q.x-Ge,right:q.x+Ge,top:Math.min(q.y-q.radius-8,Te),bottom:Math.max(q.y+q.radius+8,Te+22)}}function Owt(q,K){return q.x>=K.left&&q.x<=K.right&&q.y>=K.top&&q.y<=K.bottom}function $wt(q,K,ie){return q-K/2<16?"start":q+K/2>ie-16?"end":"center"}function Pwt(q,K,ie,Te){const Ge=q.nodes.filter(function(qt){return qt&&typeof qt.path=="string"&&qt.path.length>0}),Xe=Object.create(null);if(Ge.length===0)return Xe;if(Ge.length===1)return Xe[Ge[0].path]={x:K/2,y:ie/2},Xe;const Ke={x:K/2,y:ie/2},yt=Object.create(null),wt=Object.create(null);Ge.forEach(function(qt){yt[qt.path]=!0,wt[qt.path]=0});const Ot=[];q.edges.forEach(function(qt){!qt||!yt[qt.source]||!yt[qt.target]||(Ot.push(qt),wt[qt.source]+=1,wt[qt.target]+=1)});const Lt=Bwt(Ge,K,ie),Zt=Ge.map(function(qt){const Xt=LCe(qt.path),ur=Lt[Xt]||Ke,Br=Hz(qt.path),On=Br%360/360*Math.PI*2,Fn=26+Br%74;return{node:qt,group:Xt,label:MCe(qt,Te),radius:qt.path==="index.md"?16:10,x:ur.x+Math.cos(On)*Fn,y:ur.y+Math.sin(On)*Fn,vx:0,vy:0}}),ar=Object.create(null);Zt.forEach(function(qt){ar[qt.node.path]=qt});for(let qt=0;qt<220;qt+=1){for(let Xt=0;Xt0?.006:.018;Xt.vx+=(Ke.x-Xt.x)*On,Xt.vy+=(Ke.y-Xt.y)*On,Xt.vx+=(ur.x-Xt.x)*Fn,Xt.vy+=(ur.y-Xt.y)*Fn,Xt.x+=Xt.vx,Xt.y+=Xt.vy,dC(Xt,K,ie),Xt.vx*=.62,Xt.vy*=.62})}return Fwt(Zt,K,ie),Gwt(Zt,K,ie),Zt.forEach(function(qt){Xe[qt.node.path]={x:qt.x,y:qt.y}}),Xe}function Bwt(q,K,ie){const Te=Object.create(null);q.forEach(function(Lt){const Zt=LCe(Lt.path);Te[Zt]=(Te[Zt]||0)+1});const Ge=Object.keys(Te).sort(function(Lt,Zt){return Te[Zt]===Te[Lt]?Lt.localeCompare(Zt):Te[Zt]-Te[Lt]}),Xe=Object.create(null);if(Ge.length===0)return Xe;const Ke=Math.max(1,Math.ceil(Math.sqrt(Ge.length*(K/ie)))),yt=Math.max(1,Math.ceil(Ge.length/Ke)),wt=K/Ke,Ot=ie/yt;return Ge.forEach(function(Lt,Zt){const ar=Zt%Ke,qt=Math.floor(Zt/Ke),Xt=Hz(Lt),ur=(Xt%31-15)*.9,Br=((Xt>>5)%31-15)*.9;Xe[Lt]={x:wt*(ar+.5)+ur,y:Ot*(qt+.5)+Br}}),Xe}function LCe(q){const K=$6(q);return K.length<=1?".":K.length>=3?K.slice(0,2).join("/"):K[0]}function Fwt(q,K,ie){let Te=1/0,Ge=-1/0,Xe=1/0,Ke=-1/0;q.forEach(function(Br){Te=Math.min(Te,Br.x),Ge=Math.max(Ge,Br.x),Xe=Math.min(Xe,Br.y),Ke=Math.max(Ke,Br.y)});const yt=74,wt=58,Ot=Math.max(1,Ge-Te),Lt=Math.max(1,Ke-Xe),Zt=Math.min((K-yt*2)/Ot,(ie-wt*2)/Lt,1.28),ar=(Te+Ge)/2,qt=(Xe+Ke)/2,Xt=K/2,ur=ie/2;q.forEach(function(Br){Br.x=we(Xt+(Br.x-ar)*Zt,yt,K-yt),Br.y=we(ur+(Br.y-qt)*Zt,wt,ie-wt),dC(Br,K,ie)})}function zwt(q,K){const ie=q.map(Vz);for(let Te=0;TeK-14&&(q.x-=Te.right-(K-14)),Te.top<18&&(q.y+=18-Te.top),Te.bottom>ie-18&&(q.y-=Te.bottom-(ie-18))}function Hz(q){let K=2166136261;const ie=String(q||"");for(let Te=0;Te>>0}function Wwt(q){const K=Object.create(null);q.forEach(function(Te){if(!Te||typeof Te.path!="string")return;const Ge=ICe(Te);K[Ge]||(K[Ge]=[]),K[Ge].push(Te)});const ie=Object.create(null);return Object.keys(K).forEach(function(Te){const Ge=K[Te];if(Ge.length===1){ie[Ge[0].path]=Te;return}const Xe=Ge.map(function(Ke){return Ke.path});Ge.forEach(function(Ke){ie[Ke.path]=Vwt(Ke.path,Xe)})}),ie}function ICe(q){const K=String(q.title||"").trim();return K&&K.toLowerCase()!=="index"?K:qwt(q.path)}function qwt(q){const K=$6(q);if(K.length===0)return String(q||"");const ie=K[K.length-1];return ie.toLowerCase()==="index"&&K.length>1?K.slice(-2).join("/"):ie}function Vwt(q,K){const ie=$6(q);for(let Te=1;Te<=ie.length;Te+=1){const Ge=ie.slice(-Te).join("/");if(K.every(function(Ke){return Ke===q||$6(Ke).slice(-Te).join("/")!==Ge}))return Ge}return ie.join("/")||String(q||"")}function $6(q){return String(q||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function MCe(q,K){const ie=DCe(q,K);return ie.length>22?ie.slice(0,21)+"...":ie}function DCe(q,K){return K[q.path]||ICe(q)}function Uwt(q,K){const ie=Object.create(null);return q.forEach(function(Te){Te&&typeof Te[K]=="string"&&(ie[Te[K]]=Te)}),ie}function Hwt(q){const K=Object.create(null);return q.forEach(function(ie){ie&&typeof ie.htmlPath=="string"&&typeof ie.path=="string"&&NCe(ie.htmlPath).forEach(function(Te){K[Te]===void 0&&(K[Te]=ie.path)})}),K}function P6(){return W.length>0}function B6(q){const K=String(q).lastIndexOf(".");return K<0?Cd(q+"/index.html"):Cd(q.slice(0,K)+".html")}function NCe(q){const K=Cd(q),ie=[];if(fC(ie,K),/\.html$/i.test(K)){const Te=K.slice(0,-5);fC(ie,Te),/\/index\.html$/i.test(K)?fC(ie,K.slice(0,K.length-10)):/^index\.html$/i.test(K)&&fC(ie,"")}return ie.slice().forEach(function(Te){fC(ie,Te.toLowerCase())}),ie}function fC(q,K){const ie=Cd(K);q.includes(ie)||q.push(ie)}function Ywt(q){var Xe;const K=Dl()[0]||((Xe=document.querySelector("[data-note-path]"))==null?void 0:Xe.dataset.notePath)||"index.md",ie=B6(K),Te=B6(q),Ge=ie.includes("/")?ie.slice(0,ie.lastIndexOf("/")+1):"";return Xwt(Ge,Te)}function Xwt(q,K){const ie=Cd(q).split("/").filter(Boolean),Te=Cd(K).split("/").filter(Boolean);for(;ie.length&&Te.length&&ie[0]===Te[0];)ie.shift(),Te.shift();return ie.map(function(){return".."}).concat(Te).join("/")||"."}function Cd(q){const K=String(q||"").replace(/\\/g,"/").split("/"),ie=[];return K.forEach(function(Te){if(!(!Te||Te===".")){if(Te===".."){ie.pop();return}ie.push(Te)}}),ie.join("/")}function jwt(q,K){const ie=String(q||"").trim();if(!ie||ie.startsWith("#"))return null;const Te=ie.split("#")[0].split("?")[0];if(!Te)return K||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(Te)&&!Te.startsWith("/")){const Xe=B6(K||Dl()[0]||"index.md"),Ke=Xe.includes("/")?Xe.slice(0,Xe.lastIndexOf("/")+1):"";return OCe(Ke+Te)}let Ge;try{Ge=new URL(Te,window.location.href)}catch{return null}return Ge.origin!==window.location.origin?null:OCe(Kwt(Ge))}function OCe(q){const K=Cd(q);return H[K]||H[K.toLowerCase()]||null}function Kwt(q){var Xe;const K=((Xe=document.querySelector("[data-note-path]"))==null?void 0:Xe.dataset.notePath)||Dl()[0]||"index.md";let ie=$Ce(window.location.pathname),Te=$Ce(q.pathname);const Ge=Zwt(ie,K);return Ge&&Te.toLowerCase().startsWith(Ge.toLowerCase())&&(Te=Te.slice(Ge.length)),Cd(Te)}function Zwt(q,K){const ie=String(q||"").toLowerCase(),Te=NCe(B6(K)).filter(Boolean).sort(function(Ge,Xe){return Xe.length-Ge.length});for(const Ge of Te){const Xe=["/"+Ge,"/"+Ge+"/"];for(const Ke of Xe)if(ie.endsWith(Ke.toLowerCase()))return q.slice(0,q.length-Ke.length+1)}return q.slice(0,q.lastIndexOf("/")+1)}function $Ce(q){try{return decodeURIComponent(q||"")}catch{return q||""}}function Qwt(q){const K=t.dataset.noteRoot||"",ie=K.includes("\\")?"\\":"/",Te=K.replace(/[\\/]+$/,""),Ge=String(q||"").split("/").join(ie);return Te?Te+ie+Ge:Ge}function PCe(q){const K=String(q||"").replace(/\\/g,"/");return(K.startsWith("/")?"/":"")+K.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function Jwt(q){const K=PCe(q);return"file://"+(K.startsWith("/")?"":"/")+K}function eCt(q,K){const ie=Qwt(K),Te=PCe(ie),Ge=Te.startsWith("/")?Te:"/"+Te,Xe=Jwt(ie);switch(q.id){case"code":return"vscode://file"+Ge;case"cursor":return"cursor://file"+Ge;case"windsurf":return"windsurf://file"+Ge;case"zed":return"zed://file"+Ge;case"obsidian":return"obsidian://open?path="+encodeURIComponent(ie);case"sublime":return"sublime://open?url="+encodeURIComponent(Xe);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Xe);case"nova":return"nova://open?path="+encodeURIComponent(ie);case"intellij":return"idea://open?file="+encodeURIComponent(ie);case"webstorm":return"webstorm://open?file="+encodeURIComponent(ie);default:return Xe}}function tCt(){var Te;const q=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],K=(Te=window.OpenKnowledgeStaticData)==null?void 0:Te.editors;if(Array.isArray(K)&&K.length)return K;const ie=document.querySelector("[data-editor-options]");if(!ie)return q;try{const Ge=JSON.parse(ie.textContent||"[]");return Array.isArray(Ge)&&Ge.length?Ge:q}catch{return q}}function rCt(q){return F.find(function(K){return K.id===q})||F[0]}function BCe(q){return q.short||q.name.slice(0,2)}function FCe(q,K){if(q.replaceChildren(),q.dataset.hasIcon=K.icon?"true":"false",!K.icon){q.textContent=BCe(K);return}const ie=document.createElement("img");ie.className="editor-icon",ie.src=K.icon,ie.alt="",ie.decoding="async",ie.draggable=!1,ie.addEventListener("error",function(){q.dataset.hasIcon="false",q.replaceChildren(),q.textContent=BCe(K)},{once:!0}),q.append(ie)}function F6(q,K){const ie=document.createElementNS("http://www.w3.org/2000/svg","svg");if(ie.setAttribute("class",K+" control-icon"),ie.setAttribute("data-icon",q),ie.setAttribute("viewBox","0 0 24 24"),ie.setAttribute("aria-hidden","true"),q==="chevron-down"){const Xe=document.createElementNS("http://www.w3.org/2000/svg","path");return Xe.setAttribute("d","m6 9 6 6 6-6"),ie.append(Xe),ie}if(q==="github"){const Xe=document.createElementNS("http://www.w3.org/2000/svg","path");return Xe.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),ie.append(Xe),ie}const Te=document.createElementNS("http://www.w3.org/2000/svg","path");Te.setAttribute("d","M18 6 6 18");const Ge=document.createElementNS("http://www.w3.org/2000/svg","path");return Ge.setAttribute("d","m6 6 12 12"),ie.append(Te,Ge),ie}function zCe(){let q=[];try{q=JSON.parse(window.localStorage.getItem(L)||"[]")}catch{q=[]}Array.isArray(q)||(q=[]);const K=new Set(F.map(function(Te){return Te.id})),ie=q.filter(function(Te,Ge){return typeof Te=="string"&&K.has(Te)&&q.indexOf(Te)===Ge});return F.forEach(function(Te){ie.includes(Te.id)||ie.push(Te.id)}),ie}function nCt(){return zCe().map(rCt).filter(Boolean)}function GCe(q){const K=[q].concat(zCe().filter(function(ie){return ie!==q}));try{window.localStorage.setItem(L,JSON.stringify(K))}catch{return}}function iCt(){const q=document.createElement("div");q.className="editor-picker",q.dataset.editorPicker="";const K=document.createElement("div");K.className="editor-trigger",K.dataset.editorTrigger="",K.setAttribute("role","group");const ie=document.createElement("a");ie.className="editor-open",ie.href="#",ie.dataset.editorOpen="",ie.dataset.directLink="true",ie.title="Open in editor";const Te=document.createElement("span");Te.className="editor-mark",Te.dataset.editorMark="",Te.setAttribute("aria-hidden","true"),Te.textContent="--",ie.append(Te);const Ge=document.createElement("button");Ge.className="editor-menu-trigger",Ge.type="button",Ge.dataset.editorMenuTrigger="",Ge.setAttribute("aria-haspopup","menu"),Ge.setAttribute("aria-expanded","false"),Ge.setAttribute("aria-label","Choose editor"),Ge.title="Choose editor",Ge.append(F6("chevron-down","editor-caret")),K.append(ie,Ge);const Xe=document.createElement("div");return Xe.className="editor-menu",Xe.dataset.editorMenu="",Xe.hidden=!0,Xe.setAttribute("role","menu"),q.append(K,Xe),q}function aCt(q,K){if(!K)return null;const ie=document.createElement("a");return ie.className="source-open",ie.href=K,ie.dataset.sourceOpen="",ie.dataset.directLink="true",ie.target="_blank",ie.rel="noreferrer",ie.title="Open on GitHub",ie.setAttribute("aria-label","Open "+q+" on GitHub"),ie.append(F6("github","source-icon")),ie}function Yz(q){const K=q.querySelector("[data-editor-trigger]"),ie=q.querySelector("[data-editor-open]"),Te=q.querySelector("[data-editor-menu-trigger]"),Ge=q.querySelector("[data-editor-mark]"),Xe=q.querySelector("[data-editor-menu]"),Ke=nCt(),yt=Ke[0],wt=q.closest("[data-note-path]"),Ot=(wt==null?void 0:wt.dataset.notePath)||"";if(!(!K||!ie||!Te||!Ge||!Xe||!yt||!Ot)){if(FCe(Ge,yt),K.setAttribute("aria-label","Editor: "+yt.name),ie.href=eCt(yt,Ot),ie.title="Open "+Ot+" in "+yt.name,ie.setAttribute("aria-label","Open "+Ot+" in "+yt.name),Te.title="Choose editor",Te.setAttribute("aria-label","Choose editor for "+Ot),q.dataset.primaryEditor=yt.id,Xe.replaceChildren(),WCe(Xe,yt,!0),Ke.length>1){const Lt=document.createElement("div");Lt.className="editor-menu-separator",Lt.setAttribute("role","separator"),Xe.append(Lt)}Ke.slice(1).forEach(function(Lt){WCe(Xe,Lt,!1)})}}function WCe(q,K,ie){const Te=document.createElement("button");Te.className="editor-menu-item"+(ie?" is-selected":""),Te.type="button",Te.dataset.editorOption=K.id,Te.setAttribute("role","menuitemradio"),Te.setAttribute("aria-checked",ie?"true":"false");const Ge=document.createElement("span");Ge.className="editor-option-mark",FCe(Ge,K);const Xe=document.createElement("span");Xe.className="editor-option-label",Xe.textContent=K.name,Te.append(Ge,Xe),q.append(Te)}function qCe(){document.querySelectorAll("[data-editor-picker]").forEach(Yz)}function pC(q,K){const ie=q.querySelector("[data-editor-menu-trigger]"),Te=q.querySelector("[data-editor-menu]");!ie||!Te||(K&&(gC(q),Yz(q)),Te.hidden=!K,ie.setAttribute("aria-expanded",K?"true":"false"))}function gC(q){document.querySelectorAll("[data-editor-picker]").forEach(function(K){K!==q&&pC(K,!1)})}function mC(q){!l||!u||(u.hidden=!q,l.setAttribute("aria-expanded",q?"true":"false"))}function sCt(){if(!u)return null;const q=u.querySelector("[data-settings-reset]");if(q)return q;const K=document.createElement("div");K.className="viewer-settings-footer";const ie=document.createElement("button");return ie.type="button",ie.className="viewer-settings-reset",ie.dataset.settingsReset="",ie.textContent="Reset to defaults",K.append(ie),u.append(K),ie}function oCt(){if(!o||!l||!u||o.dataset.settingsBound==="true")return;o.dataset.settingsBound="true";let q=De(),K=Ze(),ie=nt();gt(q),lt(K),Re(ie);const Te=sCt();Te&&Te.addEventListener("click",function(){q=We({preset:J,custom:ae}),K=!0,ie=Ie(ge),R=_,Ne(q),Pe(K),pt(ie),fe(R),gt(q),lt(K),Re(ie),Be(R)}),l.addEventListener("click",function(Xe){Xe.preventDefault(),Xe.stopPropagation(),mC(u.hidden)}),l.addEventListener("keydown",function(Xe){if(Xe.key!=="ArrowDown"&&Xe.key!=="Enter"&&Xe.key!==" ")return;Xe.preventDefault(),mC(!0);const Ke=u.querySelector("[data-theme-option].is-selected")||u.querySelector("[data-theme-option]");Ke&&Ke.focus()}),u.addEventListener("click",function(Xe){const Ke=$e(Xe.target,"[data-theme-option]");Ke&&(Xe.preventDefault(),q=We({preset:Ke.dataset.themeOption,custom:q.custom}),Ne(q),gt(q))}),u.addEventListener("keydown",function(Xe){if(Xe.key==="Escape"){Xe.preventDefault(),mC(!1),l.focus();return}if(Xe.key!=="Enter"&&Xe.key!==" ")return;const Ke=$e(Xe.target,"[data-theme-option]");Ke&&(Xe.preventDefault(),q=We({preset:Ke.dataset.themeOption,custom:q.custom}),Ne(q),gt(q))}),u.querySelectorAll("[data-theme-custom-value]").forEach(function(Xe){Xe.addEventListener("input",function(){const Ke=Xe.dataset.themeCustomValue;if(!ae[Ke]||!Nt(Xe.value))return;const yt=Object.assign({},q.custom);yt[Ke]=Xe.value.toLowerCase(),q=We({preset:"custom",custom:yt}),Ne(q),gt(q)})}),f&&f.addEventListener("change",function(){K=f.checked,Pe(K),lt(K)});function Ge(Xe,Ke){ie=Ie(Object.assign({},ie,{[Xe]:Ke})),pt(ie),Re(ie)}p&&p.addEventListener("change",function(){Ge("font",p.value)}),g&&g.addEventListener("change",function(){Ge("size",g.value)}),m&&m.addEventListener("change",function(){Ge("spacing",m.value)}),y&&y.addEventListener("change",function(){Ge("motion",y.value)}),v&&v.addEventListener("change",function(){Ge("readableLineLength",v.checked)}),T&&T.addEventListener("change",function(){Ge("highContrast",T.checked)}),x&&x.addEventListener("change",function(){Ge("underlineLinks",x.checked)})}function Qo(){return e.querySelector(".note-panel.is-active-panel")}function lCt(){return $e(document.activeElement,"[data-note-path]")}function VCe(){return lCt()||Qo()}function Sd(q){!q||!e.contains(q)||(me().forEach(function(K){const ie=K===q;K.classList.toggle("is-active-panel",ie),K.dataset.activePanel=ie?"true":"false",ie||K.querySelectorAll("[data-editor-picker]").forEach(function(Te){pC(Te,!1)})}),t0(),Bs(q.dataset.notePath,!1))}function Xz(){const q=me();q.length&&(Qo()||Sd(q[q.length-1]))}function cCt(q){!q||q.dataset.resizeHandlesBound==="true"||(q.dataset.resizeHandlesBound="true",["left","right"].forEach(function(K){const ie=document.createElement("button");ie.type="button",ie.className="note-resize-handle note-resize-handle-"+K,ie.dataset.panelResizeHandle=K,ie.setAttribute("aria-label","Resize note panel from the "+K),ie.title="Resize panel",ie.addEventListener("pointerdown",XCt),ie.addEventListener("keydown",function(Te){YCt(q,K,Te)}),q.append(ie)}),UCe(q),q.addEventListener("scroll",function(){UCe(q)},{passive:!0}))}function UCe(q){q&&q.style.setProperty("--note-panel-scroll-top",Math.max(0,q.scrollTop||0)+"px")}function uCt(q){if(!q||q.dataset.editorBound==="true")return;q.dataset.editorBound="true",Yz(q);const K=q.querySelector("[data-editor-menu-trigger]"),ie=q.querySelector("[data-editor-menu]");!K||!ie||(K.addEventListener("click",function(Te){Te.preventDefault(),Te.stopPropagation(),pC(q,ie.hidden)}),K.addEventListener("keydown",function(Te){if(Te.key!=="ArrowDown"&&Te.key!=="Enter"&&Te.key!==" ")return;Te.preventDefault(),pC(q,!0);const Ge=ie.querySelector("[data-editor-option]");Ge&&Ge.focus()}),ie.addEventListener("click",function(Te){const Ge=$e(Te.target,"[data-editor-option]");Ge&&(Te.preventDefault(),Te.stopPropagation(),GCe(Ge.dataset.editorOption),qCe(),gC())}),ie.addEventListener("keydown",function(Te){if(Te.key==="Escape"){Te.preventDefault(),pC(q,!1),K.focus();return}if(Te.key!=="Enter"&&Te.key!==" ")return;const Ge=$e(Te.target,"[data-editor-option]");Ge&&(Te.preventDefault(),GCe(Ge.dataset.editorOption),qCe(),gC(),K.focus())}))}function Dl(){return me().map(function(q){return q.dataset.notePath})}function HCe(){const q=new URLSearchParams(window.location.search);return q.get("empty")==="1"?[]:[xt(window.location.href)||Dl()[0]||"index.md"].concat(q.getAll("stack").filter(Boolean))}function YCe(){return XCe(window.location.href)}function XCe(q){let K;try{K=new URL(q,window.location.href)}catch{return""}return(K.searchParams.get("ok-highlight")||"").trim()}function jCe(q,K){if(!q.length){const Te=new URL(ut("index.md"),window.location.href);return Te.searchParams.set("empty","1"),Te}const ie=new URL(ut(q[0]||"index.md"),window.location.href);return q.slice(1).forEach(function(Te){ie.searchParams.append("stack",Te)}),K&&ie.searchParams.set("ok-highlight",K),ie}function Z2(){const q=me().length,K=q===0;t.classList.toggle("is-empty",K),t.classList.toggle("is-single-panel",q===1),t.classList.toggle("is-multi-panel",q>1),r&&(r.hidden=!K),me().forEach(zt),Xz(),hCt(),V6(),bC()}function hCt(){const q=Dl();me().forEach(function(K,ie){const Te=K.querySelector("[data-close-panel]");if(!Te)return;const Ge=q.filter(function(Xe,Ke){return Ke!==ie});Te.href=jCe(Ge).href})}function yC(){return Math.max(0,t.scrollWidth-t.clientWidth)}function vC(){return!!(w&&C&&k&&me().length>1&&yC()>1&&!t.classList.contains("is-empty"))}function bC(){window.requestAnimationFrame(dCt)}function dCt(){if(!w||!C||!k)return;if(!vC()){w.hidden=!0,w.setAttribute("aria-hidden","true"),k.style.width="",k.style.setProperty("--thumb-x","0px"),k.setAttribute("aria-valuemax","0"),k.setAttribute("aria-valuenow","0");return}w.hidden=!1,w.setAttribute("aria-hidden","false");const q=C.getBoundingClientRect().width;if(q<=0)return;const K=yC(),ie=we(q*(t.clientWidth/t.scrollWidth),44,q),Te=Math.max(0,q-ie),Ge=K>0?t.scrollLeft/K*Te:0;k.style.width=ie+"px",k.style.setProperty("--thumb-x",we(Ge,0,Te)+"px"),k.setAttribute("aria-valuemax",String(Math.round(K))),k.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function jz(q,K){if(!vC())return;const ie=C.getBoundingClientRect(),Te=k.getBoundingClientRect(),Ge=Math.max(0,ie.width-Te.width),Xe=yC(),Ke=we(q-ie.left-K,0,Ge);t.scrollLeft=Ge>0?Ke/Ge*Xe:0}function t0(){const q=me(),K=Qo()||q[q.length-1];if(!K){document.title="Knowledge base - Open Knowledge";return}const ie=(K==null?void 0:K.dataset.noteTitle)||(K==null?void 0:K.dataset.notePath)||"Open Knowledge";document.title=ie+" - Open Knowledge"}function xC(q,K,ie){const Te=jCe(q,ie),Ge={stack:q};window.history.pushState(Ge,"",Te)}function fCt(){BNe(),window.clearTimeout(de),de=window.setTimeout(function(){KCe(e,!0)},60)}function r0(q,K,ie){return q.getPropertyValue(K).trim()||ie}function pCt(){const q=window.getComputedStyle(document.documentElement),K=r0(q,"--ok-color-page","#ffffff"),ie=r0(q,"--ok-color-surface",K),Te=r0(q,"--ok-color-text","#202322"),Ge=r0(q,"--ok-color-muted","#707773"),Xe=r0(q,"--ok-color-accent","#0b7a53"),Ke=r0(q,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:K,primaryColor:ie,primaryTextColor:Te,primaryBorderColor:Ke,lineColor:Ge,secondaryColor:K,secondaryTextColor:Te,secondaryBorderColor:Ke,tertiaryColor:ie,tertiaryTextColor:Te,tertiaryBorderColor:Ke,mainBkg:ie,nodeBorder:Xe,clusterBkg:K,clusterBorder:Ke,titleColor:Te,edgeLabelBackground:ie,textColor:Te,fontFamily:r0(q,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function gCt(q){var ie,Te;const K=[];return(ie=q==null?void 0:q.matches)!=null&&ie.call(q,"[data-mermaid-source]")&&K.push(q),(Te=q==null?void 0:q.querySelectorAll)==null||Te.call(q,"[data-mermaid-source]").forEach(function(Ge){K.push(Ge)}),K}function mCt(q){var Xe;const K=$e(q,"[data-mermaid-diagram]");if(K)return K;const ie=document.createElement("figure");ie.className="ok-mermaid",ie.dataset.mermaidDiagram="";const Te=document.createElement("div");Te.className="ok-mermaid-output",Te.dataset.mermaidOutput="",Te.setAttribute("role","img"),Te.setAttribute("aria-label","Mermaid diagram"),Te.hidden=!0;const Ge=document.createElement("p");return Ge.className="ok-mermaid-error",Ge.dataset.mermaidError="",Ge.setAttribute("role","status"),Ge.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Ge.hidden=!0,q.parentNode.insertBefore(ie,q),ie.append(Te,Ge,q),ie._openKnowledgeMermaidSource=String(((Xe=q.querySelector("code"))==null?void 0:Xe.textContent)||q.textContent||""),ie}function yCt(q){var Ge,Xe;const K=$e(q,"[data-note-path]"),ie=((Xe=(Ge=K==null?void 0:K.querySelector(".note-body h1"))==null?void 0:Ge.textContent)==null?void 0:Xe.trim())||(K==null?void 0:K.dataset.noteTitle)||"document",Te=Array.from((K==null?void 0:K.querySelectorAll("[data-mermaid-diagram]"))||[q]);return"Mermaid diagram "+(Math.max(0,Te.indexOf(q))+1)+" in "+ie}function KCe(q,K){if(!window.mermaid||typeof window.mermaid.render!="function")return;const ie=gCt(q).map(mCt).filter(function(Ge){const Xe=Ge.dataset.mermaidState||"";return K||Xe!=="queued"&&Xe!=="rendering"&&Xe!=="rendered"});if(!ie.length)return;const Te=++ue;ie.forEach(function(Ge){Ge.dataset.mermaidState="queued",Ge._openKnowledgeMermaidRequest=Te}),Fe=Fe.catch(function(){}).then(function(){return vCt(ie,Te)})}async function vCt(q,K){try{window.mermaid.initialize(pCt())}catch{q.forEach(function(ie){const Te=ie.querySelector("[data-mermaid-source]"),Ge=ie.querySelector("[data-mermaid-output]"),Xe=ie.querySelector("[data-mermaid-error]");ie._openKnowledgeMermaidRequest!==K||!Te||!Ge||!Xe||(Ge.hidden=!0,Te.hidden=!1,Xe.hidden=!1,ie.dataset.mermaidState="error")});return}for(const ie of q){if(ie._openKnowledgeMermaidRequest!==K)continue;const Te=ie.querySelector("[data-mermaid-source]"),Ge=ie.querySelector("[data-mermaid-output]"),Xe=ie.querySelector("[data-mermaid-error]");if(!(!Te||!Ge||!Xe)){ie.dataset.mermaidState="rendering",Ge.setAttribute("aria-busy","true");try{const Ke=await window.mermaid.render("ok-mermaid-"+ ++qe,ie._openKnowledgeMermaidSource);if(ie._openKnowledgeMermaidRequest!==K)continue;Ge.innerHTML=Ke.svg,typeof Ke.bindFunctions=="function"&&Ke.bindFunctions(Ge),Ge.hidden=!1,Te.hidden=!0,Xe.hidden=!0,PNe(Ge,yCt(ie)),ie.dataset.mermaidState="rendered"}catch{if(ie._openKnowledgeMermaidRequest!==K)continue;ie.dataset.mermaidRendered!=="true"&&(Ge.hidden=!0,Te.hidden=!1,Xe.hidden=!1),ie.dataset.mermaidState="error"}finally{Ge.removeAttribute("aria-busy")}ie.dataset.mermaidState==="rendered"&&(ie.dataset.mermaidRendered="true")}}}function bCt(q){q.querySelectorAll("table").forEach(function(K){var Zt,ar,qt;if(K.dataset.okTableEnhanced==="true")return;const ie=(ar=(Zt=K.tHead)==null?void 0:Zt.rows)==null?void 0:ar[0],Te=(qt=K.tBodies)==null?void 0:qt[0];if(!ie||!Te)return;const Ge=Array.prototype.slice.call(ie.cells),Xe=Array.prototype.slice.call(Te.rows);if(!Ge.length||!Xe.length)return;K.classList.add("ok-table"),K.dataset.okTable="",K.dataset.okTableEnhanced="true",Xe.forEach(function(Xt,ur){Xt.dataset.okTableOriginalIndex=String(ur)});const Ke=xCt(K),yt={query:"",filters:Ge.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},wt=document.createElement("span");wt.className="ok-table-count",wt.dataset.okTableCount="";function Ot(){let Xt=0;Xe.forEach(function(ur){const Br=!yt.query||i0(ur.textContent).includes(yt.query),On=yt.filters.every(function(Bi,Ol){return!Bi||i0(n0(ur.cells[Ol]))===Bi}),Fn=Br&&On;ur.hidden=!Fn,Fn&&(Xt+=1)}),wt.textContent=Xt===Xe.length?JCe(Xe.length):Xt+" / "+JCe(Xe.length)}Ge.forEach(function(Xt,ur){wCt(Xt,Te,Ge,Xe,yt,ur)});const Lt=TCt(Ge,Xe,yt,wt,Ot);Ke.insertBefore(Lt,Ke.firstChild),Ot()})}function xCt(q){let K=$e(q,"[data-ok-table-wrap]");if(!K){K=document.createElement("div"),K.className="ok-table-wrap",K.dataset.okTableWrap="";const ie=document.createElement("div");return ie.className="ok-table-scroller",q.parentNode.insertBefore(K,q),K.append(ie),ie.append(q),K}if(!$e(q,".ok-table-scroller")){const ie=document.createElement("div");ie.className="ok-table-scroller",q.parentNode.insertBefore(ie,q),ie.append(q)}return K}function TCt(q,K,ie,Te,Ge){const Xe=document.createElement("div");Xe.className="ok-table-tools",Xe.dataset.okTableControls="";const Ke=document.createElement("input");Ke.className="ok-table-search",Ke.type="search",Ke.placeholder="Filter table",Ke.setAttribute("aria-label","Filter table rows"),Ke.addEventListener("input",function(){ie.query=i0(Ke.value),Ge()}),Xe.append(Ke);const yt=document.createElement("div");yt.className="ok-table-filter-list";const wt=[];let Ot,Lt;function Zt(){const ar=ie.filters.filter(Boolean).length;Ot&&(Ot.textContent=ar?"Filters ("+ar+")":"Filters"),Lt&&(Lt.disabled=ar===0)}if(q.forEach(function(ar,qt){const Xt=SCt(K,qt);if(Xt.length<2||Xt.length>30)return;const ur=document.createElement("select"),Br=n0(ar)||"Column "+(qt+1);ur.setAttribute("aria-label","Filter by "+Br);const On=document.createElement("option");On.value="",On.textContent=Br+": All",ur.append(On),Xt.forEach(function(Fn){const Bi=document.createElement("option");Bi.value=i0(Fn),Bi.textContent=Fn,ur.append(Bi)}),ur.addEventListener("change",function(){ie.filters[qt]=ur.value,Zt(),Ge()}),wt.push(ur),yt.append(ur)}),yt.children.length){const ar=document.createElement("details");ar.className="ok-table-filter-menu";const qt=document.createElement("summary");qt.className="ok-table-filter-trigger",qt.setAttribute("role","button"),qt.setAttribute("aria-label","Table filters"),Ot=document.createElement("span"),Ot.textContent="Filters",qt.append(Ot);const Xt=document.createElement("div");Xt.className="ok-table-filter-panel",Lt=document.createElement("button"),Lt.className="ok-table-clear",Lt.type="button",Lt.textContent="Clear filters",Lt.addEventListener("click",function(){ie.filters=ie.filters.map(function(){return""}),wt.forEach(function(ur){ur.value=""}),Zt(),Ge(),wt[0]&&wt[0].focus()}),Xt.append(yt,Lt),ar.append(qt,Xt),ar.addEventListener("keydown",function(ur){ur.key==="Escape"&&(ar.open=!1,qt.focus())}),Xe.append(ar),Zt()}return Xe.append(Te),Xe}function wCt(q,K,ie,Te,Ge,Xe){if(q.dataset.okTableSort="",q.tabIndex=0,q.setAttribute("aria-label","Sort by "+(n0(q)||"column "+(Xe+1))),!q.querySelector(".ok-table-sort-indicator")){const yt=document.createElement("span");yt.className="ok-table-sort-indicator",yt.setAttribute("aria-hidden","true"),q.append(yt)}function Ke(yt){yt&&$e(yt.target,"a[href], button, input, textarea, select, [contenteditable='true']")||CCt(K,ie,Te,Ge,Xe)}q.addEventListener("click",Ke),q.addEventListener("keydown",function(yt){yt.key!=="Enter"&&yt.key!==" "||(yt.preventDefault(),Ke(yt))})}function CCt(q,K,ie,Te,Ge){const Xe=Te.sortColumn===Ge&&Te.sortDirection==="asc"?"desc":"asc";Te.sortColumn=Ge,Te.sortDirection=Xe,K.forEach(function(yt){yt.removeAttribute("aria-sort"),yt.removeAttribute("data-sort-direction")}),K[Ge].setAttribute("aria-sort",Xe==="asc"?"ascending":"descending"),K[Ge].dataset.sortDirection=Xe;const Ke=Xe==="asc"?1:-1;ie.sort(function(yt,wt){const Ot=ZCe(n0(yt.cells[Ge]),n0(wt.cells[Ge]));return Ot!==0?Ot*Ke:Number(yt.dataset.okTableOriginalIndex||0)-Number(wt.dataset.okTableOriginalIndex||0)}),ie.forEach(function(yt){q.append(yt)})}function SCt(q,K){const ie=new Set,Te=[];return q.forEach(function(Ge){const Xe=n0(Ge.cells[K]),Ke=i0(Xe);!Ke||ie.has(Ke)||Xe.length>80||(ie.add(Ke),Te.push(Xe))}),Te.sort(function(Ge,Xe){return ZCe(Ge,Xe)})}function ZCe(q,K){const ie=i0(q),Te=i0(K);if(!ie&&Te)return 1;if(ie&&!Te)return-1;const Ge=QCe(ie),Xe=QCe(Te);return Ge!==null&&Xe!==null&&Ge!==Xe?Ge-Xe:ie.localeCompare(Te,void 0,{numeric:!0,sensitivity:"base"})}function QCe(q){const K=String(q||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(K)?Number(K.replace(/%$/,"")):null}function n0(q){return String((q==null?void 0:q.textContent)||"").replace(/\s+/g," ").trim()}function i0(q){return n0({textContent:String(q||"")}).toLocaleLowerCase()}function JCe(q){return q+(q===1?" row":" rows")}function Q2(){var K;const q=me();q.forEach(function(ie){ie.querySelectorAll(".note-body a.is-active-note").forEach(function(Te){Te.classList.remove("is-active-note"),Te.removeAttribute("aria-current")})}),q.forEach(function(ie,Te){var Xe;const Ge=(Xe=q[Te+1])==null?void 0:Xe.dataset.notePath;Ge&&ie.querySelectorAll(".note-body a[href]").forEach(function(Ke){xt(Ke.getAttribute("href")||Ke.href,ie.dataset.notePath)===Ge&&(Ke.classList.add("is-active-note"),Ke.setAttribute("aria-current","true"))})}),Bs(((K=Qo()||q[q.length-1])==null?void 0:K.dataset.notePath)||"",!1)}function z6(q){Sd(q),window.requestAnimationFrame(function(){q.scrollIntoView({block:"nearest",inline:"end",behavior:bt()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function Kz(q){(q||document).querySelectorAll("mark.ok-search-highlight").forEach(function(ie){const Te=ie.parentNode;Te&&(ie.replaceWith.apply(ie,Array.prototype.slice.call(ie.childNodes)),Te.normalize())})}function J2(q,K){Kz(e);const ie=String(K||"").trim(),Te=q==null?void 0:q.querySelector(".note-body");!Te||!ie||window.requestAnimationFrame(function(){const Ge=kCt(Te,ie);if(!Ge)return;const Xe=document.createElement("mark");Xe.className="ok-search-highlight",Xe.dataset.searchHighlight="",Xe.append(Ge.extractContents()),Ge.insertNode(Xe),Xe.scrollIntoView({block:"center",inline:"nearest",behavior:bt()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function kCt(q,K){const ie=ACt(K);if(!ie)return null;const Te=ECt(q),Ge=Te.text.indexOf(ie);if(Ge<0)return null;let Xe=Ge,Ke=Ge+ie.length;for(;XeXe&&Te.text[Ke-1]===" ";)Ke--;const yt=Te.positions[Xe],wt=Te.positions[Ke-1];if(!yt||!wt)return null;const Ot=document.createRange();return Ot.setStart(yt.node,yt.start),Ot.setEnd(wt.node,wt.end),Ot}function ECt(q){const K=document.createTreeWalker(q,NodeFilter.SHOW_TEXT),ie=[],Te=[];let Ge=!0,Xe;for(;Xe=K.nextNode();){if($e(Xe.parentElement,"[hidden], [aria-hidden='true']"))continue;const Ke=Xe.nodeValue||"";for(let yt=0;yt0?q:cr(z)}function BCt(q){if(!(!s||E.matches||q.button!==0)){Jo={pointerId:q.pointerId,startX:q.clientX,startWidth:PCt(),moved:!1},document.body.classList.add("is-sidebar-resizing"),window.addEventListener("pointermove",o4e),window.addEventListener("pointerup",q6),window.addEventListener("pointercancel",q6),window.addEventListener("blur",c4e),q.preventDefault();try{s.setPointerCapture(q.pointerId)}catch{}}}function o4e(q){if(!Jo||q.pointerId!==Jo.pointerId)return;const K=q.clientX-Jo.startX;Jo.moved=Jo.moved||Math.abs(K)>2,at(Jo.startWidth+K),q.preventDefault()}function l4e(q){if(!Jo)return;const K=Jo.moved;try{q!==void 0&&(s==null||s.releasePointerCapture(q))}catch{}Jo=null,document.body.classList.remove("is-sidebar-resizing"),window.removeEventListener("pointermove",o4e),window.removeEventListener("pointerup",q6),window.removeEventListener("pointercancel",q6),window.removeEventListener("blur",c4e),K&&ye()}function q6(q){!Jo||q.pointerId!==Jo.pointerId||l4e(q.pointerId)}function c4e(){l4e()}function FCt(q){const K=(q.key||"").toLowerCase(),ie=q.shiftKey?64:24;let Te=cr(z);if(K==="arrowleft")Te-=ie;else if(K==="arrowright")Te+=ie;else if(K==="home")Te=Tr();else if(K==="end")Te=fr();else return;q.preventDefault(),q.stopPropagation(),at(Te),ye()}function u4e(q){return q.code==="Space"||q.key===" "||q.key==="Spacebar"}function zCt(q){return!!$e(q,"input, textarea, select, [contenteditable='true']")}function GCt(q){return!!$e(q,"a[href], button, input, textarea, select, [contenteditable='true'], [role='button']")}function h4e(){return s4e.matches&&me().length>1&&!t.classList.contains("is-empty")}function Qz(){return wC&&h4e()}function V6(){t.classList.toggle("is-space-panning",Qz())}function WCt(q){!u4e(q)||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||GCt(q.target)||h4e()&&(wC=!0,V6(),q.preventDefault())}function qCt(q){!u4e(q)||!wC||(wC=!1,V6(),q.preventDefault())}function VCt(){wC=!1,V6()}function d4e(){eb=Date.now()+350,window.setTimeout(function(){Date.now()>=eb&&(eb=0)},360)}function UCt(q){return!eb||Date.now()>eb?!1:(eb=0,q.preventDefault(),q.stopPropagation(),!0)}function f4e(q){return q.getBoundingClientRect().width||vt(q)||Wt()}function p4e(q,K){const ie=lr(K,q);return!ie||!q?null:(q.style.setProperty("--note-panel-width",ie+"px"),q.dataset.panelWidth=String(ie),q.dataset.notePath&&(G[q.dataset.notePath]=ie),bC(),ie)}function HCt(q,K,ie){return(q==="left"?-K:K)*(ie?2:1)}function YCt(q,K,ie){const Te=(ie.key||"").toLowerCase(),Ge=f4e(q),Xe=ie.shiftKey?64:24;let Ke=Ge;if(Te==="arrowleft")Ke+=K==="left"?Xe:-Xe;else if(Te==="arrowright")Ke+=K==="right"?Xe:-Xe;else if(Te==="home")Ke=Ae();else if(Te==="end")Ke=Mt(q);else return;ie.preventDefault(),ie.stopPropagation();const yt=p4e(q,Ke);yt&&(K==="left"&&!ct(q)&&(t.scrollLeft+=yt-Ge),Ye())}function XCt(q){const K=$e(q.target,"[data-panel-resize-handle]"),ie=K==null?void 0:K.closest("[data-note-path]");if(!(!K||!ie||q.button!==0)){ji={pointerId:q.pointerId,panel:ie,handle:K,edge:K.dataset.panelResizeHandle==="left"?"left":"right",centered:ct(ie),startX:q.clientX,startWidth:f4e(ie),startScrollLeft:t.scrollLeft,moved:!1},Sd(ie),ie.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",g4e),window.addEventListener("pointerup",U6),window.addEventListener("pointercancel",U6),window.addEventListener("blur",y4e),q.preventDefault(),q.stopPropagation();try{K.setPointerCapture(q.pointerId)}catch{}}}function g4e(q){if(!ji||q.pointerId!==ji.pointerId)return;const K=q.clientX-ji.startX;Math.abs(K)>2&&(ji.moved=!0);const ie=ji.startWidth+HCt(ji.edge,K,ji.centered),Te=p4e(ji.panel,ie);Te&&(ji.edge==="left"&&!ji.centered&&(t.scrollLeft=ji.startScrollLeft+(Te-ji.startWidth)),q.preventDefault())}function m4e(q){if(!ji)return;const K=ji.moved;ji.panel.classList.remove("is-panel-resizing");try{q!==void 0&&ji.handle.releasePointerCapture(q)}catch{}ji=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",g4e),window.removeEventListener("pointerup",U6),window.removeEventListener("pointercancel",U6),window.removeEventListener("blur",y4e),K&&(Ye(),d4e())}function U6(q){!ji||q.pointerId!==ji.pointerId||m4e(q.pointerId)}function y4e(){m4e()}function jCt(q){return(q.pointerType||"mouse")!=="mouse"||!s4e.matches||q.button!==0||me().length<2||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey?!1:Qz()?!zCt(q.target):!$e(q.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function KCt(q){if(!jCt(q))return;const K=Qz();Nl={pointerId:q.pointerId,startX:q.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:K},t.classList.add("is-drag-scrolling"),K&&q.preventDefault();try{t.setPointerCapture(q.pointerId)}catch{}}function ZCt(q){if(!Nl||q.pointerId!==Nl.pointerId)return;const K=q.clientX-Nl.startX;Math.abs(K)<3&&!Nl.moved||(Nl.moved=!0,t.scrollLeft=Nl.startScrollLeft-K,q.preventDefault())}function v4e(q){if(!Nl||q.pointerId!==Nl.pointerId)return;const K=Nl;try{t.releasePointerCapture(q.pointerId)}catch{}(K.moved||K.fromSpacePan)&&d4e(),Nl=null,t.classList.remove("is-drag-scrolling")}function QCt(q){if(!vC()||q.button!==0)return;const K=k.getBoundingClientRect();$c={pointerId:q.pointerId,thumbOffset:we(q.clientX-K.left,0,K.width)},w.classList.add("is-rail-dragging"),window.addEventListener("pointermove",Jz),window.addEventListener("pointerup",tb),window.addEventListener("pointercancel",tb),window.addEventListener("blur",x4e),jz(q.clientX,$c.thumbOffset),q.preventDefault();try{k.setPointerCapture(q.pointerId)}catch{}}function JCt(q){if(!vC()||q.button!==0||$e(q.target,"[data-workspace-scroll-thumb]"))return;const K=k.getBoundingClientRect();jz(q.clientX,K.width/2),q.preventDefault()}function Jz(q){!$c||q.pointerId!==$c.pointerId||(jz(q.clientX,$c.thumbOffset),q.preventDefault())}function b4e(q){const K=q??$c.pointerId;try{k.releasePointerCapture(K)}catch{}$c=null,w.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",Jz),window.removeEventListener("pointerup",tb),window.removeEventListener("pointercancel",tb),window.removeEventListener("blur",x4e)}function tb(q){!$c||q.pointerId!==$c.pointerId||b4e(q.pointerId)}function x4e(){$c&&b4e()}function e4t(q){if(!vC())return;const K=Math.max(48,t.clientWidth*.12),ie=Math.max(120,t.clientWidth*.72);let Te=t.scrollLeft;const Ge=(q.key||"").toLowerCase();if(Ge==="arrowleft")Te-=K;else if(Ge==="arrowright")Te+=K;else if(Ge==="pageup")Te-=ie;else if(Ge==="pagedown")Te+=ie;else if(Ge==="home")Te=0;else if(Ge==="end")Te=yC();else return;q.preventDefault(),t.scrollLeft=we(Te,0,yC())}if(Vr(z),br(document.body.classList.contains("is-sidebar-open")),t.addEventListener("pointerdown",KCt),t.addEventListener("pointermove",ZCt),t.addEventListener("pointerup",v4e),t.addEventListener("pointercancel",v4e),t.addEventListener("scroll",bC),window.addEventListener("keydown",WCt,!0),window.addEventListener("keyup",qCt,!0),window.addEventListener("blur",VCt),window.addEventListener("resize",function(){Vr(z),bC()}),C&&k&&(C.addEventListener("pointerdown",JCt),k.addEventListener("pointerdown",QCt),k.addEventListener("pointermove",Jz),k.addEventListener("pointerup",tb),k.addEventListener("pointercancel",tb),k.addEventListener("keydown",e4t)),t.addEventListener("click",function(q){if(UCt(q))return;const K=$e(q.target,"[data-note-path]");K&&Sd(K);const ie=$e(q.target,"[data-close-panel]");if(ie){const Ot=ie.closest("[data-note-path]");if(!Ot)return;q.preventDefault(),W6(Ot);return}const Te=$e(q.target,'.ok-source-ref a[href^="#"]');if(Te){const Ot=Te.closest("[data-note-path]"),Lt=decodeURIComponent((Te.getAttribute("href")||"").slice(1)),Zt=Ot?Array.prototype.find.call(Ot.querySelectorAll("[id]"),function(ar){return ar.id===Lt}):null;if(Zt){const ar=Zt.closest("[data-source-ledger]");ar&&(ar.open=!0),q.preventDefault(),Zt.scrollIntoView({block:"nearest"});return}}const Ge=$e(q.target,"[data-tree-path]"),Xe=$e(q.target,"[data-graph-path]");if(Ge||Xe){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;q.preventDefault(),a0((Ge==null?void 0:Ge.dataset.treePath)||Xe.dataset.graphPath,!0,Se(q.shiftKey),"",Qo());return}const Ke=$e(q.target,"a[href]");if(!Ke||Ke.dataset.directLink==="true"||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const yt=Ke.closest("[data-note-path]");if(!yt)return;const wt=xt(Ke.getAttribute("href")||Ke.href,yt.dataset.notePath);wt&&(q.preventDefault(),a0(wt,!0,Se(q.shiftKey),"",yt))}),t.addEventListener("keydown",function(q){if(q.key!=="Enter"||!q.shiftKey||q.metaKey||q.ctrlKey||q.altKey)return;const K=$e(q.target,".note-body a[href]"),ie=K==null?void 0:K.closest("[data-note-path]");if(!K||!ie)return;const Te=xt(K.getAttribute("href")||K.href,ie.dataset.notePath);Te&&(q.preventDefault(),a0(Te,!0,Se(!0),"",ie))}),t.addEventListener("focusin",function(q){const K=$e(q.target,"[data-note-path]");K&&Sd(K)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Ce),i){const q={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:Wr},K=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",Wr),K){K.register(q);const ie=K.format(q);i.title="File explorer ("+ie+")",i.setAttribute("aria-keyshortcuts",K.ariaKeyShortcut(q)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(Te){Te.textContent=ie})}}a&&a.addEventListener("click",function(){br(!1),i==null||i.focus()}),s&&(s.addEventListener("pointerdown",BCt),s.addEventListener("keydown",FCt)),n&&n.addEventListener("click",function(q){const K=$e(q.target,"[data-tree-path]"),ie=K||$e(q.target,"a[href]");if(!ie||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const Te=(K==null?void 0:K.dataset.treePath)||xt(ie.getAttribute("href")||ie.href);Te&&(q.preventDefault(),T4e(ie),a0(Te,!0,Se(q.shiftKey),"",Qo()),E.matches&&br(!1))});function T4e(q){const K=$e(q,".search");if(!K)return;const ie=K.querySelector(".search-input"),Te=K.querySelector(".search-results"),Ge=K.querySelector(".search-status");ie&&(ie.value=""),Ge&&(Ge.textContent=""),Te&&(Te.hidden=!0,Te.replaceChildren())}window.addEventListener("popstate",function(){const q=HCe();a4e(q,YCe())}),document.addEventListener("click",function(q){const K=$e(q.target,".search-result[href]");if(K){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const ie=xt(K.getAttribute("href")||K.href);if(ie){q.preventDefault();const Te=q.shiftKey||K.dataset.openBeside==="true",Ge=Se(Te);delete K.dataset.openBeside,T4e(K),a0(ie,!0,Ge,XCe(K.getAttribute("href")||K.href),Qo());return}}$e(q.target,"[data-editor-picker]")||gC(),$e(q.target,"[data-viewer-settings]")||mC(!1)}),document.addEventListener("keydown",function(q){q.key==="Escape"&&(gC(),mC(!1),br(!1))});const CC=HCe(),w4e=YCe();He(),oCt(),_i(),St(),me().forEach(n4e),Xz(),CC.length!==1||CC[0]!==((C4e=me()[0])==null?void 0:C4e.dataset.notePath)?(window.history.replaceState({stack:CC},"",window.location.href),a4e(CC,w4e)):(window.history.replaceState({stack:CC},"",window.location.href),Z2(),Q2(),t0(),J2(Qo(),w4e))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(_=>{_.textContent=i.format(a)})):document.addEventListener("keydown",_=>{(_.metaKey||_.ctrlKey)&&!_.altKey&&_.key.toLowerCase()==="k"&&(_.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(_){const R=_.querySelector(".search-input"),O=_.querySelector(".search-results"),D=_.querySelector(".search-status");if(!R||!O||!D)return;const N=_.dataset.searchUrl||"/api/search";let B=0,F=null,G=-1,z=0,W="";m(R,O),Y(!1),_===r&&(W=o(),W&&(R.value=W,window.requestAnimationFrame(()=>{R.focus(),R.select(),H(W)}))),R.addEventListener("input",()=>{if(W="",l(),window.clearTimeout(B),J(-1,!1),!R.value.trim()){te(!0);return}B=window.setTimeout(V,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){te(!0);return}y(O).length>0?se(!0):V()}),R.addEventListener("keydown",Z=>{const ee=y(O);if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(!ee.length)return;Z.preventDefault();const re=Z.key==="ArrowDown"?1:-1,ge=G<0?re>0?0:ee.length-1:(G+re+ee.length)%ee.length;J(ge,!0),se(!0);return}if(Z.key==="Enter"){const re=v(O,G);if(!re)return;Z.preventDefault(),re.dataset.openBeside=Z.shiftKey?"true":"false",re.click(),Y(!0);return}Z.key==="Escape"&&(!O.hidden||R.value)&&(Z.preventDefault(),Y(!0))}),O.addEventListener("mousemove",Z=>{const ee=T(Z.target);if(!ee)return;const re=y(O).indexOf(ee);re>=0&&J(re,!1)}),O.addEventListener("focusin",Z=>{const ee=T(Z.target);if(!ee)return;const re=y(O).indexOf(ee);re>=0&&J(re,!1)}),O.addEventListener("click",Z=>{!T(Z.target)||x(Z)||Y(!0)}),document.addEventListener("pointerdown",Z=>{!O.hidden&&!_.contains(Z.target)&&Y(!0)}),document.addEventListener("focusin",Z=>{!O.hidden&&!_.contains(Z.target)&&Y(!0)});async function V(){const Z=R.value.trim();if(!Z){te(document.activeElement===R);return}const ee=++z;if(J(-1,!1),e.length>0){u(O,D,C(Z),Z,se,J);return}F&&F.abort(),F=new AbortController,D.textContent="Searching...";try{const re=await fetch(N+"?q="+encodeURIComponent(Z)+"&limit=12",{signal:F.signal});if(!re.ok)throw new Error("search request failed");const ge=await re.json();if(ee!==z||R.value.trim()!==Z)return;u(O,D,ge.results||[],Z,se,J)}catch(re){if(re.name==="AbortError")return;D.textContent="Search failed.",J(-1,!1),se(!1)}}async function H(Z){var _e;const ee=String(Z||"").trim();if(!ee)return;const re=++z,ge=((_e=document.querySelector("[data-note-path]"))==null?void 0:_e.dataset.notePath)||"";if(J(-1,!1),e.length>0){const Fe=k(ee,ge);u(O,D,Fe,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Fe.length+" note"+(Fe.length===1?"":"s")+' tagged "'+ee+'"'});return}F&&F.abort(),F=new AbortController,D.textContent="Finding tagged notes...";const ae=new URLSearchParams({tag:ee,limit:"30"});ge&&ae.set("exclude",ge);try{const Fe=await fetch(N+"?"+ae.toString(),{signal:F.signal});if(!Fe.ok)throw new Error("tag search request failed");const qe=await Fe.json();if(re!==z||W!==ee)return;const ue=qe.results||[];u(O,D,ue,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:ue.length+" note"+(ue.length===1?"":"s")+' tagged "'+ee+'"'})}catch(Fe){if(Fe.name==="AbortError")return;D.textContent="Tag lookup failed.",J(-1,!1),se(!1)}}function te(Z){z+=1,window.clearTimeout(B),F&&(F.abort(),F=null);const ee=p();D.textContent=ee.length?"Top files":"",u(O,D,ee,"",se,J,{emptyStatus:"",keepOpenWhenEmpty:Z,statusText:ee.length?"Top files":""}),se(Z&&ee.length>0)}function Y(Z){z+=1,window.clearTimeout(B),F&&(F.abort(),F=null),Z&&(R.value="",W="",l()),D.textContent="",O.replaceChildren(),J(-1,!1),se(!1)}function se(Z){O.hidden=!Z,R.setAttribute("aria-expanded",Z?"true":"false"),Z||R.removeAttribute("aria-activedescendant")}function J(Z,ee){const re=y(O);G=re.length?(Z+re.length)%re.length:-1,re.forEach((ge,ae)=>{const _e=ae===G;ge.classList.toggle("is-active",_e),ge.setAttribute("aria-selected",_e?"true":"false"),_e&&(R.setAttribute("aria-activedescendant",ge.id),ee&&ge.scrollIntoView({block:"nearest"}))}),G<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let _;try{_=new URL(window.location.href)}catch{return}_.searchParams.has("ok-tag")&&(_.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",_))}function u(_,R,O,D,N,B,F){const G=F||{},z=h(O);if(_.replaceChildren(),z.length===0){const W=G.emptyStatus??'No results for "'+D+'".';if(R.textContent=W,W){const V=document.createElement("div");V.className="search-empty",V.textContent=W,_.append(V)}B(-1,!1),N(!!G.keepOpenWhenEmpty);return}R.textContent=G.statusText||z.length+" document"+(z.length===1?"":"s"),N(!0),z.forEach((W,V)=>{const H=document.createElement("a");H.className="search-result",H.href=W.highlightURL||W.url||M(W.path),H.id=_.id+"-option-"+V,H.setAttribute("role","option"),H.setAttribute("aria-selected","false"),H.title=d();const te=document.createElement("span");te.className="search-result-title-row";const Y=document.createElement("span");if(Y.className="search-result-title",f(Y,W.title||W.path,D),te.append(Y),W.matchCount>1){const J=document.createElement("span");J.className="search-result-count",J.textContent=W.matchCount+" matches",te.append(J)}H.append(te);const se=document.createElement("span");if(se.className="search-result-meta",se.textContent=[W.path,W.type,W.matchCount===1?W.heading:""].filter(Boolean).join(" - "),H.append(se),W.snippet){const J=document.createElement("span");J.className="search-result-snippet",f(J,W.snippet,D),H.append(J)}if(W.headings.length>1){const J=document.createElement("span");J.className="search-result-headings",J.textContent=W.headings.slice(0,3).join(" · "),H.append(J)}_.append(H)}),B(0,!1)}function h(_){const R=[],O=new Map;return _.forEach((D,N)=>{const B=D.path||"__result-"+N;let F=O.get(B);F||(F=Object.assign({},D,{matchCount:0,headings:[]}),O.set(B,F),R.push(F)),F.matchCount+=1,D.heading&&!F.headings.includes(D.heading)&&F.headings.push(D.heading),!F.snippet&&D.snippet&&(F.snippet=D.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(_,R,O){const D=String(R||""),N=String(O||"").trim();if(!N){_.textContent=D;return}const B=D.toLocaleLowerCase(),F=N.toLocaleLowerCase();let G=0,z=B.indexOf(F);for(;z>=0;){z>G&&_.append(document.createTextNode(D.slice(G,z)));const W=document.createElement("mark");W.className="search-result-highlight",W.textContent=D.slice(z,z+N.length),_.append(W),G=z+N.length,z=B.indexOf(F,G)}G=12)break}return R.sort(function(B,F){return g(B.path)!==g(F.path)?g(B.path)?1:-1:0})}function g(_){return String(_||"").split("/").pop().toLowerCase()==="index.md"}function m(_,R){R.id||(R.id=(_.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),_.setAttribute("role","combobox"),_.setAttribute("aria-autocomplete","list"),_.setAttribute("aria-controls",R.id),_.setAttribute("aria-expanded","false")}function y(_){return Array.from(_.querySelectorAll(".search-result[href]"))}function v(_,R){const O=y(_);return O.length?O[R>=0?R:0]||O[0]:null}function T(_){return _?_.closest?_.closest(".search-result[href]"):_.parentElement?_.parentElement.closest(".search-result[href]"):null:null}function x(_){return _.button!==0||_.metaKey||_.ctrlKey||_.shiftKey||_.altKey}function w(){var O;const _=(O=window.OpenKnowledgeStaticData)==null?void 0:O.notes;if(Array.isArray(_))return _;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const D=JSON.parse(R.textContent||"[]");return Array.isArray(D)?D:[]}catch{return[]}}function C(_){const R=S(_);return e.map(function(O){const D=E(O.body||""),N=E(O.frontmatter||""),B=O.title||O.path||"",F=O.path||"",G=[N,D].filter(Boolean).join(" "),z=S([B,F,G].join(" ")),W=S(B).includes(R),V=S(F).includes(R);if(!z.includes(R))return null;const te=(W?3:0)+(V?2:0)+1;return{path:F,title:B,snippet:L(G,_),score:g(F)?te*.55:te}}).filter(Boolean).sort(function(O,D){return D.score!==O.score?D.score-O.score:g(O.path)!==g(D.path)?g(O.path)?1:-1:O.path.localeCompare(D.path)}).slice(0,12)}function k(_,R){const O=S(_).trim();return e.filter(function(D){return D.path!==R&&Array.isArray(D.tags)&&D.tags.some(function(N){return S(N).trim()===O})}).map(function(D){return{path:D.path,title:D.title||D.path,url:M(D.path),type:"tagged note"}}).sort(function(D,N){return D.path.localeCompare(N.path)})}function S(_){return String(_||"").toLowerCase()}function E(_){const R=document.createElement("div");return R.innerHTML=_,R.textContent||""}function L(_,R){const O=String(_||"").replace(/\s+/g," ").trim();if(!O)return"";const D=O.toLowerCase().indexOf(String(R||"").toLowerCase()),N=Math.max(0,D<0?0:D-48),B=Math.min(O.length,N+140);return(N>0?"...":"")+O.slice(N,B)+(B15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(GNe,"-$1").toLowerCase(),qNe={"&":"&",">":">","<":"<",'"':""","'":"'"},VNe=/[&><"']/g,es=t=>String(t).replace(VNe,e=>qNe[e]),xS=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?xS(t.body[0]):t:t.type==="font"?xS(t.body):t,UNe=new Set(["mathord","textord","atom"]),nu=t=>UNe.has(xS(t).type),HNe=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},TS={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function YNe(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function XNe(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return YNe(e)}function jNe(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:XNe(n)}class U7{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(TS)){var n=TS[r];n&&jNe(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Pt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=HNe(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class gh{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return jl[KNe[this.id]]}sub(){return jl[ZNe[this.id]]}fracNum(){return jl[QNe[this.id]]}fracDen(){return jl[JNe[this.id]]}cramp(){return jl[e9e[this.id]]}text(){return jl[t9e[this.id]]}isTight(){return this.size>=2}}var H7=0,wS=1,V0=2,iu=3,cx=4,Io=5,U0=6,fs=7,jl=[new gh(H7,0,!1),new gh(wS,0,!0),new gh(V0,1,!1),new gh(iu,1,!0),new gh(cx,2,!1),new gh(Io,2,!0),new gh(U0,3,!1),new gh(fs,3,!0)],KNe=[cx,Io,cx,Io,U0,fs,U0,fs],ZNe=[Io,Io,Io,Io,fs,fs,fs,fs],QNe=[V0,iu,cx,Io,U0,fs,U0,fs],JNe=[iu,iu,Io,Io,fs,fs,fs,fs],e9e=[wS,wS,iu,iu,Io,Io,fs,fs],t9e=[H7,wS,V0,iu,V0,iu,V0,iu],Gr={DISPLAY:jl[H7],TEXT:jl[V0],SCRIPT:jl[cx],SCRIPTSCRIPT:jl[U0]},Y7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function r9e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var CS=[];Y7.forEach(t=>t.blocks.forEach(e=>CS.push(...e)));function vK(t){for(var e=0;e=CS[e]&&t<=CS[e+1])return!0;return!1}var Ji=t=>t+" "+t,H0=80,n9e=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -316,7 +321,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},T8e=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},i9e=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -326,7 +331,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},w8e=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},a9e=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -335,7 +340,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},C8e=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},s9e=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -345,18 +350,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},k8e=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},o9e=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},E8e=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},S8e=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},l9e=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},c9e=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},A8e=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=x8e(r,o0);break;case"sqrtSize1":i=T8e(r,o0);break;case"sqrtSize2":i=w8e(r,o0);break;case"sqrtSize3":i=C8e(r,o0);break;case"sqrtSize4":i=k8e(r,o0);break;case"sqrtTall":i=S8e(r,o0,n)}return i},_8e=function(e,r){switch(e){case"⎜":return Ni("M291 0 H417 V"+r+" H291z");case"∣":return Ni("M145 0 H188 V"+r+" H145z");case"∥":return Ni("M145 0 H188 V"+r+" H145z")+Ni("M367 0 H410 V"+r+" H367z");case"⎟":return Ni("M457 0 H583 V"+r+" H457z");case"⎢":return Ni("M319 0 H403 V"+r+" H319z");case"⎥":return Ni("M263 0 H347 V"+r+" H263z");case"⎪":return Ni("M384 0 H504 V"+r+" H384z");case"⏐":return Ni("M312 0 H355 V"+r+" H312z");case"‖":return Ni("M257 0 H300 V"+r+" H257z")+Ni("M478 0 H521 V"+r+" H478z");default:return""}},xY={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},u9e=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=n9e(r,H0);break;case"sqrtSize1":i=i9e(r,H0);break;case"sqrtSize2":i=a9e(r,H0);break;case"sqrtSize3":i=s9e(r,H0);break;case"sqrtSize4":i=o9e(r,H0);break;case"sqrtTall":i=c9e(r,H0,n)}return i},h9e=function(e,r){switch(e){case"⎜":return Ji("M291 0 H417 V"+r+" H291z");case"∣":return Ji("M145 0 H188 V"+r+" H145z");case"∥":return Ji("M145 0 H188 V"+r+" H145z")+Ji("M367 0 H410 V"+r+" H367z");case"⎟":return Ji("M457 0 H583 V"+r+" H457z");case"⎢":return Ji("M319 0 H403 V"+r+" H319z");case"⎥":return Ji("M263 0 H347 V"+r+" H263z");case"⎪":return Ji("M384 0 H504 V"+r+" H384z");case"⏐":return Ji("M312 0 H355 V"+r+" H312z");case"‖":return Ji("M257 0 H300 V"+r+" H257z")+Ji("M478 0 H521 V"+r+" H478z");default:return""}},bK={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -402,10 +407,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ni("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ni("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ni("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ni("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ji("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ji("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ji("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ji("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ni("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ji("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -454,7 +459,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ni("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ni("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ni("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ji("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ji("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ji("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -527,7 +532,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},R8e=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},d9e=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -555,48 +560,48 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function L8e(t){return"toText"in t}class l0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(L8e(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var T7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},I8e={ex:!0,em:!0,mu:!0},TY=function(e){return typeof e!="string"&&(e=e.unit),e in T7||e in I8e||e==="ex"},jn=function(e,r){var n;if(e.unit in T7)n=T7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Mt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Pt=function(e){return+e.toFixed(4)+"em"},Bu=function(e){return e.filter(r=>r).join(" ")},w7=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=a8e(n)+":"+i+";")}return r},wY=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},CY=function(e){var r=document.createElement(e);r.className=Bu(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,kY=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ia(Bu(this.classes))+'"');var n=w7(this.style);n&&(r+=' style="'+Ia(n)+'"');for(var i of Object.keys(this.attributes)){if(D8e.test(i))throw new Mt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ia(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class c0{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,wY.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return CY.call(this,"span")}toMarkup(){return kY.call(this,"span")}}let CC=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,wY.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return CY.call(this,"a")}toMarkup(){return kY.call(this,"a")}};class M8e{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ia(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Pt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Bu(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Pt(this.italic)+";"),n+=w7(this.style),n&&(e=!0,r+=' style="'+Ia(n)+'"');var i=Ia(this.text);return e?(r+=">",r+=i,r+="",r):i}}class _c{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class C7{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var P8e=t=>t instanceof c0||t instanceof CC||t instanceof l0,Tl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},kC={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},EY={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function SY(t,e){Tl[t]=e}function k7(t,e,r){if(!Tl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Tl[e][n];if(!i&&t[0]in EY&&(n=EY[t[0]].charCodeAt(0),i=Tl[e][n]),!i&&r==="text"&&bY(n)&&(i=Tl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var E7={};function B8e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!E7[e]){var r=E7[e]={cssEmPerMu:kC.quad[e]/18};for(var n in kC)kC.hasOwnProperty(n)&&(r[n]=kC[n][e])}return E7[e]}var Hn={math:{},text:{}};function U(t,e,r,n,i,a){Hn[t][i]={font:e,group:r,replace:n},a&&n&&(Hn[t][n]=Hn[t][i])}var Q="math",kt="text",he="main",Oe="ams",Yn="accent-token",Xt="bin",Ya="close",u0="inner",mr="mathord",xi="op-token",zs="open",pb="punct",ze="rel",Rc="spacing",Ye="textord";U(Q,he,ze,"≡","\\equiv",!0),U(Q,he,ze,"≺","\\prec",!0),U(Q,he,ze,"≻","\\succ",!0),U(Q,he,ze,"∼","\\sim",!0),U(Q,he,ze,"⊥","\\perp"),U(Q,he,ze,"⪯","\\preceq",!0),U(Q,he,ze,"⪰","\\succeq",!0),U(Q,he,ze,"≃","\\simeq",!0),U(Q,he,ze,"∣","\\mid",!0),U(Q,he,ze,"≪","\\ll",!0),U(Q,he,ze,"≫","\\gg",!0),U(Q,he,ze,"≍","\\asymp",!0),U(Q,he,ze,"∥","\\parallel"),U(Q,he,ze,"⋈","\\bowtie",!0),U(Q,he,ze,"⌣","\\smile",!0),U(Q,he,ze,"⊑","\\sqsubseteq",!0),U(Q,he,ze,"⊒","\\sqsupseteq",!0),U(Q,he,ze,"≐","\\doteq",!0),U(Q,he,ze,"⌢","\\frown",!0),U(Q,he,ze,"∋","\\ni",!0),U(Q,he,ze,"∝","\\propto",!0),U(Q,he,ze,"⊢","\\vdash",!0),U(Q,he,ze,"⊣","\\dashv",!0),U(Q,he,ze,"∋","\\owns"),U(Q,he,pb,".","\\ldotp"),U(Q,he,pb,"⋅","\\cdotp"),U(Q,he,pb,"⋅","·"),U(kt,he,Ye,"⋅","·"),U(Q,he,Ye,"#","\\#"),U(kt,he,Ye,"#","\\#"),U(Q,he,Ye,"&","\\&"),U(kt,he,Ye,"&","\\&"),U(Q,he,Ye,"ℵ","\\aleph",!0),U(Q,he,Ye,"∀","\\forall",!0),U(Q,he,Ye,"ℏ","\\hbar",!0),U(Q,he,Ye,"∃","\\exists",!0),U(Q,he,Ye,"∇","\\nabla",!0),U(Q,he,Ye,"♭","\\flat",!0),U(Q,he,Ye,"ℓ","\\ell",!0),U(Q,he,Ye,"♮","\\natural",!0),U(Q,he,Ye,"♣","\\clubsuit",!0),U(Q,he,Ye,"℘","\\wp",!0),U(Q,he,Ye,"♯","\\sharp",!0),U(Q,he,Ye,"♢","\\diamondsuit",!0),U(Q,he,Ye,"ℜ","\\Re",!0),U(Q,he,Ye,"♡","\\heartsuit",!0),U(Q,he,Ye,"ℑ","\\Im",!0),U(Q,he,Ye,"♠","\\spadesuit",!0),U(Q,he,Ye,"§","\\S",!0),U(kt,he,Ye,"§","\\S"),U(Q,he,Ye,"¶","\\P",!0),U(kt,he,Ye,"¶","\\P"),U(Q,he,Ye,"†","\\dag"),U(kt,he,Ye,"†","\\dag"),U(kt,he,Ye,"†","\\textdagger"),U(Q,he,Ye,"‡","\\ddag"),U(kt,he,Ye,"‡","\\ddag"),U(kt,he,Ye,"‡","\\textdaggerdbl"),U(Q,he,Ya,"⎱","\\rmoustache",!0),U(Q,he,zs,"⎰","\\lmoustache",!0),U(Q,he,Ya,"⟯","\\rgroup",!0),U(Q,he,zs,"⟮","\\lgroup",!0),U(Q,he,Xt,"∓","\\mp",!0),U(Q,he,Xt,"⊖","\\ominus",!0),U(Q,he,Xt,"⊎","\\uplus",!0),U(Q,he,Xt,"⊓","\\sqcap",!0),U(Q,he,Xt,"∗","\\ast"),U(Q,he,Xt,"⊔","\\sqcup",!0),U(Q,he,Xt,"◯","\\bigcirc",!0),U(Q,he,Xt,"∙","\\bullet",!0),U(Q,he,Xt,"‡","\\ddagger"),U(Q,he,Xt,"≀","\\wr",!0),U(Q,he,Xt,"⨿","\\amalg"),U(Q,he,Xt,"&","\\And"),U(Q,he,ze,"⟵","\\longleftarrow",!0),U(Q,he,ze,"⇐","\\Leftarrow",!0),U(Q,he,ze,"⟸","\\Longleftarrow",!0),U(Q,he,ze,"⟶","\\longrightarrow",!0),U(Q,he,ze,"⇒","\\Rightarrow",!0),U(Q,he,ze,"⟹","\\Longrightarrow",!0),U(Q,he,ze,"↔","\\leftrightarrow",!0),U(Q,he,ze,"⟷","\\longleftrightarrow",!0),U(Q,he,ze,"⇔","\\Leftrightarrow",!0),U(Q,he,ze,"⟺","\\Longleftrightarrow",!0),U(Q,he,ze,"↦","\\mapsto",!0),U(Q,he,ze,"⟼","\\longmapsto",!0),U(Q,he,ze,"↗","\\nearrow",!0),U(Q,he,ze,"↩","\\hookleftarrow",!0),U(Q,he,ze,"↪","\\hookrightarrow",!0),U(Q,he,ze,"↘","\\searrow",!0),U(Q,he,ze,"↼","\\leftharpoonup",!0),U(Q,he,ze,"⇀","\\rightharpoonup",!0),U(Q,he,ze,"↙","\\swarrow",!0),U(Q,he,ze,"↽","\\leftharpoondown",!0),U(Q,he,ze,"⇁","\\rightharpoondown",!0),U(Q,he,ze,"↖","\\nwarrow",!0),U(Q,he,ze,"⇌","\\rightleftharpoons",!0),U(Q,Oe,ze,"≮","\\nless",!0),U(Q,Oe,ze,"","\\@nleqslant"),U(Q,Oe,ze,"","\\@nleqq"),U(Q,Oe,ze,"⪇","\\lneq",!0),U(Q,Oe,ze,"≨","\\lneqq",!0),U(Q,Oe,ze,"","\\@lvertneqq"),U(Q,Oe,ze,"⋦","\\lnsim",!0),U(Q,Oe,ze,"⪉","\\lnapprox",!0),U(Q,Oe,ze,"⊀","\\nprec",!0),U(Q,Oe,ze,"⋠","\\npreceq",!0),U(Q,Oe,ze,"⋨","\\precnsim",!0),U(Q,Oe,ze,"⪹","\\precnapprox",!0),U(Q,Oe,ze,"≁","\\nsim",!0),U(Q,Oe,ze,"","\\@nshortmid"),U(Q,Oe,ze,"∤","\\nmid",!0),U(Q,Oe,ze,"⊬","\\nvdash",!0),U(Q,Oe,ze,"⊭","\\nvDash",!0),U(Q,Oe,ze,"⋪","\\ntriangleleft"),U(Q,Oe,ze,"⋬","\\ntrianglelefteq",!0),U(Q,Oe,ze,"⊊","\\subsetneq",!0),U(Q,Oe,ze,"","\\@varsubsetneq"),U(Q,Oe,ze,"⫋","\\subsetneqq",!0),U(Q,Oe,ze,"","\\@varsubsetneqq"),U(Q,Oe,ze,"≯","\\ngtr",!0),U(Q,Oe,ze,"","\\@ngeqslant"),U(Q,Oe,ze,"","\\@ngeqq"),U(Q,Oe,ze,"⪈","\\gneq",!0),U(Q,Oe,ze,"≩","\\gneqq",!0),U(Q,Oe,ze,"","\\@gvertneqq"),U(Q,Oe,ze,"⋧","\\gnsim",!0),U(Q,Oe,ze,"⪊","\\gnapprox",!0),U(Q,Oe,ze,"⊁","\\nsucc",!0),U(Q,Oe,ze,"⋡","\\nsucceq",!0),U(Q,Oe,ze,"⋩","\\succnsim",!0),U(Q,Oe,ze,"⪺","\\succnapprox",!0),U(Q,Oe,ze,"≆","\\ncong",!0),U(Q,Oe,ze,"","\\@nshortparallel"),U(Q,Oe,ze,"∦","\\nparallel",!0),U(Q,Oe,ze,"⊯","\\nVDash",!0),U(Q,Oe,ze,"⋫","\\ntriangleright"),U(Q,Oe,ze,"⋭","\\ntrianglerighteq",!0),U(Q,Oe,ze,"","\\@nsupseteqq"),U(Q,Oe,ze,"⊋","\\supsetneq",!0),U(Q,Oe,ze,"","\\@varsupsetneq"),U(Q,Oe,ze,"⫌","\\supsetneqq",!0),U(Q,Oe,ze,"","\\@varsupsetneqq"),U(Q,Oe,ze,"⊮","\\nVdash",!0),U(Q,Oe,ze,"⪵","\\precneqq",!0),U(Q,Oe,ze,"⪶","\\succneqq",!0),U(Q,Oe,ze,"","\\@nsubseteqq"),U(Q,Oe,Xt,"⊴","\\unlhd"),U(Q,Oe,Xt,"⊵","\\unrhd"),U(Q,Oe,ze,"↚","\\nleftarrow",!0),U(Q,Oe,ze,"↛","\\nrightarrow",!0),U(Q,Oe,ze,"⇍","\\nLeftarrow",!0),U(Q,Oe,ze,"⇏","\\nRightarrow",!0),U(Q,Oe,ze,"↮","\\nleftrightarrow",!0),U(Q,Oe,ze,"⇎","\\nLeftrightarrow",!0),U(Q,Oe,ze,"△","\\vartriangle"),U(Q,Oe,Ye,"ℏ","\\hslash"),U(Q,Oe,Ye,"▽","\\triangledown"),U(Q,Oe,Ye,"◊","\\lozenge"),U(Q,Oe,Ye,"Ⓢ","\\circledS"),U(Q,Oe,Ye,"®","\\circledR"),U(kt,Oe,Ye,"®","\\circledR"),U(Q,Oe,Ye,"∡","\\measuredangle",!0),U(Q,Oe,Ye,"∄","\\nexists"),U(Q,Oe,Ye,"℧","\\mho"),U(Q,Oe,Ye,"Ⅎ","\\Finv",!0),U(Q,Oe,Ye,"⅁","\\Game",!0),U(Q,Oe,Ye,"‵","\\backprime"),U(Q,Oe,Ye,"▲","\\blacktriangle"),U(Q,Oe,Ye,"▼","\\blacktriangledown"),U(Q,Oe,Ye,"■","\\blacksquare"),U(Q,Oe,Ye,"⧫","\\blacklozenge"),U(Q,Oe,Ye,"★","\\bigstar"),U(Q,Oe,Ye,"∢","\\sphericalangle",!0),U(Q,Oe,Ye,"∁","\\complement",!0),U(Q,Oe,Ye,"ð","\\eth",!0),U(kt,he,Ye,"ð","ð"),U(Q,Oe,Ye,"╱","\\diagup"),U(Q,Oe,Ye,"╲","\\diagdown"),U(Q,Oe,Ye,"□","\\square"),U(Q,Oe,Ye,"□","\\Box"),U(Q,Oe,Ye,"◊","\\Diamond"),U(Q,Oe,Ye,"¥","\\yen",!0),U(kt,Oe,Ye,"¥","\\yen",!0),U(Q,Oe,Ye,"✓","\\checkmark",!0),U(kt,Oe,Ye,"✓","\\checkmark"),U(Q,Oe,Ye,"ℶ","\\beth",!0),U(Q,Oe,Ye,"ℸ","\\daleth",!0),U(Q,Oe,Ye,"ℷ","\\gimel",!0),U(Q,Oe,Ye,"ϝ","\\digamma",!0),U(Q,Oe,Ye,"ϰ","\\varkappa"),U(Q,Oe,zs,"┌","\\@ulcorner",!0),U(Q,Oe,Ya,"┐","\\@urcorner",!0),U(Q,Oe,zs,"└","\\@llcorner",!0),U(Q,Oe,Ya,"┘","\\@lrcorner",!0),U(Q,Oe,ze,"≦","\\leqq",!0),U(Q,Oe,ze,"⩽","\\leqslant",!0),U(Q,Oe,ze,"⪕","\\eqslantless",!0),U(Q,Oe,ze,"≲","\\lesssim",!0),U(Q,Oe,ze,"⪅","\\lessapprox",!0),U(Q,Oe,ze,"≊","\\approxeq",!0),U(Q,Oe,Xt,"⋖","\\lessdot"),U(Q,Oe,ze,"⋘","\\lll",!0),U(Q,Oe,ze,"≶","\\lessgtr",!0),U(Q,Oe,ze,"⋚","\\lesseqgtr",!0),U(Q,Oe,ze,"⪋","\\lesseqqgtr",!0),U(Q,Oe,ze,"≑","\\doteqdot"),U(Q,Oe,ze,"≓","\\risingdotseq",!0),U(Q,Oe,ze,"≒","\\fallingdotseq",!0),U(Q,Oe,ze,"∽","\\backsim",!0),U(Q,Oe,ze,"⋍","\\backsimeq",!0),U(Q,Oe,ze,"⫅","\\subseteqq",!0),U(Q,Oe,ze,"⋐","\\Subset",!0),U(Q,Oe,ze,"⊏","\\sqsubset",!0),U(Q,Oe,ze,"≼","\\preccurlyeq",!0),U(Q,Oe,ze,"⋞","\\curlyeqprec",!0),U(Q,Oe,ze,"≾","\\precsim",!0),U(Q,Oe,ze,"⪷","\\precapprox",!0),U(Q,Oe,ze,"⊲","\\vartriangleleft"),U(Q,Oe,ze,"⊴","\\trianglelefteq"),U(Q,Oe,ze,"⊨","\\vDash",!0),U(Q,Oe,ze,"⊪","\\Vvdash",!0),U(Q,Oe,ze,"⌣","\\smallsmile"),U(Q,Oe,ze,"⌢","\\smallfrown"),U(Q,Oe,ze,"≏","\\bumpeq",!0),U(Q,Oe,ze,"≎","\\Bumpeq",!0),U(Q,Oe,ze,"≧","\\geqq",!0),U(Q,Oe,ze,"⩾","\\geqslant",!0),U(Q,Oe,ze,"⪖","\\eqslantgtr",!0),U(Q,Oe,ze,"≳","\\gtrsim",!0),U(Q,Oe,ze,"⪆","\\gtrapprox",!0),U(Q,Oe,Xt,"⋗","\\gtrdot"),U(Q,Oe,ze,"⋙","\\ggg",!0),U(Q,Oe,ze,"≷","\\gtrless",!0),U(Q,Oe,ze,"⋛","\\gtreqless",!0),U(Q,Oe,ze,"⪌","\\gtreqqless",!0),U(Q,Oe,ze,"≖","\\eqcirc",!0),U(Q,Oe,ze,"≗","\\circeq",!0),U(Q,Oe,ze,"≜","\\triangleq",!0),U(Q,Oe,ze,"∼","\\thicksim"),U(Q,Oe,ze,"≈","\\thickapprox"),U(Q,Oe,ze,"⫆","\\supseteqq",!0),U(Q,Oe,ze,"⋑","\\Supset",!0),U(Q,Oe,ze,"⊐","\\sqsupset",!0),U(Q,Oe,ze,"≽","\\succcurlyeq",!0),U(Q,Oe,ze,"⋟","\\curlyeqsucc",!0),U(Q,Oe,ze,"≿","\\succsim",!0),U(Q,Oe,ze,"⪸","\\succapprox",!0),U(Q,Oe,ze,"⊳","\\vartriangleright"),U(Q,Oe,ze,"⊵","\\trianglerighteq"),U(Q,Oe,ze,"⊩","\\Vdash",!0),U(Q,Oe,ze,"∣","\\shortmid"),U(Q,Oe,ze,"∥","\\shortparallel"),U(Q,Oe,ze,"≬","\\between",!0),U(Q,Oe,ze,"⋔","\\pitchfork",!0),U(Q,Oe,ze,"∝","\\varpropto"),U(Q,Oe,ze,"◀","\\blacktriangleleft"),U(Q,Oe,ze,"∴","\\therefore",!0),U(Q,Oe,ze,"∍","\\backepsilon"),U(Q,Oe,ze,"▶","\\blacktriangleright"),U(Q,Oe,ze,"∵","\\because",!0),U(Q,Oe,ze,"⋘","\\llless"),U(Q,Oe,ze,"⋙","\\gggtr"),U(Q,Oe,Xt,"⊲","\\lhd"),U(Q,Oe,Xt,"⊳","\\rhd"),U(Q,Oe,ze,"≂","\\eqsim",!0),U(Q,he,ze,"⋈","\\Join"),U(Q,Oe,ze,"≑","\\Doteq",!0),U(Q,Oe,Xt,"∔","\\dotplus",!0),U(Q,Oe,Xt,"∖","\\smallsetminus"),U(Q,Oe,Xt,"⋒","\\Cap",!0),U(Q,Oe,Xt,"⋓","\\Cup",!0),U(Q,Oe,Xt,"⩞","\\doublebarwedge",!0),U(Q,Oe,Xt,"⊟","\\boxminus",!0),U(Q,Oe,Xt,"⊞","\\boxplus",!0),U(Q,Oe,Xt,"⋇","\\divideontimes",!0),U(Q,Oe,Xt,"⋉","\\ltimes",!0),U(Q,Oe,Xt,"⋊","\\rtimes",!0),U(Q,Oe,Xt,"⋋","\\leftthreetimes",!0),U(Q,Oe,Xt,"⋌","\\rightthreetimes",!0),U(Q,Oe,Xt,"⋏","\\curlywedge",!0),U(Q,Oe,Xt,"⋎","\\curlyvee",!0),U(Q,Oe,Xt,"⊝","\\circleddash",!0),U(Q,Oe,Xt,"⊛","\\circledast",!0),U(Q,Oe,Xt,"⋅","\\centerdot"),U(Q,Oe,Xt,"⊺","\\intercal",!0),U(Q,Oe,Xt,"⋒","\\doublecap"),U(Q,Oe,Xt,"⋓","\\doublecup"),U(Q,Oe,Xt,"⊠","\\boxtimes",!0),U(Q,Oe,ze,"⇢","\\dashrightarrow",!0),U(Q,Oe,ze,"⇠","\\dashleftarrow",!0),U(Q,Oe,ze,"⇇","\\leftleftarrows",!0),U(Q,Oe,ze,"⇆","\\leftrightarrows",!0),U(Q,Oe,ze,"⇚","\\Lleftarrow",!0),U(Q,Oe,ze,"↞","\\twoheadleftarrow",!0),U(Q,Oe,ze,"↢","\\leftarrowtail",!0),U(Q,Oe,ze,"↫","\\looparrowleft",!0),U(Q,Oe,ze,"⇋","\\leftrightharpoons",!0),U(Q,Oe,ze,"↶","\\curvearrowleft",!0),U(Q,Oe,ze,"↺","\\circlearrowleft",!0),U(Q,Oe,ze,"↰","\\Lsh",!0),U(Q,Oe,ze,"⇈","\\upuparrows",!0),U(Q,Oe,ze,"↿","\\upharpoonleft",!0),U(Q,Oe,ze,"⇃","\\downharpoonleft",!0),U(Q,he,ze,"⊶","\\origof",!0),U(Q,he,ze,"⊷","\\imageof",!0),U(Q,Oe,ze,"⊸","\\multimap",!0),U(Q,Oe,ze,"↭","\\leftrightsquigarrow",!0),U(Q,Oe,ze,"⇉","\\rightrightarrows",!0),U(Q,Oe,ze,"⇄","\\rightleftarrows",!0),U(Q,Oe,ze,"↠","\\twoheadrightarrow",!0),U(Q,Oe,ze,"↣","\\rightarrowtail",!0),U(Q,Oe,ze,"↬","\\looparrowright",!0),U(Q,Oe,ze,"↷","\\curvearrowright",!0),U(Q,Oe,ze,"↻","\\circlearrowright",!0),U(Q,Oe,ze,"↱","\\Rsh",!0),U(Q,Oe,ze,"⇊","\\downdownarrows",!0),U(Q,Oe,ze,"↾","\\upharpoonright",!0),U(Q,Oe,ze,"⇂","\\downharpoonright",!0),U(Q,Oe,ze,"⇝","\\rightsquigarrow",!0),U(Q,Oe,ze,"⇝","\\leadsto"),U(Q,Oe,ze,"⇛","\\Rrightarrow",!0),U(Q,Oe,ze,"↾","\\restriction"),U(Q,he,Ye,"‘","`"),U(Q,he,Ye,"$","\\$"),U(kt,he,Ye,"$","\\$"),U(kt,he,Ye,"$","\\textdollar"),U(Q,he,Ye,"%","\\%"),U(kt,he,Ye,"%","\\%"),U(Q,he,Ye,"_","\\_"),U(kt,he,Ye,"_","\\_"),U(kt,he,Ye,"_","\\textunderscore"),U(Q,he,Ye,"∠","\\angle",!0),U(Q,he,Ye,"∞","\\infty",!0),U(Q,he,Ye,"′","\\prime"),U(Q,he,Ye,"△","\\triangle"),U(Q,he,Ye,"Γ","\\Gamma",!0),U(Q,he,Ye,"Δ","\\Delta",!0),U(Q,he,Ye,"Θ","\\Theta",!0),U(Q,he,Ye,"Λ","\\Lambda",!0),U(Q,he,Ye,"Ξ","\\Xi",!0),U(Q,he,Ye,"Π","\\Pi",!0),U(Q,he,Ye,"Σ","\\Sigma",!0),U(Q,he,Ye,"Υ","\\Upsilon",!0),U(Q,he,Ye,"Φ","\\Phi",!0),U(Q,he,Ye,"Ψ","\\Psi",!0),U(Q,he,Ye,"Ω","\\Omega",!0),U(Q,he,Ye,"A","Α"),U(Q,he,Ye,"B","Β"),U(Q,he,Ye,"E","Ε"),U(Q,he,Ye,"Z","Ζ"),U(Q,he,Ye,"H","Η"),U(Q,he,Ye,"I","Ι"),U(Q,he,Ye,"K","Κ"),U(Q,he,Ye,"M","Μ"),U(Q,he,Ye,"N","Ν"),U(Q,he,Ye,"O","Ο"),U(Q,he,Ye,"P","Ρ"),U(Q,he,Ye,"T","Τ"),U(Q,he,Ye,"X","Χ"),U(Q,he,Ye,"¬","\\neg",!0),U(Q,he,Ye,"¬","\\lnot"),U(Q,he,Ye,"⊤","\\top"),U(Q,he,Ye,"⊥","\\bot"),U(Q,he,Ye,"∅","\\emptyset"),U(Q,Oe,Ye,"∅","\\varnothing"),U(Q,he,mr,"α","\\alpha",!0),U(Q,he,mr,"β","\\beta",!0),U(Q,he,mr,"γ","\\gamma",!0),U(Q,he,mr,"δ","\\delta",!0),U(Q,he,mr,"ϵ","\\epsilon",!0),U(Q,he,mr,"ζ","\\zeta",!0),U(Q,he,mr,"η","\\eta",!0),U(Q,he,mr,"θ","\\theta",!0),U(Q,he,mr,"ι","\\iota",!0),U(Q,he,mr,"κ","\\kappa",!0),U(Q,he,mr,"λ","\\lambda",!0),U(Q,he,mr,"μ","\\mu",!0),U(Q,he,mr,"ν","\\nu",!0),U(Q,he,mr,"ξ","\\xi",!0),U(Q,he,mr,"ο","\\omicron",!0),U(Q,he,mr,"π","\\pi",!0),U(Q,he,mr,"ρ","\\rho",!0),U(Q,he,mr,"σ","\\sigma",!0),U(Q,he,mr,"τ","\\tau",!0),U(Q,he,mr,"υ","\\upsilon",!0),U(Q,he,mr,"ϕ","\\phi",!0),U(Q,he,mr,"χ","\\chi",!0),U(Q,he,mr,"ψ","\\psi",!0),U(Q,he,mr,"ω","\\omega",!0),U(Q,he,mr,"ε","\\varepsilon",!0),U(Q,he,mr,"ϑ","\\vartheta",!0),U(Q,he,mr,"ϖ","\\varpi",!0),U(Q,he,mr,"ϱ","\\varrho",!0),U(Q,he,mr,"ς","\\varsigma",!0),U(Q,he,mr,"φ","\\varphi",!0),U(Q,he,Xt,"∗","*",!0),U(Q,he,Xt,"+","+"),U(Q,he,Xt,"−","-",!0),U(Q,he,Xt,"⋅","\\cdot",!0),U(Q,he,Xt,"∘","\\circ",!0),U(Q,he,Xt,"÷","\\div",!0),U(Q,he,Xt,"±","\\pm",!0),U(Q,he,Xt,"×","\\times",!0),U(Q,he,Xt,"∩","\\cap",!0),U(Q,he,Xt,"∪","\\cup",!0),U(Q,he,Xt,"∖","\\setminus",!0),U(Q,he,Xt,"∧","\\land"),U(Q,he,Xt,"∨","\\lor"),U(Q,he,Xt,"∧","\\wedge",!0),U(Q,he,Xt,"∨","\\vee",!0),U(Q,he,Ye,"√","\\surd"),U(Q,he,zs,"⟨","\\langle",!0),U(Q,he,zs,"∣","\\lvert"),U(Q,he,zs,"∥","\\lVert"),U(Q,he,Ya,"?","?"),U(Q,he,Ya,"!","!"),U(Q,he,Ya,"⟩","\\rangle",!0),U(Q,he,Ya,"∣","\\rvert"),U(Q,he,Ya,"∥","\\rVert"),U(Q,he,ze,"=","="),U(Q,he,ze,":",":"),U(Q,he,ze,"≈","\\approx",!0),U(Q,he,ze,"≅","\\cong",!0),U(Q,he,ze,"≥","\\ge"),U(Q,he,ze,"≥","\\geq",!0),U(Q,he,ze,"←","\\gets"),U(Q,he,ze,">","\\gt",!0),U(Q,he,ze,"∈","\\in",!0),U(Q,he,ze,"","\\@not"),U(Q,he,ze,"⊂","\\subset",!0),U(Q,he,ze,"⊃","\\supset",!0),U(Q,he,ze,"⊆","\\subseteq",!0),U(Q,he,ze,"⊇","\\supseteq",!0),U(Q,Oe,ze,"⊈","\\nsubseteq",!0),U(Q,Oe,ze,"⊉","\\nsupseteq",!0),U(Q,he,ze,"⊨","\\models"),U(Q,he,ze,"←","\\leftarrow",!0),U(Q,he,ze,"≤","\\le"),U(Q,he,ze,"≤","\\leq",!0),U(Q,he,ze,"<","\\lt",!0),U(Q,he,ze,"→","\\rightarrow",!0),U(Q,he,ze,"→","\\to"),U(Q,Oe,ze,"≱","\\ngeq",!0),U(Q,Oe,ze,"≰","\\nleq",!0),U(Q,he,Rc," ","\\ "),U(Q,he,Rc," ","\\space"),U(Q,he,Rc," ","\\nobreakspace"),U(kt,he,Rc," ","\\ "),U(kt,he,Rc," "," "),U(kt,he,Rc," ","\\space"),U(kt,he,Rc," ","\\nobreakspace"),U(Q,he,Rc,"","\\nobreak"),U(Q,he,Rc,"","\\allowbreak"),U(Q,he,pb,",",","),U(Q,he,pb,";",";"),U(Q,Oe,Xt,"⊼","\\barwedge",!0),U(Q,Oe,Xt,"⊻","\\veebar",!0),U(Q,he,Xt,"⊙","\\odot",!0),U(Q,he,Xt,"⊕","\\oplus",!0),U(Q,he,Xt,"⊗","\\otimes",!0),U(Q,he,Ye,"∂","\\partial",!0),U(Q,he,Xt,"⊘","\\oslash",!0),U(Q,Oe,Xt,"⊚","\\circledcirc",!0),U(Q,Oe,Xt,"⊡","\\boxdot",!0),U(Q,he,Xt,"△","\\bigtriangleup"),U(Q,he,Xt,"▽","\\bigtriangledown"),U(Q,he,Xt,"†","\\dagger"),U(Q,he,Xt,"⋄","\\diamond"),U(Q,he,Xt,"⋆","\\star"),U(Q,he,Xt,"◃","\\triangleleft"),U(Q,he,Xt,"▹","\\triangleright"),U(Q,he,zs,"{","\\{"),U(kt,he,Ye,"{","\\{"),U(kt,he,Ye,"{","\\textbraceleft"),U(Q,he,Ya,"}","\\}"),U(kt,he,Ye,"}","\\}"),U(kt,he,Ye,"}","\\textbraceright"),U(Q,he,zs,"{","\\lbrace"),U(Q,he,Ya,"}","\\rbrace"),U(Q,he,zs,"[","\\lbrack",!0),U(kt,he,Ye,"[","\\lbrack",!0),U(Q,he,Ya,"]","\\rbrack",!0),U(kt,he,Ye,"]","\\rbrack",!0),U(Q,he,zs,"(","\\lparen",!0),U(Q,he,Ya,")","\\rparen",!0),U(kt,he,Ye,"<","\\textless",!0),U(kt,he,Ye,">","\\textgreater",!0),U(Q,he,zs,"⌊","\\lfloor",!0),U(Q,he,Ya,"⌋","\\rfloor",!0),U(Q,he,zs,"⌈","\\lceil",!0),U(Q,he,Ya,"⌉","\\rceil",!0),U(Q,he,Ye,"\\","\\backslash"),U(Q,he,Ye,"∣","|"),U(Q,he,Ye,"∣","\\vert"),U(kt,he,Ye,"|","\\textbar",!0),U(Q,he,Ye,"∥","\\|"),U(Q,he,Ye,"∥","\\Vert"),U(kt,he,Ye,"∥","\\textbardbl"),U(kt,he,Ye,"~","\\textasciitilde"),U(kt,he,Ye,"\\","\\textbackslash"),U(kt,he,Ye,"^","\\textasciicircum"),U(Q,he,ze,"↑","\\uparrow",!0),U(Q,he,ze,"⇑","\\Uparrow",!0),U(Q,he,ze,"↓","\\downarrow",!0),U(Q,he,ze,"⇓","\\Downarrow",!0),U(Q,he,ze,"↕","\\updownarrow",!0),U(Q,he,ze,"⇕","\\Updownarrow",!0),U(Q,he,xi,"∐","\\coprod"),U(Q,he,xi,"⋁","\\bigvee"),U(Q,he,xi,"⋀","\\bigwedge"),U(Q,he,xi,"⨄","\\biguplus"),U(Q,he,xi,"⋂","\\bigcap"),U(Q,he,xi,"⋃","\\bigcup"),U(Q,he,xi,"∫","\\int"),U(Q,he,xi,"∫","\\intop"),U(Q,he,xi,"∬","\\iint"),U(Q,he,xi,"∭","\\iiint"),U(Q,he,xi,"∏","\\prod"),U(Q,he,xi,"∑","\\sum"),U(Q,he,xi,"⨂","\\bigotimes"),U(Q,he,xi,"⨁","\\bigoplus"),U(Q,he,xi,"⨀","\\bigodot"),U(Q,he,xi,"∮","\\oint"),U(Q,he,xi,"∯","\\oiint"),U(Q,he,xi,"∰","\\oiiint"),U(Q,he,xi,"⨆","\\bigsqcup"),U(Q,he,xi,"∫","\\smallint"),U(kt,he,u0,"…","\\textellipsis"),U(Q,he,u0,"…","\\mathellipsis"),U(kt,he,u0,"…","\\ldots",!0),U(Q,he,u0,"…","\\ldots",!0),U(Q,he,u0,"⋯","\\@cdots",!0),U(Q,he,u0,"⋱","\\ddots",!0),U(Q,he,Ye,"⋮","\\varvdots"),U(kt,he,Ye,"⋮","\\varvdots"),U(Q,he,Yn,"ˊ","\\acute"),U(Q,he,Yn,"ˋ","\\grave"),U(Q,he,Yn,"¨","\\ddot"),U(Q,he,Yn,"~","\\tilde"),U(Q,he,Yn,"ˉ","\\bar"),U(Q,he,Yn,"˘","\\breve"),U(Q,he,Yn,"ˇ","\\check"),U(Q,he,Yn,"^","\\hat"),U(Q,he,Yn,"⃗","\\vec"),U(Q,he,Yn,"˙","\\dot"),U(Q,he,Yn,"˚","\\mathring"),U(Q,he,mr,"","\\@imath"),U(Q,he,mr,"","\\@jmath"),U(Q,he,Ye,"ı","ı"),U(Q,he,Ye,"ȷ","ȷ"),U(kt,he,Ye,"ı","\\i",!0),U(kt,he,Ye,"ȷ","\\j",!0),U(kt,he,Ye,"ß","\\ss",!0),U(kt,he,Ye,"æ","\\ae",!0),U(kt,he,Ye,"œ","\\oe",!0),U(kt,he,Ye,"ø","\\o",!0),U(kt,he,Ye,"Æ","\\AE",!0),U(kt,he,Ye,"Œ","\\OE",!0),U(kt,he,Ye,"Ø","\\O",!0),U(kt,he,Yn,"ˊ","\\'"),U(kt,he,Yn,"ˋ","\\`"),U(kt,he,Yn,"ˆ","\\^"),U(kt,he,Yn,"˜","\\~"),U(kt,he,Yn,"ˉ","\\="),U(kt,he,Yn,"˘","\\u"),U(kt,he,Yn,"˙","\\."),U(kt,he,Yn,"¸","\\c"),U(kt,he,Yn,"˚","\\r"),U(kt,he,Yn,"ˇ","\\v"),U(kt,he,Yn,"¨",'\\"'),U(kt,he,Yn,"˝","\\H"),U(kt,he,Yn,"◯","\\textcircled");var AY={"--":!0,"---":!0,"``":!0,"''":!0};U(kt,he,Ye,"–","--",!0),U(kt,he,Ye,"–","\\textendash"),U(kt,he,Ye,"—","---",!0),U(kt,he,Ye,"—","\\textemdash"),U(kt,he,Ye,"‘","`",!0),U(kt,he,Ye,"‘","\\textquoteleft"),U(kt,he,Ye,"’","'",!0),U(kt,he,Ye,"’","\\textquoteright"),U(kt,he,Ye,"“","``",!0),U(kt,he,Ye,"“","\\textquotedblleft"),U(kt,he,Ye,"”","''",!0),U(kt,he,Ye,"”","\\textquotedblright"),U(Q,he,Ye,"°","\\degree",!0),U(kt,he,Ye,"°","\\degree"),U(kt,he,Ye,"°","\\textdegree",!0),U(Q,he,Ye,"£","\\pounds"),U(Q,he,Ye,"£","\\mathsterling",!0),U(kt,he,Ye,"£","\\pounds"),U(kt,he,Ye,"£","\\textsterling",!0),U(Q,Oe,Ye,"✠","\\maltese"),U(kt,Oe,Ye,"✠","\\maltese");for(var _Y='0123456789/@."',S7=0;S7<_Y.length;S7++){var RY=_Y.charAt(S7);U(Q,he,Ye,RY,RY)}for(var LY='0123456789!@*()-=+";:?/.,',A7=0;A7{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return BY[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return z8e[a]}else{if(n===120485||n===120486)return BY[0];if(120486{if(Bu(t.classes)!==Bu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},FY=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},_t=function(e,r,n,i){var a=new c0(e,r,n,i);return $7(a),a},Gu=(t,e,r,n)=>new c0(t,e,r,n),h0=function(e,r,n){var i=_t([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Pt(i.height),i.maxFontSize=1,i},W8e=function(e,r,n,i){var a=new CC(e,r,n,i);return $7(a),a},Lc=function(e){var r=new l0(e);return $7(r),r},d0=function(e,r){return e instanceof l0?_t([],[e],r):e},U8e=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=_t(["mspace"],[],e),n=jn(t,e);return r.style.marginRight=Pt(n),r},LC=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},P7={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},GY={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},qY=function(e,r){var[n,i,a]=GY[e],s=new Fu(n),o=new _c([s],{width:Pt(i),height:Pt(a),style:"width:"+Pt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Gu(["overlay"],[o],r);return l.height=a,l.style.height=Pt(a),l.style.width=Pt(i),l},Zn={number:3,unit:"mu"},vd={number:4,unit:"mu"},Ic={number:5,unit:"mu"},H8e={mord:{mop:Zn,mbin:vd,mrel:Ic,minner:Zn},mop:{mord:Zn,mop:Zn,mrel:Ic,minner:Zn},mbin:{mord:vd,mop:vd,mopen:vd,minner:vd},mrel:{mord:Ic,mop:Ic,mopen:Ic,minner:Ic},mopen:{},mclose:{mop:Zn,mbin:vd,mrel:Ic,minner:Zn},mpunct:{mord:Zn,mop:Zn,mrel:Ic,mopen:Zn,mclose:Zn,mpunct:Zn,minner:Zn},minner:{mord:Zn,mop:Zn,mbin:vd,mrel:Ic,mopen:Zn,mpunct:Zn,minner:Zn}},Y8e={mord:{mop:Zn},mop:{mord:Zn,mop:Zn},mbin:{},mrel:{},mopen:{},mclose:{mop:Zn},mpunct:{},minner:{mop:Zn}},VY={},IC={},DC={};function Wt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&K8e.has(v)?m.classes[0]="mord":v==="mbin"&&X8e.has(y)&&(g.classes[0]="mord")},{node:d},f,p),B7(a,(g,m)=>{var y,v,x=z7(m),b=z7(g),w=x&&b?g.hasClass("mtight")?(y=Y8e[x])==null?void 0:y[b]:(v=H8e[x])==null?void 0:v[b]:null;if(w)return zY(w,u)},{node:d},f,p),a},B7=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},WY=function(e){return e instanceof l0||e instanceof CC||e instanceof c0&&e.hasClass("enclosing")?e:null},F7=function(e,r){var n=WY(e);if(n){var i=n.children;if(i.length){if(r==="right")return F7(i[i.length-1],"right");if(r==="left")return F7(i[0],"left")}}return e},z7=function(e,r){if(!e)return null;r&&(e=F7(e,r));var n=e.classes[0];return Z8e[n]||null},gb=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return _t(r.concat(n))},sn=function(e,r,n){if(!e)return _t();if(IC[e.type]){var i=IC[e.type](e,r);if(n&&r.size!==n.size){i=_t(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Mt("Got group of unknown type: '"+e.type+"'")};function NC(t,e){var r=_t(["base"],t,e),n=_t(["strut"]);return n.style.height=Pt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Pt(-r.depth)),r.children.unshift(n),r}function G7(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Oi(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(NC(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(NC(s,e));var u;r?(u=NC(Oi(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=_t(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Pt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Pt(-h.depth))}return h}function UY(t){return new l0(t)}class Nt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Bu(this.classes));for(var n=0;n0&&(e+=' class ="'+Ia(Bu(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class wi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ia(this.toText())}toText(){return this.text}}class HY{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Pt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Q8e=new Set(["\\imath","\\jmath"]),J8e=new Set(["mrow","mtable"]),oo=function(e,r,n){return Hn[r][e]&&Hn[r][e].replace&&e.charCodeAt(0)!==55349&&!(AY.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Hn[r][e].replace),new wi(e)},q7=function(e){return e.length===1?e[0]:new Nt("mrow",e)},eLe={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},V7=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=eLe[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(Q8e.has(a))return null;if(Hn[n][a]){var s=Hn[n][a].replace;s&&(a=s)}var o=P7[r].fontName;return k7(a,o,n)?P7[r].variant:null};function W7(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof wi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof wi&&r.text===","}else return!1}var Gs=function(e,r,n){if(e.length===1){var i=wn(e[0],r);return n&&i instanceof Nt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||W7(s))){var u=l.children[0];u instanceof Nt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof wi&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof wi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},qu=function(e,r,n){return q7(Gs(e,r,n))},wn=function(e,r){if(!e)return new Nt("mrow");if(DC[e.type])return DC[e.type](e,r);throw new Mt("Got group of unknown type: '"+e.type+"'")};function YY(t,e,r,n,i){var a=Gs(t,r),s;a.length===1&&a[0]instanceof Nt&&J8e.has(a[0].type)?s=a[0]:s=new Nt("mrow",a);var o=new Nt("annotation",[new wi(e)]);o.setAttribute("encoding","application/x-tex");var l=new Nt("semantics",[s,o]),u=new Nt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return _t([h],[u])}var tLe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],XY=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],KY=function(e,r){return r.size<2?e:tLe[e-1][r.size-1]};class Dc{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Dc.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=XY[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Dc(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:KY(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:XY[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=KY(Dc.BASESIZE,e);return this.size===r&&this.textSize===Dc.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Dc.BASESIZE?["sizing","reset-size"+this.size,"size"+Dc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=B8e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Dc.BASESIZE=6;var jY=function(e){return new Dc({style:e.displayMode?Dr.DISPLAY:Dr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ZY=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=_t(n,[e])}return e},rLe=function(e,r,n){var i=jY(n),a;if(n.output==="mathml")return YY(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=G7(e,i);a=_t(["katex"],[s])}else{var o=YY(e,r,i,n.displayMode,!1),l=G7(e,i);a=_t(["katex"],[o,l])}return ZY(a,n)},nLe=function(e,r,n){var i=jY(n),a=G7(e,i),s=_t(["katex"],[a]);return ZY(s,n)},iLe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},OC=function(e){var r=new Nt("mo",[new wi(iLe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},aLe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},sLe=new Set(["widehat","widecheck","widetilde","utilde"]),$C=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(sLe.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Fu(d),m=new _c([g],{width:"100%",height:Pt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Gu([],[m],r),minWidth:0,height:f}}else{var y=[],v=aLe[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,w]=v,k=w/1e3,S=x.length,C,_;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],_=[v[3]]}else if(S===2)C=["halfarrow-left","halfarrow-right"],_=["xMinYMin","xMaxYMin"];else if(S===3)C=["brace-left","brace-center","brace-right"],_=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+S+" children.");for(var L=0;L0&&(i.style.minWidth=Pt(a)),i},oLe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=_t(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new C7({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new C7({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new _c(u,{width:"100%",height:Pt(o)});s=Gu([],[h],a)}return s.height=o,s.style.height=Pt(o),s},lLe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},cLe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function uLe(t){return t in lLe}function $r(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function PC(t){var e=BC(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function BC(t){return t&&(t.type==="atom"||cLe.hasOwnProperty(t.type))?t:null}var QY=t=>{if(t instanceof Fs)return t;if(P8e(t)&&t.children.length===1)return QY(t.children[0])},U7=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=$r(t.base,"accent"),r=n.base,t.base=r,i=$8e(sn(t,e)),t.base=n):(n=$r(t,"accent"),r=n.base);var a=sn(r,e.havingCrampedStyle()),s=n.isShifty&&Sc(r),o=0;if(s){var l,u;o=(l=(u=QY(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=$C(n,e),f=an({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Pt(2*o)+")",marginLeft:Pt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=qY("vec",e),g=GY.vec[1]):(p=RC({mode:n.mode,text:n.label},e,"textord"),p=O8e(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=_t(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=Pt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=an({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=_t(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},JY=(t,e)=>{var r=t.isStretchy?OC(t.label):new Nt("mo",[oo(t.label,t.mode)]),n=new Nt("mover",[wn(t.base,e),r]);return n.setAttribute("accent","true"),n},hLe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Wt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=MC(e[0]),n=!hLe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:U7,mathmlBuilder:JY}),Wt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:U7,mathmlBuilder:JY}),Wt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=sn(t.base,e),n=$C(t,e),i=t.label==="\\utilde"?.12:0,a=an({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return _t(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=OC(t.label),n=new Nt("munder",[wn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var FC=t=>{var e=new Nt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Wt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=d0(sn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=d0(sn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=$C(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=an({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=an({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return _t(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=OC(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=FC(wn(t.body,e));if(t.below){var a=FC(wn(t.below,e));n=new Nt("munderover",[r,a,i])}else n=new Nt("mover",[r,i])}else if(t.below){var s=FC(wn(t.below,e));n=new Nt("munder",[r,s])}else n=FC(),n=new Nt("mover",[r,n]);return n}});function eX(t,e){var r=Oi(t.body,e,!0);return _t([t.mclass],r,e)}function tX(t,e){var r,n=Gs(t.body,e);return t.mclass==="minner"?r=new Nt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Nt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Nt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Wt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ti(i),isCharacterBox:Sc(i)}},htmlBuilder:eX,mathmlBuilder:tX});var zC=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Wt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:zC(e[0]),body:Ti(e[1]),isCharacterBox:Sc(e[1])}}}),Wt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=zC(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ti(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Sc(l)}},htmlBuilder:eX,mathmlBuilder:tX}),Wt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:zC(e[0]),body:Ti(e[0])}},htmlBuilder(t,e){var r=Oi(t.body,e,!0),n=_t([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Gs(t.body,e),n=new Nt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var dLe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},rX=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),nX=t=>t.type==="textord"&&t.text==="@",fLe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function pLe(t,e,r){var n=dLe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function gLe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Mt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=pLe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=rX()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Wt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=d0(sn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Pt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Nt("mrow",[wn(t.label,e)]);return r=new Nt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Nt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),Wt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=d0(sn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Nt("mrow",[wn(t.fragment,e)])}}),Wt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=$r(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Mt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var iX=(t,e)=>{var r=Oi(t.body,e.withColor(t.color),!1);return Lc(r)},aX=(t,e)=>{var r=Gs(t.body,e.withColor(t.color)),n=new Nt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Wt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=$r(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ti(i)}},htmlBuilder:iX,mathmlBuilder:aX}),Wt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=$r(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:iX,mathmlBuilder:aX}),Wt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&$r(i,"size").value}},htmlBuilder(t,e){var r=_t(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Pt(jn(t.size,e)))),r},mathmlBuilder(t,e){var r=new Nt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Pt(jn(t.size,e)))),r}});var H7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},sX=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Mt("Expected a control sequence",t);return e},mLe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},oX=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Wt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(H7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=H7[n.text]),$r(e.parseFunction(),"internal");throw new Mt("Invalid token after macro prefix",n)}}),Wt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Mt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Mt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Mt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Mt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===H7[r]),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=sX(e.gullet.popToken());e.gullet.consumeSpaces();var i=mLe(e);return oX(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=sX(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return oX(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var mb=function(e,r,n){var i=Hn.math[e]&&Hn.math[e].replace,a=k7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},Y7=function(e,r,n,i){var a=n.havingBaseStyle(r),s=_t(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},lX=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Pt(a),e.height-=a,e.depth+=a},yLe=function(e,r,n,i,a,s){var o=Ka(e,"Main-Regular",a,i),l=Y7(o,r,i,s);return lX(l,i,r),l},vLe=function(e,r,n,i){return Ka(e,"Size"+r+"-Regular",n,i)},cX=function(e,r,n,i,a,s){var o=vLe(e,r,a,i),l=Y7(_t(["delimsizing","size"+r],[o],i),Dr.TEXT,i,s);return n&&lX(l,i,Dr.TEXT),l},X7=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=_t(["delimsizinginner",i],[_t([],[Ka(e,r,n)])]);return{type:"elem",elem:a}},K7=function(e,r,n){var i=Tl["Size4-Regular"][e.charCodeAt(0)]?Tl["Size4-Regular"][e.charCodeAt(0)][4]:Tl["Size1-Regular"][e.charCodeAt(0)][4],a=new Fu("inner",_8e(e,Math.round(1e3*r))),s=new _c([a],{width:Pt(i),height:Pt(r),style:"width:"+Pt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Gu([],[s],n);return o.height=r,o.style.height=Pt(r),o.style.width=Pt(i),{type:"elem",elem:o}},j7=.008,GC={type:"kern",size:-1*j7},bLe=new Set(["|","\\lvert","\\rvert","\\vert"]),xLe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),uX=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):bLe.has(e)?(u="∣",d="vert",f=333):xLe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=mb(o,p,a),m=g.height+g.depth,y=mb(u,p,a),v=y.height+y.depth,x=mb(h,p,a),b=x.height+x.depth,w=0,k=1;if(l!==null){var S=mb(l,p,a);w=S.height+S.depth,k=2}var C=m+b+w,_=Math.max(0,Math.ceil((r-C)/(k*v))),L=C+_*k*v,O=i.fontMetrics().axisHeight;n&&(O*=i.sizeMultiplier);var D=L/2-O,z=[];if(d.length>0){var F=L-m-b,A=Math.round(L*1e3),R=R8e(d,Math.round(F*1e3)),N=new Fu(d,R),M=Pt(f/1e3),I=Pt(A/1e3),$=new _c([N],{width:M,height:I,viewBox:"0 0 "+f+" "+A}),P=Gu([],[$],i);P.height=A/1e3,P.style.width=M,P.style.height=I,z.push({type:"elem",elem:P})}else{if(z.push(X7(h,p,a)),z.push(GC),l===null){var B=L-m-b+2*j7;z.push(K7(u,B,i))}else{var q=(L-m-b-w)/2+2*j7;z.push(K7(u,q,i)),z.push(GC),z.push(X7(l,p,a)),z.push(GC),z.push(K7(u,q,i))}z.push(GC),z.push(X7(o,p,a))}var V=i.havingBaseStyle(Dr.TEXT),X=an({positionType:"bottom",positionData:D,children:z});return Y7(_t(["delimsizing","mult"],[X],V),Dr.TEXT,i,s)},Z7=80,Q7=.08,J7=function(e,r,n,i,a){var s=A8e(e,i,n),o=new Fu(e,s),l=new _c([o],{width:"400em",height:Pt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Gu(["hide-tail"],[l],a)},TLe=function(e,r){var n=r.havingBaseSizing(),i=gX("\\surd",e*n.sizeMultiplier,pX,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+Z7,e<1?a=1:e<1.4&&(a=.7),l=(1+s+Q7)/a,u=(1+s)/a,o=J7("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+Z7)*yb[i.size],u=(yb[i.size]+s)/a,l=(yb[i.size]+s+Q7)/a,o=J7("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+Q7,u=e+s,h=Math.floor(1e3*e+s)+Z7,o=J7("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Pt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},hX=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),wLe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),dX=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),yb=[0,1.2,1.8,2.4,3],fX=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),hX.has(e)||dX.has(e))return cX(e,r,!1,n,i,a);if(wLe.has(e))return uX(e,yb[r],!1,n,i,a);throw new Mt("Illegal delimiter: '"+e+"'")},CLe=[{type:"small",style:Dr.SCRIPTSCRIPT},{type:"small",style:Dr.SCRIPT},{type:"small",style:Dr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],kLe=[{type:"small",style:Dr.SCRIPTSCRIPT},{type:"small",style:Dr.SCRIPT},{type:"small",style:Dr.TEXT},{type:"stack"}],pX=[{type:"small",style:Dr.SCRIPTSCRIPT},{type:"small",style:Dr.SCRIPT},{type:"small",style:Dr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ELe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},gX=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},eR=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;dX.has(e)?o=CLe:hX.has(e)?o=pX:o=kLe;var l=gX(e,r,o,i);return l.type==="small"?yLe(e,l.style,n,i,a,s):l.type==="large"?cX(e,l.size,n,i,a,s):uX(e,r,n,i,a,s)},tR=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return eR(e,d,!0,i,a,s)},mX={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},SLe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function yX(t){return"isMiddle"in t}function qC(t,e){var r=BC(t);if(r&&SLe.has(r.text))return r;throw r?new Mt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Mt("Invalid delimiter type '"+t.type+"'",t)}Wt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=qC(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:mX[t.funcName].size,mclass:mX[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?_t([t.mclass]):fX(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(oo(t.delim,t.mode));var r=new Nt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Pt(yb[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function vX(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Wt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Mt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:qC(e[0],t).text,color:r}}}),Wt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=qC(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=$r(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{vX(t);for(var r=Oi(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{vX(t);var r=Gs(t.body,e);if(t.left!=="."){var n=new Nt("mo",[oo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Nt("mo",[oo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return q7(r)}}),Wt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=qC(e[0],t);if(!t.parser.leftrightDepth)throw new Mt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=gb(e,[]):(r=fX(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?oo("|","text"):oo(t.delim,t.mode),n=new Nt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var VC=(t,e)=>{var r=d0(sn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Sc(t.body);if(n==="sout")a=_t(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=jn({number:.6,unit:"pt"},e),u=jn({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Pt(d/2+l);var f=Math.floor(1e3*d*i),p=E8e(f),g=new _c([new Fu("phase",p)],{width:"400em",height:Pt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Gu(["hide-tail"],[g],e),a.style.height=Pt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=oLe(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Pt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Pt(v),a.style.borderRightWidth=Pt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=an({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=an({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?_t(["mord","cancel-lap"],[x],e):_t(["mord"],[x],e)},WC=(t,e)=>{var r,n=new Nt(t.label.includes("colorbox")?"mpadded":"menclose",[wn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Pt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Wt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=$r(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:VC,mathmlBuilder:WC}),Wt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=$r(e[0],"color-token").color,s=$r(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:VC,mathmlBuilder:WC}),Wt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),Wt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VC,mathmlBuilder:WC}),Wt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VC,mathmlBuilder:WC}),Wt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var bX={};function wl(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Mt("{"+t.envName+"} can be used only in display mode.")},ALe=new Set(["gather","gather*"]);function rR(t){if(!t.includes("ed"))return!t.includes("*")}function Vu(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Mt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new qs("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(TX(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:k};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Mt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Ze[Ee]})}for(w(s[0]),n=0;n0&&(D+=x,CZe))for(n=0;n=o)){var te=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;te=(Z=(ee=V)==null?void 0:ee.pregap)!=null?Z:f,te!==0&&(R=_t(["arraycolsep"],[]),R.style.width=Pt(te),A.push(R))}var ne=[];for(n=0;n0){for(var ye=h0("hline",r,h),He=h0("hdashline",r,h),xe=[{type:"elem",elem:Fe,shift:0}];u.length>0;){var Ve=u.pop(),Je=Ve.pos-z;Ve.isDashed?xe.push({type:"elem",elem:He,shift:Je}):xe.push({type:"elem",elem:ye,shift:Je})}Fe=an({positionType:"individualShift",children:xe})}if(M.length===0)return _t(["mord"],[Fe],r);var nt=an({positionType:"individualShift",children:M}),tt=_t(["tag"],[nt],r);return Lc([Fe,tt])},_Le={c:"center ",l:"left ",r:"right "},kl=function(e,r){for(var n=[],i=new Nt("mtd",[],["mtr-glue"]),a=new Nt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var O=1;O0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};wl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=BC(e[0]),n=r?[e[0]]:$r(e[0],"ordgroup").body,i=n.map(function(s){var o=PC(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Mt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Vu(t.parser,a,nR(t.envName))},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Mt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Vu(t.parser,n,nR(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Vu(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=BC(e[0]),n=r?[e[0]]:$r(e[0],"ordgroup").body,i=n.map(function(o){var l=PC(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Mt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Mt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Vu(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Mt("{subarray} can contain only one column");return s},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Vu(t.parser,e,nR(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:wX,htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){ALe.has(t.envName)&&UC(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:rR(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Vu(t.parser,e,"display")},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:wX,htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){UC(t);var e={autoTag:rR(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Vu(t.parser,e,"display")},htmlBuilder:Cl,mathmlBuilder:kl}),wl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return UC(t),gLe(t.parser)},htmlBuilder:Cl,mathmlBuilder:kl}),ge("\\nonumber","\\gdef\\@eqnsw{0}"),ge("\\notag","\\nonumber"),Wt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Mt(t.funcName+" valid only within array environment")}});var CX=bX;Wt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Mt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return sn(t.body,n)},EX=(t,e)=>{var r=t.font,n=e.withFont(r);return wn(t.body,n)},SX={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Wt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=MC(e[0]),a=n;return a in SX&&(a=SX[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:kX,mathmlBuilder:EX}),Wt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:zC(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Sc(n)}}}),Wt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:kX,mathmlBuilder:EX});var RLe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=sn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new Nt("mfrac",[wn(t.numer,e),wn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=jn(t.barSize,e);r.setAttribute("linethickness",Pt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Nt("mo",[new wi(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Nt("mo",[new wi(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return q7(i)}return r},AX=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Wt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),AX({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:RLe,mathmlBuilder:LLe}),Wt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var _X=["display","text","script","scriptscript"],RX=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Wt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=MC(e[0]),s=a.type==="atom"&&a.family==="open"?RX(a.text):null,o=MC(e[1]),l=o.type==="atom"&&o.family==="close"?RX(o.text):null,u=$r(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=$r(p.body[0],"textord");f=_X[Number(g.text)]}}else p=$r(p,"textord"),f=_X[Number(p.text)];return AX({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),Wt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:$r(e[0],"size").value,token:i}}}),Wt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=$r(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var LX=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?sn(t.sup,e.havingStyle(r.sup()),e):sn(t.sub,e.havingStyle(r.sub()),e),i=$r(t.base,"horizBrace")):i=$r(t,"horizBrace");var a=sn(i.base,e.havingBaseStyle(Dr.DISPLAY)),s=$C(i,e),o;if(i.isOver?o=an({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=an({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=_t(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=an({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=an({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return _t(["minner",i.isOver?"mover":"munder"],[o],e)},ILe=(t,e)=>{var r=OC(t.label);return new Nt(t.isOver?"mover":"munder",[wn(t.base,e),r])};Wt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:LX,mathmlBuilder:ILe}),Wt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=$r(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ti(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Oi(t.body,e,!1);return W8e(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=qu(t.body,e);return r instanceof Nt||(r=new Nt("mrow",[r])),r.setAttribute("href",t.href),r}}),Wt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=$r(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=$r(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=Oi(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=_t(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>qu(t.body,e)}),Wt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ti(e[0]),mathml:Ti(e[1])}},htmlBuilder:(t,e)=>{var r=Oi(t.html,e,!1);return Lc(r)},mathmlBuilder:(t,e)=>qu(t.mathml,e)});var iR=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Mt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!TY(n))throw new Mt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Wt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=$r(r[0],"raw").string,u=l.split(","),h=0;h{var r=jn(t.height,e),n=0;t.totalheight.number>0&&(n=jn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=jn(t.width,e));var a={height:Pt(r+n)};i>0&&(a.width=Pt(i)),n>0&&(a.verticalAlign=Pt(-n));var s=new M8e(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Nt("mglyph",[]);r.setAttribute("alt",t.alt);var n=jn(t.height,e),i=0;if(t.totalheight.number>0&&(i=jn(t.totalheight,e)-n,r.setAttribute("valign",Pt(-i))),r.setAttribute("height",Pt(n+i)),t.width.number>0){var a=jn(t.width,e);r.setAttribute("width",Pt(a))}return r.setAttribute("src",t.src),r}}),Wt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=$r(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return zY(t.dimension,e)},mathmlBuilder(t,e){var r=jn(t.dimension,e);return new HY(r)}}),Wt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=_t([],[sn(t.body,e)]),r=_t(["inner"],[r],e)):r=_t(["inner"],[sn(t.body,e)]);var n=_t(["fix"],[]),i=_t([t.alignment],[r,n],e),a=_t(["strut"]);return a.style.height=Pt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Pt(-i.depth)),i.children.unshift(a),i=_t(["thinbox"],[i],e),_t(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Nt("mpadded",[wn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),Wt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),Wt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Mt("Mismatched "+t.funcName)}});var IX=(t,e)=>{switch(e.style.size){case Dr.DISPLAY.size:return t.display;case Dr.TEXT.size:return t.text;case Dr.SCRIPT.size:return t.script;case Dr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Wt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ti(e[0]),text:Ti(e[1]),script:Ti(e[2]),scriptscript:Ti(e[3])}},htmlBuilder:(t,e)=>{var r=IX(t,e),n=Oi(r,e,!1);return Lc(n)},mathmlBuilder:(t,e)=>{var r=IX(t,e);return qu(r,e)}});var DX=(t,e,r,n,i,a,s)=>{t=_t([],[t]);var o=r&&Sc(r),l,u;if(e){var h=sn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=sn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=an({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Pt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Pt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=an({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Pt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=an({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Pt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=_t(["mspace"],[],n);v.style.marginRight=Pt(a),y.unshift(v)}return _t(["mop","op-limits"],y,n)},MX=new Set(["\\smallint"]),f0=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=$r(t.base,"op"),i=!0):a=$r(t,"op");var s=e.style,o=!1;s.size===Dr.DISPLAY.size&&a.symbol&&!MX.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Ka(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=qY(d+"Size"+(o?"2":"1"),e);l=an({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=Oi(a.body,e,!0);p.length===1&&p[0]instanceof Fs?(l=p[0],l.classes[0]="mop"):l=_t(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Nt("mo",[oo(t.name,t.mode)]),MX.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Nt("mo",Gs(t.body,e));else{r=new Nt("mi",[new wi(t.name.slice(1))]);var n=new Nt("mo",[oo("⁡","text")]);t.parentIsSupSub?r=new Nt("mrow",[r,n]):r=UY([r,n])}return r},DLe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Wt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=DLe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:f0,mathmlBuilder:vb}),Wt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ti(n)}},htmlBuilder:f0,mathmlBuilder:vb});var MLe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Wt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:f0,mathmlBuilder:vb}),Wt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:f0,mathmlBuilder:vb}),Wt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=MLe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:f0,mathmlBuilder:vb});var NX=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=$r(t.base,"operatorname"),i=!0):a=$r(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Oi(o,e.withFont("mathrm"),!0),u=0;u{for(var r=Gs(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new wi(o)]}var l=new Nt("mi",r);l.setAttribute("mathvariant","normal");var u=new Nt("mo",[oo("⁡","text")]);return t.parentIsSupSub?new Nt("mrow",[l,u]):UY([l,u])};Wt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ti(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:NX,mathmlBuilder:NLe}),ge("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),bd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Lc(Oi(t.body,e,!1)):_t(["mord"],Oi(t.body,e,!0),e)},mathmlBuilder(t,e){return qu(t.body,e,!0)}}),Wt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=sn(t.body,e.havingCrampedStyle()),n=h0("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=an({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return _t(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Nt("mo",[new wi("‾")]);r.setAttribute("stretchy","true");var n=new Nt("mover",[wn(t.body,e),r]);return n.setAttribute("accent","true"),n}}),Wt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ti(n)}},htmlBuilder:(t,e)=>{var r=Oi(t.body,e.withPhantom(),!1);return Lc(r)},mathmlBuilder:(t,e)=>{var r=Gs(t.body,e);return new Nt("mphantom",r)}}),ge("\\hphantom","\\smash{\\phantom{#1}}"),Wt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=_t(["inner"],[sn(t.body,e.withPhantom())]),n=_t(["fix"],[]);return _t(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Gs(Ti(t.body),e),n=new Nt("mphantom",r),i=new Nt("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Wt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=$r(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=sn(t.body,e),n=jn(t.dy,e);return an({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Nt("mpadded",[wn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),Wt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),Wt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=$r(e[0],"size"),s=$r(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&$r(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=_t(["mord","rule"],[],e),n=jn(t.width,e),i=jn(t.height,e),a=t.shift?jn(t.shift,e):0;return r.style.borderRightWidth=Pt(n),r.style.borderTopWidth=Pt(i),r.style.bottom=Pt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=jn(t.width,e),n=jn(t.height,e),i=t.shift?jn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Nt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Pt(r)),s.setAttribute("height",Pt(n));var o=new Nt("mpadded",[s]);return i>=0?o.setAttribute("height",Pt(i)):(o.setAttribute("height",Pt(i)),o.setAttribute("depth",Pt(-i))),o.setAttribute("voffset",Pt(i)),o}});function OX(t,e,r){for(var n=Oi(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return OX(t.body,r,e)};Wt({type:"sizing",names:$X,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:$X.indexOf(n)+1,body:a}},htmlBuilder:OLe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Gs(t.body,r),i=new Nt("mstyle",n);return i.setAttribute("mathsize",Pt(r.sizeMultiplier)),i}}),Wt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&$r(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=_t([],[sn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return _t(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Nt("mpadded",[wn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),Wt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=sn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=d0(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=Pt(h);var p=an({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Dr.SCRIPTSCRIPT),m=sn(t.index,g,e),y=.6*(p.height-p.depth),v=an({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=_t(["root"],[v]);return _t(["mord","sqrt"],[x,p],e)}else return _t(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Nt("mroot",[wn(r,e),wn(n,e)]):new Nt("msqrt",[wn(r,e)])}});var aR={display:Dr.DISPLAY,text:Dr.TEXT,script:Dr.SCRIPT,scriptscript:Dr.SCRIPTSCRIPT};function $Le(t){return t in aR}Wt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!$Le(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=aR[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),OX(t.body,n,e)},mathmlBuilder(t,e){var r=aR[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Gs(t.body,n),a=new Nt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var PLe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Dr.DISPLAY.size||n.alwaysHandleSupSub);return i?f0:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Dr.DISPLAY.size||n.limits);return a?NX:null}else{if(n.type==="accent")return Sc(n.base)?U7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?LX:null}else return null}else return null};bd({type:"supsub",htmlBuilder(t,e){var r=PLe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=sn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Sc(n);if(i){var p=e.havingStyle(e.style.sup());o=sn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=sn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Dr.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Pt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof Fs||b){var w;x=Pt(-((w=s.italic)!=null?w:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,C=4*S;if(h-o.depth-(l.height-d)0&&(h+=_,d-=_)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];k=an({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];k=an({positionType:"shift",positionData:d,children:O})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=an({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var D=z7(s,"right")||"mord";return _t([D],[s,_t(["msupsub"],[k])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[wn(t.base,e)];t.sub&&a.push(wn(t.sub,e)),t.sup&&a.push(wn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Dr.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Dr.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Dr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Dr.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Dr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Dr.DISPLAY)?s="mover":s="msup"}return new Nt(s,a)}}),bd({type:"atom",htmlBuilder(t,e){return O7(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Nt("mo",[oo(t.text,t.mode)]);if(t.family==="bin"){var n=V7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var PX={mi:"italic",mn:"normal",mtext:"normal"};bd({type:"mathord",htmlBuilder(t,e){return RC(t,e,"mathord")},mathmlBuilder(t,e){var r=new Nt("mi",[oo(t.text,t.mode,e)]),n=V7(t,e)||"italic";return n!==PX[r.type]&&r.setAttribute("mathvariant",n),r}}),bd({type:"textord",htmlBuilder(t,e){return RC(t,e,"textord")},mathmlBuilder(t,e){var r=oo(t.text,t.mode,e),n=V7(t,e)||"normal",i;return t.mode==="text"?i=new Nt("mtext",[r]):/[0-9]/.test(t.text)?i=new Nt("mn",[r]):t.text==="\\prime"?i=new Nt("mo",[r]):i=new Nt("mi",[r]),n!==PX[i.type]&&i.setAttribute("mathvariant",n),i}});var sR={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},oR={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};bd({type:"spacing",htmlBuilder(t,e){if(oR.hasOwnProperty(t.text)){var r=oR[t.text].className||"";if(t.mode==="text"){var n=RC(t,e,"textord");return n.classes.push(r),n}else return _t(["mspace",r],[O7(t.text,t.mode,e)],e)}else{if(sR.hasOwnProperty(t.text))return _t(["mspace",sR[t.text]],[],e);throw new Mt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(oR.hasOwnProperty(t.text))r=new Nt("mtext",[new wi(" ")]);else{if(sR.hasOwnProperty(t.text))return new Nt("mspace");throw new Mt('Unknown type of space "'+t.text+'"')}return r}});var BX=()=>{var t=new Nt("mtd",[]);return t.setAttribute("width","50%"),t};bd({type:"tag",mathmlBuilder(t,e){var r=new Nt("mtable",[new Nt("mtr",[BX(),new Nt("mtd",[qu(t.body,e)]),BX(),new Nt("mtd",[qu(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var FX={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},zX={"\\textbf":"textbf","\\textmd":"textmd"},BLe={"\\textit":"textit","\\textup":"textup"},GX=(t,e)=>{var r=t.font;if(r){if(FX[r])return e.withTextFontFamily(FX[r]);if(zX[r])return e.withTextFontWeight(zX[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(BLe[r])};Wt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ti(i),font:n}},htmlBuilder(t,e){var r=GX(t,e),n=Oi(t.body,r,!0);return _t(["mord","text"],n,r)},mathmlBuilder(t,e){var r=GX(t,e);return qu(t.body,r)}}),Wt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=sn(t.body,e),n=h0("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=an({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return _t(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Nt("mo",[new wi("‾")]);r.setAttribute("stretchy","true");var n=new Nt("munder",[wn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),Wt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=sn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return an({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Nt("mpadded",[wn(t.body,e)],["vcenter"]);return new Nt("mrow",[r])}}),Wt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Mt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=qX(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Wu=VY,VX=`[ \r - ]`,FLe="\\\\[a-zA-Z@]+",zLe="\\\\[^\uD800-\uDFFF]",GLe="("+FLe+")"+VX+"*",qLe=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function f9e(t){return"toText"in t}class Y0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(f9e(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var X7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},p9e={ex:!0,em:!0,mu:!0},xK=function(e){return typeof e!="string"&&(e=e.unit),e in X7||e in p9e||e==="ex"},pi=function(e,r){var n;if(e.unit in X7)n=X7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Pt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Gt=function(e){return+e.toFixed(4)+"em"},mh=function(e){return e.filter(r=>r).join(" ")},j7=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=WNe(n)+":"+i+";")}return r},TK=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},wK=function(e){var r=document.createElement(e);r.className=mh(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,CK=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+es(mh(this.classes))+'"');var n=j7(this.style);n&&(r+=' style="'+es(n)+'"');for(var i of Object.keys(this.attributes)){if(g9e.test(i))throw new Pt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+es(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class X0{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,TK.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return wK.call(this,"span")}toMarkup(){return CK.call(this,"span")}}let SS=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,TK.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return wK.call(this,"a")}toMarkup(){return CK.call(this,"a")}};class m9e{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+es(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Gt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=mh(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Gt(this.italic)+";"),n+=j7(this.style),n&&(e=!0,r+=' style="'+es(n)+'"');var i=es(this.text);return e?(r+=">",r+=i,r+="",r):i}}class au{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class K7{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var x9e=t=>t instanceof X0||t instanceof SS||t instanceof Y0,Kl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},kS={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},SK={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function kK(t,e){Kl[t]=e}function Z7(t,e,r){if(!Kl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Kl[e][n];if(!i&&t[0]in SK&&(n=SK[t[0]].charCodeAt(0),i=Kl[e][n]),!i&&r==="text"&&vK(n)&&(i=Kl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Q7={};function T9e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!Q7[e]){var r=Q7[e]={cssEmPerMu:kS.quad[e]/18};for(var n in kS)kS.hasOwnProperty(n)&&(r[n]=kS[n][e])}return Q7[e]}var ui={math:{},text:{}};function X(t,e,r,n,i,a){ui[t][i]={font:e,group:r,replace:n},a&&n&&(ui[t][n]=ui[t][i])}var ne="math",It="text",xe="main",Ue="ams",hi="accent-token",Jt="bin",ps="close",j0="inner",Cr="mathord",Gi="op-token",uo="open",ux="punct",je="rel",su="spacing",Qe="textord";X(ne,xe,je,"≡","\\equiv",!0),X(ne,xe,je,"≺","\\prec",!0),X(ne,xe,je,"≻","\\succ",!0),X(ne,xe,je,"∼","\\sim",!0),X(ne,xe,je,"⊥","\\perp"),X(ne,xe,je,"⪯","\\preceq",!0),X(ne,xe,je,"⪰","\\succeq",!0),X(ne,xe,je,"≃","\\simeq",!0),X(ne,xe,je,"∣","\\mid",!0),X(ne,xe,je,"≪","\\ll",!0),X(ne,xe,je,"≫","\\gg",!0),X(ne,xe,je,"≍","\\asymp",!0),X(ne,xe,je,"∥","\\parallel"),X(ne,xe,je,"⋈","\\bowtie",!0),X(ne,xe,je,"⌣","\\smile",!0),X(ne,xe,je,"⊑","\\sqsubseteq",!0),X(ne,xe,je,"⊒","\\sqsupseteq",!0),X(ne,xe,je,"≐","\\doteq",!0),X(ne,xe,je,"⌢","\\frown",!0),X(ne,xe,je,"∋","\\ni",!0),X(ne,xe,je,"∝","\\propto",!0),X(ne,xe,je,"⊢","\\vdash",!0),X(ne,xe,je,"⊣","\\dashv",!0),X(ne,xe,je,"∋","\\owns"),X(ne,xe,ux,".","\\ldotp"),X(ne,xe,ux,"⋅","\\cdotp"),X(ne,xe,ux,"⋅","·"),X(It,xe,Qe,"⋅","·"),X(ne,xe,Qe,"#","\\#"),X(It,xe,Qe,"#","\\#"),X(ne,xe,Qe,"&","\\&"),X(It,xe,Qe,"&","\\&"),X(ne,xe,Qe,"ℵ","\\aleph",!0),X(ne,xe,Qe,"∀","\\forall",!0),X(ne,xe,Qe,"ℏ","\\hbar",!0),X(ne,xe,Qe,"∃","\\exists",!0),X(ne,xe,Qe,"∇","\\nabla",!0),X(ne,xe,Qe,"♭","\\flat",!0),X(ne,xe,Qe,"ℓ","\\ell",!0),X(ne,xe,Qe,"♮","\\natural",!0),X(ne,xe,Qe,"♣","\\clubsuit",!0),X(ne,xe,Qe,"℘","\\wp",!0),X(ne,xe,Qe,"♯","\\sharp",!0),X(ne,xe,Qe,"♢","\\diamondsuit",!0),X(ne,xe,Qe,"ℜ","\\Re",!0),X(ne,xe,Qe,"♡","\\heartsuit",!0),X(ne,xe,Qe,"ℑ","\\Im",!0),X(ne,xe,Qe,"♠","\\spadesuit",!0),X(ne,xe,Qe,"§","\\S",!0),X(It,xe,Qe,"§","\\S"),X(ne,xe,Qe,"¶","\\P",!0),X(It,xe,Qe,"¶","\\P"),X(ne,xe,Qe,"†","\\dag"),X(It,xe,Qe,"†","\\dag"),X(It,xe,Qe,"†","\\textdagger"),X(ne,xe,Qe,"‡","\\ddag"),X(It,xe,Qe,"‡","\\ddag"),X(It,xe,Qe,"‡","\\textdaggerdbl"),X(ne,xe,ps,"⎱","\\rmoustache",!0),X(ne,xe,uo,"⎰","\\lmoustache",!0),X(ne,xe,ps,"⟯","\\rgroup",!0),X(ne,xe,uo,"⟮","\\lgroup",!0),X(ne,xe,Jt,"∓","\\mp",!0),X(ne,xe,Jt,"⊖","\\ominus",!0),X(ne,xe,Jt,"⊎","\\uplus",!0),X(ne,xe,Jt,"⊓","\\sqcap",!0),X(ne,xe,Jt,"∗","\\ast"),X(ne,xe,Jt,"⊔","\\sqcup",!0),X(ne,xe,Jt,"◯","\\bigcirc",!0),X(ne,xe,Jt,"∙","\\bullet",!0),X(ne,xe,Jt,"‡","\\ddagger"),X(ne,xe,Jt,"≀","\\wr",!0),X(ne,xe,Jt,"⨿","\\amalg"),X(ne,xe,Jt,"&","\\And"),X(ne,xe,je,"⟵","\\longleftarrow",!0),X(ne,xe,je,"⇐","\\Leftarrow",!0),X(ne,xe,je,"⟸","\\Longleftarrow",!0),X(ne,xe,je,"⟶","\\longrightarrow",!0),X(ne,xe,je,"⇒","\\Rightarrow",!0),X(ne,xe,je,"⟹","\\Longrightarrow",!0),X(ne,xe,je,"↔","\\leftrightarrow",!0),X(ne,xe,je,"⟷","\\longleftrightarrow",!0),X(ne,xe,je,"⇔","\\Leftrightarrow",!0),X(ne,xe,je,"⟺","\\Longleftrightarrow",!0),X(ne,xe,je,"↦","\\mapsto",!0),X(ne,xe,je,"⟼","\\longmapsto",!0),X(ne,xe,je,"↗","\\nearrow",!0),X(ne,xe,je,"↩","\\hookleftarrow",!0),X(ne,xe,je,"↪","\\hookrightarrow",!0),X(ne,xe,je,"↘","\\searrow",!0),X(ne,xe,je,"↼","\\leftharpoonup",!0),X(ne,xe,je,"⇀","\\rightharpoonup",!0),X(ne,xe,je,"↙","\\swarrow",!0),X(ne,xe,je,"↽","\\leftharpoondown",!0),X(ne,xe,je,"⇁","\\rightharpoondown",!0),X(ne,xe,je,"↖","\\nwarrow",!0),X(ne,xe,je,"⇌","\\rightleftharpoons",!0),X(ne,Ue,je,"≮","\\nless",!0),X(ne,Ue,je,"","\\@nleqslant"),X(ne,Ue,je,"","\\@nleqq"),X(ne,Ue,je,"⪇","\\lneq",!0),X(ne,Ue,je,"≨","\\lneqq",!0),X(ne,Ue,je,"","\\@lvertneqq"),X(ne,Ue,je,"⋦","\\lnsim",!0),X(ne,Ue,je,"⪉","\\lnapprox",!0),X(ne,Ue,je,"⊀","\\nprec",!0),X(ne,Ue,je,"⋠","\\npreceq",!0),X(ne,Ue,je,"⋨","\\precnsim",!0),X(ne,Ue,je,"⪹","\\precnapprox",!0),X(ne,Ue,je,"≁","\\nsim",!0),X(ne,Ue,je,"","\\@nshortmid"),X(ne,Ue,je,"∤","\\nmid",!0),X(ne,Ue,je,"⊬","\\nvdash",!0),X(ne,Ue,je,"⊭","\\nvDash",!0),X(ne,Ue,je,"⋪","\\ntriangleleft"),X(ne,Ue,je,"⋬","\\ntrianglelefteq",!0),X(ne,Ue,je,"⊊","\\subsetneq",!0),X(ne,Ue,je,"","\\@varsubsetneq"),X(ne,Ue,je,"⫋","\\subsetneqq",!0),X(ne,Ue,je,"","\\@varsubsetneqq"),X(ne,Ue,je,"≯","\\ngtr",!0),X(ne,Ue,je,"","\\@ngeqslant"),X(ne,Ue,je,"","\\@ngeqq"),X(ne,Ue,je,"⪈","\\gneq",!0),X(ne,Ue,je,"≩","\\gneqq",!0),X(ne,Ue,je,"","\\@gvertneqq"),X(ne,Ue,je,"⋧","\\gnsim",!0),X(ne,Ue,je,"⪊","\\gnapprox",!0),X(ne,Ue,je,"⊁","\\nsucc",!0),X(ne,Ue,je,"⋡","\\nsucceq",!0),X(ne,Ue,je,"⋩","\\succnsim",!0),X(ne,Ue,je,"⪺","\\succnapprox",!0),X(ne,Ue,je,"≆","\\ncong",!0),X(ne,Ue,je,"","\\@nshortparallel"),X(ne,Ue,je,"∦","\\nparallel",!0),X(ne,Ue,je,"⊯","\\nVDash",!0),X(ne,Ue,je,"⋫","\\ntriangleright"),X(ne,Ue,je,"⋭","\\ntrianglerighteq",!0),X(ne,Ue,je,"","\\@nsupseteqq"),X(ne,Ue,je,"⊋","\\supsetneq",!0),X(ne,Ue,je,"","\\@varsupsetneq"),X(ne,Ue,je,"⫌","\\supsetneqq",!0),X(ne,Ue,je,"","\\@varsupsetneqq"),X(ne,Ue,je,"⊮","\\nVdash",!0),X(ne,Ue,je,"⪵","\\precneqq",!0),X(ne,Ue,je,"⪶","\\succneqq",!0),X(ne,Ue,je,"","\\@nsubseteqq"),X(ne,Ue,Jt,"⊴","\\unlhd"),X(ne,Ue,Jt,"⊵","\\unrhd"),X(ne,Ue,je,"↚","\\nleftarrow",!0),X(ne,Ue,je,"↛","\\nrightarrow",!0),X(ne,Ue,je,"⇍","\\nLeftarrow",!0),X(ne,Ue,je,"⇏","\\nRightarrow",!0),X(ne,Ue,je,"↮","\\nleftrightarrow",!0),X(ne,Ue,je,"⇎","\\nLeftrightarrow",!0),X(ne,Ue,je,"△","\\vartriangle"),X(ne,Ue,Qe,"ℏ","\\hslash"),X(ne,Ue,Qe,"▽","\\triangledown"),X(ne,Ue,Qe,"◊","\\lozenge"),X(ne,Ue,Qe,"Ⓢ","\\circledS"),X(ne,Ue,Qe,"®","\\circledR"),X(It,Ue,Qe,"®","\\circledR"),X(ne,Ue,Qe,"∡","\\measuredangle",!0),X(ne,Ue,Qe,"∄","\\nexists"),X(ne,Ue,Qe,"℧","\\mho"),X(ne,Ue,Qe,"Ⅎ","\\Finv",!0),X(ne,Ue,Qe,"⅁","\\Game",!0),X(ne,Ue,Qe,"‵","\\backprime"),X(ne,Ue,Qe,"▲","\\blacktriangle"),X(ne,Ue,Qe,"▼","\\blacktriangledown"),X(ne,Ue,Qe,"■","\\blacksquare"),X(ne,Ue,Qe,"⧫","\\blacklozenge"),X(ne,Ue,Qe,"★","\\bigstar"),X(ne,Ue,Qe,"∢","\\sphericalangle",!0),X(ne,Ue,Qe,"∁","\\complement",!0),X(ne,Ue,Qe,"ð","\\eth",!0),X(It,xe,Qe,"ð","ð"),X(ne,Ue,Qe,"╱","\\diagup"),X(ne,Ue,Qe,"╲","\\diagdown"),X(ne,Ue,Qe,"□","\\square"),X(ne,Ue,Qe,"□","\\Box"),X(ne,Ue,Qe,"◊","\\Diamond"),X(ne,Ue,Qe,"¥","\\yen",!0),X(It,Ue,Qe,"¥","\\yen",!0),X(ne,Ue,Qe,"✓","\\checkmark",!0),X(It,Ue,Qe,"✓","\\checkmark"),X(ne,Ue,Qe,"ℶ","\\beth",!0),X(ne,Ue,Qe,"ℸ","\\daleth",!0),X(ne,Ue,Qe,"ℷ","\\gimel",!0),X(ne,Ue,Qe,"ϝ","\\digamma",!0),X(ne,Ue,Qe,"ϰ","\\varkappa"),X(ne,Ue,uo,"┌","\\@ulcorner",!0),X(ne,Ue,ps,"┐","\\@urcorner",!0),X(ne,Ue,uo,"└","\\@llcorner",!0),X(ne,Ue,ps,"┘","\\@lrcorner",!0),X(ne,Ue,je,"≦","\\leqq",!0),X(ne,Ue,je,"⩽","\\leqslant",!0),X(ne,Ue,je,"⪕","\\eqslantless",!0),X(ne,Ue,je,"≲","\\lesssim",!0),X(ne,Ue,je,"⪅","\\lessapprox",!0),X(ne,Ue,je,"≊","\\approxeq",!0),X(ne,Ue,Jt,"⋖","\\lessdot"),X(ne,Ue,je,"⋘","\\lll",!0),X(ne,Ue,je,"≶","\\lessgtr",!0),X(ne,Ue,je,"⋚","\\lesseqgtr",!0),X(ne,Ue,je,"⪋","\\lesseqqgtr",!0),X(ne,Ue,je,"≑","\\doteqdot"),X(ne,Ue,je,"≓","\\risingdotseq",!0),X(ne,Ue,je,"≒","\\fallingdotseq",!0),X(ne,Ue,je,"∽","\\backsim",!0),X(ne,Ue,je,"⋍","\\backsimeq",!0),X(ne,Ue,je,"⫅","\\subseteqq",!0),X(ne,Ue,je,"⋐","\\Subset",!0),X(ne,Ue,je,"⊏","\\sqsubset",!0),X(ne,Ue,je,"≼","\\preccurlyeq",!0),X(ne,Ue,je,"⋞","\\curlyeqprec",!0),X(ne,Ue,je,"≾","\\precsim",!0),X(ne,Ue,je,"⪷","\\precapprox",!0),X(ne,Ue,je,"⊲","\\vartriangleleft"),X(ne,Ue,je,"⊴","\\trianglelefteq"),X(ne,Ue,je,"⊨","\\vDash",!0),X(ne,Ue,je,"⊪","\\Vvdash",!0),X(ne,Ue,je,"⌣","\\smallsmile"),X(ne,Ue,je,"⌢","\\smallfrown"),X(ne,Ue,je,"≏","\\bumpeq",!0),X(ne,Ue,je,"≎","\\Bumpeq",!0),X(ne,Ue,je,"≧","\\geqq",!0),X(ne,Ue,je,"⩾","\\geqslant",!0),X(ne,Ue,je,"⪖","\\eqslantgtr",!0),X(ne,Ue,je,"≳","\\gtrsim",!0),X(ne,Ue,je,"⪆","\\gtrapprox",!0),X(ne,Ue,Jt,"⋗","\\gtrdot"),X(ne,Ue,je,"⋙","\\ggg",!0),X(ne,Ue,je,"≷","\\gtrless",!0),X(ne,Ue,je,"⋛","\\gtreqless",!0),X(ne,Ue,je,"⪌","\\gtreqqless",!0),X(ne,Ue,je,"≖","\\eqcirc",!0),X(ne,Ue,je,"≗","\\circeq",!0),X(ne,Ue,je,"≜","\\triangleq",!0),X(ne,Ue,je,"∼","\\thicksim"),X(ne,Ue,je,"≈","\\thickapprox"),X(ne,Ue,je,"⫆","\\supseteqq",!0),X(ne,Ue,je,"⋑","\\Supset",!0),X(ne,Ue,je,"⊐","\\sqsupset",!0),X(ne,Ue,je,"≽","\\succcurlyeq",!0),X(ne,Ue,je,"⋟","\\curlyeqsucc",!0),X(ne,Ue,je,"≿","\\succsim",!0),X(ne,Ue,je,"⪸","\\succapprox",!0),X(ne,Ue,je,"⊳","\\vartriangleright"),X(ne,Ue,je,"⊵","\\trianglerighteq"),X(ne,Ue,je,"⊩","\\Vdash",!0),X(ne,Ue,je,"∣","\\shortmid"),X(ne,Ue,je,"∥","\\shortparallel"),X(ne,Ue,je,"≬","\\between",!0),X(ne,Ue,je,"⋔","\\pitchfork",!0),X(ne,Ue,je,"∝","\\varpropto"),X(ne,Ue,je,"◀","\\blacktriangleleft"),X(ne,Ue,je,"∴","\\therefore",!0),X(ne,Ue,je,"∍","\\backepsilon"),X(ne,Ue,je,"▶","\\blacktriangleright"),X(ne,Ue,je,"∵","\\because",!0),X(ne,Ue,je,"⋘","\\llless"),X(ne,Ue,je,"⋙","\\gggtr"),X(ne,Ue,Jt,"⊲","\\lhd"),X(ne,Ue,Jt,"⊳","\\rhd"),X(ne,Ue,je,"≂","\\eqsim",!0),X(ne,xe,je,"⋈","\\Join"),X(ne,Ue,je,"≑","\\Doteq",!0),X(ne,Ue,Jt,"∔","\\dotplus",!0),X(ne,Ue,Jt,"∖","\\smallsetminus"),X(ne,Ue,Jt,"⋒","\\Cap",!0),X(ne,Ue,Jt,"⋓","\\Cup",!0),X(ne,Ue,Jt,"⩞","\\doublebarwedge",!0),X(ne,Ue,Jt,"⊟","\\boxminus",!0),X(ne,Ue,Jt,"⊞","\\boxplus",!0),X(ne,Ue,Jt,"⋇","\\divideontimes",!0),X(ne,Ue,Jt,"⋉","\\ltimes",!0),X(ne,Ue,Jt,"⋊","\\rtimes",!0),X(ne,Ue,Jt,"⋋","\\leftthreetimes",!0),X(ne,Ue,Jt,"⋌","\\rightthreetimes",!0),X(ne,Ue,Jt,"⋏","\\curlywedge",!0),X(ne,Ue,Jt,"⋎","\\curlyvee",!0),X(ne,Ue,Jt,"⊝","\\circleddash",!0),X(ne,Ue,Jt,"⊛","\\circledast",!0),X(ne,Ue,Jt,"⋅","\\centerdot"),X(ne,Ue,Jt,"⊺","\\intercal",!0),X(ne,Ue,Jt,"⋒","\\doublecap"),X(ne,Ue,Jt,"⋓","\\doublecup"),X(ne,Ue,Jt,"⊠","\\boxtimes",!0),X(ne,Ue,je,"⇢","\\dashrightarrow",!0),X(ne,Ue,je,"⇠","\\dashleftarrow",!0),X(ne,Ue,je,"⇇","\\leftleftarrows",!0),X(ne,Ue,je,"⇆","\\leftrightarrows",!0),X(ne,Ue,je,"⇚","\\Lleftarrow",!0),X(ne,Ue,je,"↞","\\twoheadleftarrow",!0),X(ne,Ue,je,"↢","\\leftarrowtail",!0),X(ne,Ue,je,"↫","\\looparrowleft",!0),X(ne,Ue,je,"⇋","\\leftrightharpoons",!0),X(ne,Ue,je,"↶","\\curvearrowleft",!0),X(ne,Ue,je,"↺","\\circlearrowleft",!0),X(ne,Ue,je,"↰","\\Lsh",!0),X(ne,Ue,je,"⇈","\\upuparrows",!0),X(ne,Ue,je,"↿","\\upharpoonleft",!0),X(ne,Ue,je,"⇃","\\downharpoonleft",!0),X(ne,xe,je,"⊶","\\origof",!0),X(ne,xe,je,"⊷","\\imageof",!0),X(ne,Ue,je,"⊸","\\multimap",!0),X(ne,Ue,je,"↭","\\leftrightsquigarrow",!0),X(ne,Ue,je,"⇉","\\rightrightarrows",!0),X(ne,Ue,je,"⇄","\\rightleftarrows",!0),X(ne,Ue,je,"↠","\\twoheadrightarrow",!0),X(ne,Ue,je,"↣","\\rightarrowtail",!0),X(ne,Ue,je,"↬","\\looparrowright",!0),X(ne,Ue,je,"↷","\\curvearrowright",!0),X(ne,Ue,je,"↻","\\circlearrowright",!0),X(ne,Ue,je,"↱","\\Rsh",!0),X(ne,Ue,je,"⇊","\\downdownarrows",!0),X(ne,Ue,je,"↾","\\upharpoonright",!0),X(ne,Ue,je,"⇂","\\downharpoonright",!0),X(ne,Ue,je,"⇝","\\rightsquigarrow",!0),X(ne,Ue,je,"⇝","\\leadsto"),X(ne,Ue,je,"⇛","\\Rrightarrow",!0),X(ne,Ue,je,"↾","\\restriction"),X(ne,xe,Qe,"‘","`"),X(ne,xe,Qe,"$","\\$"),X(It,xe,Qe,"$","\\$"),X(It,xe,Qe,"$","\\textdollar"),X(ne,xe,Qe,"%","\\%"),X(It,xe,Qe,"%","\\%"),X(ne,xe,Qe,"_","\\_"),X(It,xe,Qe,"_","\\_"),X(It,xe,Qe,"_","\\textunderscore"),X(ne,xe,Qe,"∠","\\angle",!0),X(ne,xe,Qe,"∞","\\infty",!0),X(ne,xe,Qe,"′","\\prime"),X(ne,xe,Qe,"△","\\triangle"),X(ne,xe,Qe,"Γ","\\Gamma",!0),X(ne,xe,Qe,"Δ","\\Delta",!0),X(ne,xe,Qe,"Θ","\\Theta",!0),X(ne,xe,Qe,"Λ","\\Lambda",!0),X(ne,xe,Qe,"Ξ","\\Xi",!0),X(ne,xe,Qe,"Π","\\Pi",!0),X(ne,xe,Qe,"Σ","\\Sigma",!0),X(ne,xe,Qe,"Υ","\\Upsilon",!0),X(ne,xe,Qe,"Φ","\\Phi",!0),X(ne,xe,Qe,"Ψ","\\Psi",!0),X(ne,xe,Qe,"Ω","\\Omega",!0),X(ne,xe,Qe,"A","Α"),X(ne,xe,Qe,"B","Β"),X(ne,xe,Qe,"E","Ε"),X(ne,xe,Qe,"Z","Ζ"),X(ne,xe,Qe,"H","Η"),X(ne,xe,Qe,"I","Ι"),X(ne,xe,Qe,"K","Κ"),X(ne,xe,Qe,"M","Μ"),X(ne,xe,Qe,"N","Ν"),X(ne,xe,Qe,"O","Ο"),X(ne,xe,Qe,"P","Ρ"),X(ne,xe,Qe,"T","Τ"),X(ne,xe,Qe,"X","Χ"),X(ne,xe,Qe,"¬","\\neg",!0),X(ne,xe,Qe,"¬","\\lnot"),X(ne,xe,Qe,"⊤","\\top"),X(ne,xe,Qe,"⊥","\\bot"),X(ne,xe,Qe,"∅","\\emptyset"),X(ne,Ue,Qe,"∅","\\varnothing"),X(ne,xe,Cr,"α","\\alpha",!0),X(ne,xe,Cr,"β","\\beta",!0),X(ne,xe,Cr,"γ","\\gamma",!0),X(ne,xe,Cr,"δ","\\delta",!0),X(ne,xe,Cr,"ϵ","\\epsilon",!0),X(ne,xe,Cr,"ζ","\\zeta",!0),X(ne,xe,Cr,"η","\\eta",!0),X(ne,xe,Cr,"θ","\\theta",!0),X(ne,xe,Cr,"ι","\\iota",!0),X(ne,xe,Cr,"κ","\\kappa",!0),X(ne,xe,Cr,"λ","\\lambda",!0),X(ne,xe,Cr,"μ","\\mu",!0),X(ne,xe,Cr,"ν","\\nu",!0),X(ne,xe,Cr,"ξ","\\xi",!0),X(ne,xe,Cr,"ο","\\omicron",!0),X(ne,xe,Cr,"π","\\pi",!0),X(ne,xe,Cr,"ρ","\\rho",!0),X(ne,xe,Cr,"σ","\\sigma",!0),X(ne,xe,Cr,"τ","\\tau",!0),X(ne,xe,Cr,"υ","\\upsilon",!0),X(ne,xe,Cr,"ϕ","\\phi",!0),X(ne,xe,Cr,"χ","\\chi",!0),X(ne,xe,Cr,"ψ","\\psi",!0),X(ne,xe,Cr,"ω","\\omega",!0),X(ne,xe,Cr,"ε","\\varepsilon",!0),X(ne,xe,Cr,"ϑ","\\vartheta",!0),X(ne,xe,Cr,"ϖ","\\varpi",!0),X(ne,xe,Cr,"ϱ","\\varrho",!0),X(ne,xe,Cr,"ς","\\varsigma",!0),X(ne,xe,Cr,"φ","\\varphi",!0),X(ne,xe,Jt,"∗","*",!0),X(ne,xe,Jt,"+","+"),X(ne,xe,Jt,"−","-",!0),X(ne,xe,Jt,"⋅","\\cdot",!0),X(ne,xe,Jt,"∘","\\circ",!0),X(ne,xe,Jt,"÷","\\div",!0),X(ne,xe,Jt,"±","\\pm",!0),X(ne,xe,Jt,"×","\\times",!0),X(ne,xe,Jt,"∩","\\cap",!0),X(ne,xe,Jt,"∪","\\cup",!0),X(ne,xe,Jt,"∖","\\setminus",!0),X(ne,xe,Jt,"∧","\\land"),X(ne,xe,Jt,"∨","\\lor"),X(ne,xe,Jt,"∧","\\wedge",!0),X(ne,xe,Jt,"∨","\\vee",!0),X(ne,xe,Qe,"√","\\surd"),X(ne,xe,uo,"⟨","\\langle",!0),X(ne,xe,uo,"∣","\\lvert"),X(ne,xe,uo,"∥","\\lVert"),X(ne,xe,ps,"?","?"),X(ne,xe,ps,"!","!"),X(ne,xe,ps,"⟩","\\rangle",!0),X(ne,xe,ps,"∣","\\rvert"),X(ne,xe,ps,"∥","\\rVert"),X(ne,xe,je,"=","="),X(ne,xe,je,":",":"),X(ne,xe,je,"≈","\\approx",!0),X(ne,xe,je,"≅","\\cong",!0),X(ne,xe,je,"≥","\\ge"),X(ne,xe,je,"≥","\\geq",!0),X(ne,xe,je,"←","\\gets"),X(ne,xe,je,">","\\gt",!0),X(ne,xe,je,"∈","\\in",!0),X(ne,xe,je,"","\\@not"),X(ne,xe,je,"⊂","\\subset",!0),X(ne,xe,je,"⊃","\\supset",!0),X(ne,xe,je,"⊆","\\subseteq",!0),X(ne,xe,je,"⊇","\\supseteq",!0),X(ne,Ue,je,"⊈","\\nsubseteq",!0),X(ne,Ue,je,"⊉","\\nsupseteq",!0),X(ne,xe,je,"⊨","\\models"),X(ne,xe,je,"←","\\leftarrow",!0),X(ne,xe,je,"≤","\\le"),X(ne,xe,je,"≤","\\leq",!0),X(ne,xe,je,"<","\\lt",!0),X(ne,xe,je,"→","\\rightarrow",!0),X(ne,xe,je,"→","\\to"),X(ne,Ue,je,"≱","\\ngeq",!0),X(ne,Ue,je,"≰","\\nleq",!0),X(ne,xe,su," ","\\ "),X(ne,xe,su," ","\\space"),X(ne,xe,su," ","\\nobreakspace"),X(It,xe,su," ","\\ "),X(It,xe,su," "," "),X(It,xe,su," ","\\space"),X(It,xe,su," ","\\nobreakspace"),X(ne,xe,su,"","\\nobreak"),X(ne,xe,su,"","\\allowbreak"),X(ne,xe,ux,",",","),X(ne,xe,ux,";",";"),X(ne,Ue,Jt,"⊼","\\barwedge",!0),X(ne,Ue,Jt,"⊻","\\veebar",!0),X(ne,xe,Jt,"⊙","\\odot",!0),X(ne,xe,Jt,"⊕","\\oplus",!0),X(ne,xe,Jt,"⊗","\\otimes",!0),X(ne,xe,Qe,"∂","\\partial",!0),X(ne,xe,Jt,"⊘","\\oslash",!0),X(ne,Ue,Jt,"⊚","\\circledcirc",!0),X(ne,Ue,Jt,"⊡","\\boxdot",!0),X(ne,xe,Jt,"△","\\bigtriangleup"),X(ne,xe,Jt,"▽","\\bigtriangledown"),X(ne,xe,Jt,"†","\\dagger"),X(ne,xe,Jt,"⋄","\\diamond"),X(ne,xe,Jt,"⋆","\\star"),X(ne,xe,Jt,"◃","\\triangleleft"),X(ne,xe,Jt,"▹","\\triangleright"),X(ne,xe,uo,"{","\\{"),X(It,xe,Qe,"{","\\{"),X(It,xe,Qe,"{","\\textbraceleft"),X(ne,xe,ps,"}","\\}"),X(It,xe,Qe,"}","\\}"),X(It,xe,Qe,"}","\\textbraceright"),X(ne,xe,uo,"{","\\lbrace"),X(ne,xe,ps,"}","\\rbrace"),X(ne,xe,uo,"[","\\lbrack",!0),X(It,xe,Qe,"[","\\lbrack",!0),X(ne,xe,ps,"]","\\rbrack",!0),X(It,xe,Qe,"]","\\rbrack",!0),X(ne,xe,uo,"(","\\lparen",!0),X(ne,xe,ps,")","\\rparen",!0),X(It,xe,Qe,"<","\\textless",!0),X(It,xe,Qe,">","\\textgreater",!0),X(ne,xe,uo,"⌊","\\lfloor",!0),X(ne,xe,ps,"⌋","\\rfloor",!0),X(ne,xe,uo,"⌈","\\lceil",!0),X(ne,xe,ps,"⌉","\\rceil",!0),X(ne,xe,Qe,"\\","\\backslash"),X(ne,xe,Qe,"∣","|"),X(ne,xe,Qe,"∣","\\vert"),X(It,xe,Qe,"|","\\textbar",!0),X(ne,xe,Qe,"∥","\\|"),X(ne,xe,Qe,"∥","\\Vert"),X(It,xe,Qe,"∥","\\textbardbl"),X(It,xe,Qe,"~","\\textasciitilde"),X(It,xe,Qe,"\\","\\textbackslash"),X(It,xe,Qe,"^","\\textasciicircum"),X(ne,xe,je,"↑","\\uparrow",!0),X(ne,xe,je,"⇑","\\Uparrow",!0),X(ne,xe,je,"↓","\\downarrow",!0),X(ne,xe,je,"⇓","\\Downarrow",!0),X(ne,xe,je,"↕","\\updownarrow",!0),X(ne,xe,je,"⇕","\\Updownarrow",!0),X(ne,xe,Gi,"∐","\\coprod"),X(ne,xe,Gi,"⋁","\\bigvee"),X(ne,xe,Gi,"⋀","\\bigwedge"),X(ne,xe,Gi,"⨄","\\biguplus"),X(ne,xe,Gi,"⋂","\\bigcap"),X(ne,xe,Gi,"⋃","\\bigcup"),X(ne,xe,Gi,"∫","\\int"),X(ne,xe,Gi,"∫","\\intop"),X(ne,xe,Gi,"∬","\\iint"),X(ne,xe,Gi,"∭","\\iiint"),X(ne,xe,Gi,"∏","\\prod"),X(ne,xe,Gi,"∑","\\sum"),X(ne,xe,Gi,"⨂","\\bigotimes"),X(ne,xe,Gi,"⨁","\\bigoplus"),X(ne,xe,Gi,"⨀","\\bigodot"),X(ne,xe,Gi,"∮","\\oint"),X(ne,xe,Gi,"∯","\\oiint"),X(ne,xe,Gi,"∰","\\oiiint"),X(ne,xe,Gi,"⨆","\\bigsqcup"),X(ne,xe,Gi,"∫","\\smallint"),X(It,xe,j0,"…","\\textellipsis"),X(ne,xe,j0,"…","\\mathellipsis"),X(It,xe,j0,"…","\\ldots",!0),X(ne,xe,j0,"…","\\ldots",!0),X(ne,xe,j0,"⋯","\\@cdots",!0),X(ne,xe,j0,"⋱","\\ddots",!0),X(ne,xe,Qe,"⋮","\\varvdots"),X(It,xe,Qe,"⋮","\\varvdots"),X(ne,xe,hi,"ˊ","\\acute"),X(ne,xe,hi,"ˋ","\\grave"),X(ne,xe,hi,"¨","\\ddot"),X(ne,xe,hi,"~","\\tilde"),X(ne,xe,hi,"ˉ","\\bar"),X(ne,xe,hi,"˘","\\breve"),X(ne,xe,hi,"ˇ","\\check"),X(ne,xe,hi,"^","\\hat"),X(ne,xe,hi,"⃗","\\vec"),X(ne,xe,hi,"˙","\\dot"),X(ne,xe,hi,"˚","\\mathring"),X(ne,xe,Cr,"","\\@imath"),X(ne,xe,Cr,"","\\@jmath"),X(ne,xe,Qe,"ı","ı"),X(ne,xe,Qe,"ȷ","ȷ"),X(It,xe,Qe,"ı","\\i",!0),X(It,xe,Qe,"ȷ","\\j",!0),X(It,xe,Qe,"ß","\\ss",!0),X(It,xe,Qe,"æ","\\ae",!0),X(It,xe,Qe,"œ","\\oe",!0),X(It,xe,Qe,"ø","\\o",!0),X(It,xe,Qe,"Æ","\\AE",!0),X(It,xe,Qe,"Œ","\\OE",!0),X(It,xe,Qe,"Ø","\\O",!0),X(It,xe,hi,"ˊ","\\'"),X(It,xe,hi,"ˋ","\\`"),X(It,xe,hi,"ˆ","\\^"),X(It,xe,hi,"˜","\\~"),X(It,xe,hi,"ˉ","\\="),X(It,xe,hi,"˘","\\u"),X(It,xe,hi,"˙","\\."),X(It,xe,hi,"¸","\\c"),X(It,xe,hi,"˚","\\r"),X(It,xe,hi,"ˇ","\\v"),X(It,xe,hi,"¨",'\\"'),X(It,xe,hi,"˝","\\H"),X(It,xe,hi,"◯","\\textcircled");var EK={"--":!0,"---":!0,"``":!0,"''":!0};X(It,xe,Qe,"–","--",!0),X(It,xe,Qe,"–","\\textendash"),X(It,xe,Qe,"—","---",!0),X(It,xe,Qe,"—","\\textemdash"),X(It,xe,Qe,"‘","`",!0),X(It,xe,Qe,"‘","\\textquoteleft"),X(It,xe,Qe,"’","'",!0),X(It,xe,Qe,"’","\\textquoteright"),X(It,xe,Qe,"“","``",!0),X(It,xe,Qe,"“","\\textquotedblleft"),X(It,xe,Qe,"”","''",!0),X(It,xe,Qe,"”","\\textquotedblright"),X(ne,xe,Qe,"°","\\degree",!0),X(It,xe,Qe,"°","\\degree"),X(It,xe,Qe,"°","\\textdegree",!0),X(ne,xe,Qe,"£","\\pounds"),X(ne,xe,Qe,"£","\\mathsterling",!0),X(It,xe,Qe,"£","\\pounds"),X(It,xe,Qe,"£","\\textsterling",!0),X(ne,Ue,Qe,"✠","\\maltese"),X(It,Ue,Qe,"✠","\\maltese");for(var AK='0123456789/@."',J7=0;J7{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return PK[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return C9e[a]}else{if(n===120485||n===120486)return PK[0];if(120486{if(mh(t.classes)!==mh(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},BK=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Dt=function(e,r,n,i){var a=new X0(e,r,n,i);return cL(a),a},bh=(t,e,r,n)=>new X0(t,e,r,n),K0=function(e,r,n){var i=Dt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Gt(i.height),i.maxFontSize=1,i},A9e=function(e,r,n,i){var a=new SS(e,r,n,i);return cL(a),a},ou=function(e){var r=new Y0(e);return cL(r),r},Z0=function(e,r){return e instanceof Y0?Dt([],[e],r):e},_9e=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Dt(["mspace"],[],e),n=pi(t,e);return r.style.marginRight=Gt(n),r},IS=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},uL={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},zK={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},GK=function(e,r){var[n,i,a]=zK[e],s=new yh(n),o=new au([s],{width:Gt(i),height:Gt(a),style:"width:"+Gt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=bh(["overlay"],[o],r);return l.height=a,l.style.height=Gt(a),l.style.width=Gt(i),l},gi={number:3,unit:"mu"},nf={number:4,unit:"mu"},lu={number:5,unit:"mu"},R9e={mord:{mop:gi,mbin:nf,mrel:lu,minner:gi},mop:{mord:gi,mop:gi,mrel:lu,minner:gi},mbin:{mord:nf,mop:nf,mopen:nf,minner:nf},mrel:{mord:lu,mop:lu,mopen:lu,minner:lu},mopen:{},mclose:{mop:gi,mbin:nf,mrel:lu,minner:gi},mpunct:{mord:gi,mop:gi,mrel:lu,mopen:gi,mclose:gi,mpunct:gi,minner:gi},minner:{mord:gi,mop:gi,mbin:nf,mrel:lu,mopen:gi,mpunct:gi,minner:gi}},L9e={mord:{mop:gi},mop:{mord:gi,mop:gi},mbin:{},mrel:{},mopen:{},mclose:{mop:gi},mpunct:{},minner:{mop:gi}},WK={},MS={},DS={};function Yt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&M9e.has(v)?m.classes[0]="mord":v==="mbin"&&I9e.has(y)&&(g.classes[0]="mord")},{node:d},f,p),hL(a,(g,m)=>{var y,v,T=fL(m),x=fL(g),w=T&&x?g.hasClass("mtight")?(y=L9e[T])==null?void 0:y[x]:(v=R9e[T])==null?void 0:v[x]:null;if(w)return FK(w,u)},{node:d},f,p),a},hL=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},qK=function(e){return e instanceof Y0||e instanceof SS||e instanceof X0&&e.hasClass("enclosing")?e:null},dL=function(e,r){var n=qK(e);if(n){var i=n.children;if(i.length){if(r==="right")return dL(i[i.length-1],"right");if(r==="left")return dL(i[0],"left")}}return e},fL=function(e,r){if(!e)return null;r&&(e=dL(e,r));var n=e.classes[0];return N9e[n]||null},hx=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Dt(r.concat(n))},kn=function(e,r,n){if(!e)return Dt();if(MS[e.type]){var i=MS[e.type](e,r);if(n&&r.size!==n.size){i=Dt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Pt("Got group of unknown type: '"+e.type+"'")};function OS(t,e){var r=Dt(["base"],t,e),n=Dt(["strut"]);return n.style.height=Gt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Gt(-r.depth)),r.children.unshift(n),r}function pL(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=ea(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(OS(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(OS(s,e));var u;r?(u=OS(ea(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Dt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Gt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Gt(-h.depth))}return h}function VK(t){return new Y0(t)}class Ft{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=mh(this.classes));for(var n=0;n0&&(e+=' class ="'+es(mh(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class qi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return es(this.toText())}toText(){return this.text}}class UK{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Gt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var O9e=new Set(["\\imath","\\jmath"]),$9e=new Set(["mrow","mtable"]),Mo=function(e,r,n){return ui[r][e]&&ui[r][e].replace&&e.charCodeAt(0)!==55349&&!(EK.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ui[r][e].replace),new qi(e)},gL=function(e){return e.length===1?e[0]:new Ft("mrow",e)},P9e={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},mL=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=P9e[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(O9e.has(a))return null;if(ui[n][a]){var s=ui[n][a].replace;s&&(a=s)}var o=uL[r].fontName;return Z7(a,o,n)?uL[r].variant:null};function yL(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof qi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof qi&&r.text===","}else return!1}var ho=function(e,r,n){if(e.length===1){var i=Gn(e[0],r);return n&&i instanceof Ft&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||yL(s))){var u=l.children[0];u instanceof Ft&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof qi&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof qi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},xh=function(e,r,n){return gL(ho(e,r,n))},Gn=function(e,r){if(!e)return new Ft("mrow");if(DS[e.type])return DS[e.type](e,r);throw new Pt("Got group of unknown type: '"+e.type+"'")};function HK(t,e,r,n,i){var a=ho(t,r),s;a.length===1&&a[0]instanceof Ft&&$9e.has(a[0].type)?s=a[0]:s=new Ft("mrow",a);var o=new Ft("annotation",[new qi(e)]);o.setAttribute("encoding","application/x-tex");var l=new Ft("semantics",[s,o]),u=new Ft("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Dt([h],[u])}var B9e=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],YK=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],XK=function(e,r){return r.size<2?e:B9e[e-1][r.size-1]};class cu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||cu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=YK[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new cu(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:XK(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:YK[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=XK(cu.BASESIZE,e);return this.size===r&&this.textSize===cu.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==cu.BASESIZE?["sizing","reset-size"+this.size,"size"+cu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=T9e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}cu.BASESIZE=6;var jK=function(e){return new cu({style:e.displayMode?Gr.DISPLAY:Gr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},KK=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Dt(n,[e])}return e},F9e=function(e,r,n){var i=jK(n),a;if(n.output==="mathml")return HK(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=pL(e,i);a=Dt(["katex"],[s])}else{var o=HK(e,r,i,n.displayMode,!1),l=pL(e,i);a=Dt(["katex"],[o,l])}return KK(a,n)},z9e=function(e,r,n){var i=jK(n),a=pL(e,i),s=Dt(["katex"],[a]);return KK(s,n)},G9e={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},$S=function(e){var r=new Ft("mo",[new qi(G9e[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},W9e={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},q9e=new Set(["widehat","widecheck","widetilde","utilde"]),PS=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(q9e.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new yh(d),m=new au([g],{width:"100%",height:Gt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:bh([],[m],r),minWidth:0,height:f}}else{var y=[],v=W9e[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,x,w]=v,C=w/1e3,k=T.length,S,E;if(k===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');S=["hide-tail"],E=[v[3]]}else if(k===2)S=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(k===3)S=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+k+" children.");for(var L=0;L0&&(i.style.minWidth=Gt(a)),i},V9e=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Dt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new K7({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new K7({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new au(u,{width:"100%",height:Gt(o)});s=bh([],[h],a)}return s.height=o,s.style.height=Gt(o),s},U9e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},H9e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y9e(t){return t in U9e}function Ur(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function BS(t){var e=FS(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function FS(t){return t&&(t.type==="atom"||H9e.hasOwnProperty(t.type))?t:null}var ZK=t=>{if(t instanceof co)return t;if(x9e(t)&&t.children.length===1)return ZK(t.children[0])},vL=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Ur(t.base,"accent"),r=n.base,t.base=r,i=b9e(kn(t,e)),t.base=n):(n=Ur(t,"accent"),r=n.base);var a=kn(r,e.havingCrampedStyle()),s=n.isShifty&&nu(r),o=0;if(s){var l,u;o=(l=(u=ZK(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=PS(n,e),f=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Gt(2*o)+")",marginLeft:Gt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=GK("vec",e),g=zK.vec[1]):(p=LS({mode:n.mode,text:n.label},e,"textord"),p=v9e(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Dt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=Gt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Dt(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},QK=(t,e)=>{var r=t.isStretchy?$S(t.label):new Ft("mo",[Mo(t.label,t.mode)]),n=new Ft("mover",[Gn(t.base,e),r]);return n.setAttribute("accent","true"),n},X9e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Yt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=NS(e[0]),n=!X9e.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:vL,mathmlBuilder:QK}),Yt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:vL,mathmlBuilder:QK}),Yt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=kn(t.base,e),n=PS(t,e),i=t.label==="\\utilde"?.12:0,a=Sn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Dt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=$S(t.label),n=new Ft("munder",[Gn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var zS=t=>{var e=new Ft("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Yt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Z0(kn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Z0(kn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=PS(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=Sn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=Sn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Dt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=$S(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=zS(Gn(t.body,e));if(t.below){var a=zS(Gn(t.below,e));n=new Ft("munderover",[r,a,i])}else n=new Ft("mover",[r,i])}else if(t.below){var s=zS(Gn(t.below,e));n=new Ft("munder",[r,s])}else n=zS(),n=new Ft("mover",[r,n]);return n}});function JK(t,e){var r=ea(t.body,e,!0);return Dt([t.mclass],r,e)}function eZ(t,e){var r,n=ho(t.body,e);return t.mclass==="minner"?r=new Ft("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Ft("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Ft("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Yt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Wi(i),isCharacterBox:nu(i)}},htmlBuilder:JK,mathmlBuilder:eZ});var GS=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Yt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:GS(e[0]),body:Wi(e[1]),isCharacterBox:nu(e[1])}}}),Yt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=GS(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Wi(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:nu(l)}},htmlBuilder:JK,mathmlBuilder:eZ}),Yt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:GS(e[0]),body:Wi(e[0])}},htmlBuilder(t,e){var r=ea(t.body,e,!0),n=Dt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=ho(t.body,e),n=new Ft("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var j9e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tZ=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),rZ=t=>t.type==="textord"&&t.text==="@",K9e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Z9e(t,e,r){var n=j9e[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Q9e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Pt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=Z9e(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=tZ()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Yt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Z0(kn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Gt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Ft("mrow",[Gn(t.label,e)]);return r=new Ft("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ft("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),Yt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Z0(kn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Ft("mrow",[Gn(t.fragment,e)])}}),Yt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Ur(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Pt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var nZ=(t,e)=>{var r=ea(t.body,e.withColor(t.color),!1);return ou(r)},iZ=(t,e)=>{var r=ho(t.body,e.withColor(t.color)),n=new Ft("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Yt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Ur(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Wi(i)}},htmlBuilder:nZ,mathmlBuilder:iZ}),Yt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Ur(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:nZ,mathmlBuilder:iZ}),Yt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Ur(i,"size").value}},htmlBuilder(t,e){var r=Dt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Gt(pi(t.size,e)))),r},mathmlBuilder(t,e){var r=new Ft("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Gt(pi(t.size,e)))),r}});var bL={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},aZ=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Pt("Expected a control sequence",t);return e},J9e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},sZ=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Yt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(bL[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=bL[n.text]),Ur(e.parseFunction(),"internal");throw new Pt("Invalid token after macro prefix",n)}}),Yt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Pt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Pt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Pt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Pt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===bL[r]),{type:"internal",mode:e.mode}}}),Yt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=aZ(e.gullet.popToken());e.gullet.consumeSpaces();var i=J9e(e);return sZ(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Yt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=aZ(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return sZ(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var dx=function(e,r,n){var i=ui.math[e]&&ui.math[e].replace,a=Z7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},xL=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Dt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},oZ=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Gt(a),e.height-=a,e.depth+=a},eOe=function(e,r,n,i,a,s){var o=ms(e,"Main-Regular",a,i),l=xL(o,r,i,s);return oZ(l,i,r),l},tOe=function(e,r,n,i){return ms(e,"Size"+r+"-Regular",n,i)},lZ=function(e,r,n,i,a,s){var o=tOe(e,r,a,i),l=xL(Dt(["delimsizing","size"+r],[o],i),Gr.TEXT,i,s);return n&&oZ(l,i,Gr.TEXT),l},TL=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Dt(["delimsizinginner",i],[Dt([],[ms(e,r,n)])]);return{type:"elem",elem:a}},wL=function(e,r,n){var i=Kl["Size4-Regular"][e.charCodeAt(0)]?Kl["Size4-Regular"][e.charCodeAt(0)][4]:Kl["Size1-Regular"][e.charCodeAt(0)][4],a=new yh("inner",h9e(e,Math.round(1e3*r))),s=new au([a],{width:Gt(i),height:Gt(r),style:"width:"+Gt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=bh([],[s],n);return o.height=r,o.style.height=Gt(r),o.style.width=Gt(i),{type:"elem",elem:o}},CL=.008,WS={type:"kern",size:-1*CL},rOe=new Set(["|","\\lvert","\\rvert","\\vert"]),nOe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),cZ=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):rOe.has(e)?(u="∣",d="vert",f=333):nOe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=dx(o,p,a),m=g.height+g.depth,y=dx(u,p,a),v=y.height+y.depth,T=dx(h,p,a),x=T.height+T.depth,w=0,C=1;if(l!==null){var k=dx(l,p,a);w=k.height+k.depth,C=2}var S=m+x+w,E=Math.max(0,Math.ceil((r-S)/(C*v))),L=S+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var I=L/2-M,P=[];if(d.length>0){var $=L-m-x,_=Math.round(L*1e3),R=d9e(d,Math.round($*1e3)),O=new yh(d,R),D=Gt(f/1e3),N=Gt(_/1e3),B=new au([O],{width:D,height:N,viewBox:"0 0 "+f+" "+_}),F=bh([],[B],i);F.height=_/1e3,F.style.width=D,F.style.height=N,P.push({type:"elem",elem:F})}else{if(P.push(TL(h,p,a)),P.push(WS),l===null){var G=L-m-x+2*CL;P.push(wL(u,G,i))}else{var z=(L-m-x-w)/2+2*CL;P.push(wL(u,z,i)),P.push(WS),P.push(TL(l,p,a)),P.push(WS),P.push(wL(u,z,i))}P.push(WS),P.push(TL(o,p,a))}var W=i.havingBaseStyle(Gr.TEXT),V=Sn({positionType:"bottom",positionData:I,children:P});return xL(Dt(["delimsizing","mult"],[V],W),Gr.TEXT,i,s)},SL=80,kL=.08,EL=function(e,r,n,i,a){var s=u9e(e,i,n),o=new yh(e,s),l=new au([o],{width:"400em",height:Gt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return bh(["hide-tail"],[l],a)},iOe=function(e,r){var n=r.havingBaseSizing(),i=pZ("\\surd",e*n.sizeMultiplier,fZ,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+SL,e<1?a=1:e<1.4&&(a=.7),l=(1+s+kL)/a,u=(1+s)/a,o=EL("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+SL)*fx[i.size],u=(fx[i.size]+s)/a,l=(fx[i.size]+s+kL)/a,o=EL("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+kL,u=e+s,h=Math.floor(1e3*e+s)+SL,o=EL("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Gt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},uZ=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),aOe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),hZ=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),fx=[0,1.2,1.8,2.4,3],dZ=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),uZ.has(e)||hZ.has(e))return lZ(e,r,!1,n,i,a);if(aOe.has(e))return cZ(e,fx[r],!1,n,i,a);throw new Pt("Illegal delimiter: '"+e+"'")},sOe=[{type:"small",style:Gr.SCRIPTSCRIPT},{type:"small",style:Gr.SCRIPT},{type:"small",style:Gr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],oOe=[{type:"small",style:Gr.SCRIPTSCRIPT},{type:"small",style:Gr.SCRIPT},{type:"small",style:Gr.TEXT},{type:"stack"}],fZ=[{type:"small",style:Gr.SCRIPTSCRIPT},{type:"small",style:Gr.SCRIPT},{type:"small",style:Gr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lOe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},pZ=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},AL=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;hZ.has(e)?o=sOe:uZ.has(e)?o=fZ:o=oOe;var l=pZ(e,r,o,i);return l.type==="small"?eOe(e,l.style,n,i,a,s):l.type==="large"?lZ(e,l.size,n,i,a,s):cZ(e,r,n,i,a,s)},_L=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return AL(e,d,!0,i,a,s)},gZ={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},cOe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function mZ(t){return"isMiddle"in t}function qS(t,e){var r=FS(t);if(r&&cOe.has(r.text))return r;throw r?new Pt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Pt("Invalid delimiter type '"+t.type+"'",t)}Yt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=qS(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:gZ[t.funcName].size,mclass:gZ[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Dt([t.mclass]):dZ(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Mo(t.delim,t.mode));var r=new Ft("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Gt(fx[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function yZ(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Yt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Pt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:qS(e[0],t).text,color:r}}}),Yt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=qS(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Ur(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{yZ(t);for(var r=ea(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{yZ(t);var r=ho(t.body,e);if(t.left!=="."){var n=new Ft("mo",[Mo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Ft("mo",[Mo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return gL(r)}}),Yt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=qS(e[0],t);if(!t.parser.leftrightDepth)throw new Pt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=hx(e,[]):(r=dZ(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Mo("|","text"):Mo(t.delim,t.mode),n=new Ft("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var VS=(t,e)=>{var r=Z0(kn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=nu(t.body);if(n==="sout")a=Dt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=pi({number:.6,unit:"pt"},e),u=pi({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Gt(d/2+l);var f=Math.floor(1e3*d*i),p=l9e(f),g=new au([new yh("phase",p)],{width:"400em",height:Gt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=bh(["hide-tail"],[g],e),a.style.height=Gt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=V9e(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Gt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Gt(v),a.style.borderRightWidth=Gt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=Sn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];T=Sn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:x}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?Dt(["mord","cancel-lap"],[T],e):Dt(["mord"],[T],e)},US=(t,e)=>{var r,n=new Ft(t.label.includes("colorbox")?"mpadded":"menclose",[Gn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Gt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Yt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Ur(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:VS,mathmlBuilder:US}),Yt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Ur(e[0],"color-token").color,s=Ur(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:VS,mathmlBuilder:US}),Yt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),Yt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VS,mathmlBuilder:US}),Yt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VS,mathmlBuilder:US}),Yt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var vZ={};function Zl(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Pt("{"+t.envName+"} can be used only in display mode.")},uOe=new Set(["gather","gather*"]);function RL(t){if(!t.includes("ed"))return!t.includes("*")}function Th(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Pt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new fo("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),v.push(xZ(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var k={type:"ordgroup",mode:t.mode,body:C};r&&(k={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[k]}),g.push(k);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Pt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){w(),g.length===1&&k.type==="styling"&&k.body.length===1&&k.body[0].type==="ordgroup"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(x+=.25),u.push({pos:x,isDashed:ke[le]})}for(w(s[0]),n=0;n0&&(I+=T,Ske))for(n=0;n=o)){var J=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;J=(Z=(ee=W)==null?void 0:ee.pregap)!=null?Z:f,J!==0&&(R=Dt(["arraycolsep"],[]),R.style.width=Gt(J),_.push(R))}var re=[];for(n=0;n0){for(var me=K0("hline",r,h),$e=K0("hdashline",r,h),we=[{type:"elem",elem:Ce,shift:0}];u.length>0;){var Le=u.pop(),Ye=Le.pos-P;Le.isDashed?we.push({type:"elem",elem:$e,shift:Ye}):we.push({type:"elem",elem:me,shift:Ye})}Ce=Sn({positionType:"individualShift",children:we})}if(D.length===0)return Dt(["mord"],[Ce],r);var ce=Sn({positionType:"individualShift",children:D}),ye=Dt(["tag"],[ce],r);return ou([Ce,ye])},hOe={c:"center ",l:"left ",r:"right "},Jl=function(e,r){for(var n=[],i=new Ft("mtd",[],["mtr-glue"]),a=new Ft("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var x=v;x0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var M=1;M0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};Zl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=FS(e[0]),n=r?[e[0]]:Ur(e[0],"ordgroup").body,i=n.map(function(s){var o=BS(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Pt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Th(t.parser,a,LL(t.envName))},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Pt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Th(t.parser,n,LL(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Th(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=FS(e[0]),n=r?[e[0]]:Ur(e[0],"ordgroup").body,i=n.map(function(o){var l=BS(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Pt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Pt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Th(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Pt("{subarray} can contain only one column");return s},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Th(t.parser,e,LL(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:TZ,htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){uOe.has(t.envName)&&HS(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:RL(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Th(t.parser,e,"display")},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:TZ,htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){HS(t);var e={autoTag:RL(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Th(t.parser,e,"display")},htmlBuilder:Ql,mathmlBuilder:Jl}),Zl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return HS(t),Q9e(t.parser)},htmlBuilder:Ql,mathmlBuilder:Jl}),Ee("\\nonumber","\\gdef\\@eqnsw{0}"),Ee("\\notag","\\nonumber"),Yt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Pt(t.funcName+" valid only within array environment")}});var wZ=vZ;Yt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Pt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return kn(t.body,n)},SZ=(t,e)=>{var r=t.font,n=e.withFont(r);return Gn(t.body,n)},kZ={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Yt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=NS(e[0]),a=n;return a in kZ&&(a=kZ[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:CZ,mathmlBuilder:SZ}),Yt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:GS(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:nu(n)}}}),Yt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:CZ,mathmlBuilder:SZ});var dOe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=kn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d){var r=new Ft("mfrac",[Gn(t.numer,e),Gn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=pi(t.barSize,e);r.setAttribute("linethickness",Gt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Ft("mo",[new qi(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Ft("mo",[new qi(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return gL(i)}return r},EZ=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Yt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),EZ({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:dOe,mathmlBuilder:fOe}),Yt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var AZ=["display","text","script","scriptscript"],_Z=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Yt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=NS(e[0]),s=a.type==="atom"&&a.family==="open"?_Z(a.text):null,o=NS(e[1]),l=o.type==="atom"&&o.family==="close"?_Z(o.text):null,u=Ur(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Ur(p.body[0],"textord");f=AZ[Number(g.text)]}}else p=Ur(p,"textord"),f=AZ[Number(p.text)];return EZ({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),Yt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Ur(e[0],"size").value,token:i}}}),Yt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Ur(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var RZ=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?kn(t.sup,e.havingStyle(r.sup()),e):kn(t.sub,e.havingStyle(r.sub()),e),i=Ur(t.base,"horizBrace")):i=Ur(t,"horizBrace");var a=kn(i.base,e.havingBaseStyle(Gr.DISPLAY)),s=PS(i,e),o;if(i.isOver?o=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=Sn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Dt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=Sn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Dt(["minner",i.isOver?"mover":"munder"],[o],e)},pOe=(t,e)=>{var r=$S(t.label);return new Ft(t.isOver?"mover":"munder",[Gn(t.base,e),r])};Yt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:RZ,mathmlBuilder:pOe}),Yt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Ur(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Wi(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=ea(t.body,e,!1);return A9e(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=xh(t.body,e);return r instanceof Ft||(r=new Ft("mrow",[r])),r.setAttribute("href",t.href),r}}),Yt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Ur(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Ur(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=ea(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Dt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>xh(t.body,e)}),Yt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Wi(e[0]),mathml:Wi(e[1])}},htmlBuilder:(t,e)=>{var r=ea(t.html,e,!1);return ou(r)},mathmlBuilder:(t,e)=>xh(t.mathml,e)});var IL=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Pt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!xK(n))throw new Pt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Yt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Ur(r[0],"raw").string,u=l.split(","),h=0;h{var r=pi(t.height,e),n=0;t.totalheight.number>0&&(n=pi(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=pi(t.width,e));var a={height:Gt(r+n)};i>0&&(a.width=Gt(i)),n>0&&(a.verticalAlign=Gt(-n));var s=new m9e(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Ft("mglyph",[]);r.setAttribute("alt",t.alt);var n=pi(t.height,e),i=0;if(t.totalheight.number>0&&(i=pi(t.totalheight,e)-n,r.setAttribute("valign",Gt(-i))),r.setAttribute("height",Gt(n+i)),t.width.number>0){var a=pi(t.width,e);r.setAttribute("width",Gt(a))}return r.setAttribute("src",t.src),r}}),Yt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Ur(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return FK(t.dimension,e)},mathmlBuilder(t,e){var r=pi(t.dimension,e);return new UK(r)}}),Yt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Dt([],[kn(t.body,e)]),r=Dt(["inner"],[r],e)):r=Dt(["inner"],[kn(t.body,e)]);var n=Dt(["fix"],[]),i=Dt([t.alignment],[r,n],e),a=Dt(["strut"]);return a.style.height=Gt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Gt(-i.depth)),i.children.unshift(a),i=Dt(["thinbox"],[i],e),Dt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Ft("mpadded",[Gn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),Yt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),Yt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Pt("Mismatched "+t.funcName)}});var LZ=(t,e)=>{switch(e.style.size){case Gr.DISPLAY.size:return t.display;case Gr.TEXT.size:return t.text;case Gr.SCRIPT.size:return t.script;case Gr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Yt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Wi(e[0]),text:Wi(e[1]),script:Wi(e[2]),scriptscript:Wi(e[3])}},htmlBuilder:(t,e)=>{var r=LZ(t,e),n=ea(r,e,!1);return ou(n)},mathmlBuilder:(t,e)=>{var r=LZ(t,e);return xh(r,e)}});var IZ=(t,e,r,n,i,a,s)=>{t=Dt([],[t]);var o=r&&nu(r),l,u;if(e){var h=kn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=kn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=Sn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Gt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Gt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=Sn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Gt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=Sn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Gt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Dt(["mspace"],[],n);v.style.marginRight=Gt(a),y.unshift(v)}return Dt(["mop","op-limits"],y,n)},MZ=new Set(["\\smallint"]),Q0=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Ur(t.base,"op"),i=!0):a=Ur(t,"op");var s=e.style,o=!1;s.size===Gr.DISPLAY.size&&a.symbol&&!MZ.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=ms(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=GK(d+"Size"+(o?"2":"1"),e);l=Sn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=ea(a.body,e,!0);p.length===1&&p[0]instanceof co?(l=p[0],l.classes[0]="mop"):l=Dt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Ft("mo",[Mo(t.name,t.mode)]),MZ.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Ft("mo",ho(t.body,e));else{r=new Ft("mi",[new qi(t.name.slice(1))]);var n=new Ft("mo",[Mo("⁡","text")]);t.parentIsSupSub?r=new Ft("mrow",[r,n]):r=VK([r,n])}return r},gOe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Yt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=gOe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Q0,mathmlBuilder:px}),Yt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Wi(n)}},htmlBuilder:Q0,mathmlBuilder:px});var mOe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Yt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Q0,mathmlBuilder:px}),Yt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Q0,mathmlBuilder:px}),Yt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=mOe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Q0,mathmlBuilder:px});var DZ=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Ur(t.base,"operatorname"),i=!0):a=Ur(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=ea(o,e.withFont("mathrm"),!0),u=0;u{for(var r=ho(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new qi(o)]}var l=new Ft("mi",r);l.setAttribute("mathvariant","normal");var u=new Ft("mo",[Mo("⁡","text")]);return t.parentIsSupSub?new Ft("mrow",[l,u]):VK([l,u])};Yt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Wi(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:DZ,mathmlBuilder:yOe}),Ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),af({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?ou(ea(t.body,e,!1)):Dt(["mord"],ea(t.body,e,!0),e)},mathmlBuilder(t,e){return xh(t.body,e,!0)}}),Yt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=kn(t.body,e.havingCrampedStyle()),n=K0("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Dt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Ft("mo",[new qi("‾")]);r.setAttribute("stretchy","true");var n=new Ft("mover",[Gn(t.body,e),r]);return n.setAttribute("accent","true"),n}}),Yt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Wi(n)}},htmlBuilder:(t,e)=>{var r=ea(t.body,e.withPhantom(),!1);return ou(r)},mathmlBuilder:(t,e)=>{var r=ho(t.body,e);return new Ft("mphantom",r)}}),Ee("\\hphantom","\\smash{\\phantom{#1}}"),Yt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Dt(["inner"],[kn(t.body,e.withPhantom())]),n=Dt(["fix"],[]);return Dt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=ho(Wi(t.body),e),n=new Ft("mphantom",r),i=new Ft("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Yt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Ur(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=kn(t.body,e),n=pi(t.dy,e);return Sn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ft("mpadded",[Gn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),Yt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),Yt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Ur(e[0],"size"),s=Ur(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Ur(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Dt(["mord","rule"],[],e),n=pi(t.width,e),i=pi(t.height,e),a=t.shift?pi(t.shift,e):0;return r.style.borderRightWidth=Gt(n),r.style.borderTopWidth=Gt(i),r.style.bottom=Gt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=pi(t.width,e),n=pi(t.height,e),i=t.shift?pi(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Ft("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Gt(r)),s.setAttribute("height",Gt(n));var o=new Ft("mpadded",[s]);return i>=0?o.setAttribute("height",Gt(i)):(o.setAttribute("height",Gt(i)),o.setAttribute("depth",Gt(-i))),o.setAttribute("voffset",Gt(i)),o}});function NZ(t,e,r){for(var n=ea(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return NZ(t.body,r,e)};Yt({type:"sizing",names:OZ,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:OZ.indexOf(n)+1,body:a}},htmlBuilder:vOe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=ho(t.body,r),i=new Ft("mstyle",n);return i.setAttribute("mathsize",Gt(r.sizeMultiplier)),i}}),Yt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Ur(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Dt([],[kn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Dt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Ft("mpadded",[Gn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),Yt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=kn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Z0(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=Gt(h);var p=Sn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Gr.SCRIPTSCRIPT),m=kn(t.index,g,e),y=.6*(p.height-p.depth),v=Sn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=Dt(["root"],[v]);return Dt(["mord","sqrt"],[T,p],e)}else return Dt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Ft("mroot",[Gn(r,e),Gn(n,e)]):new Ft("msqrt",[Gn(r,e)])}});var ML={display:Gr.DISPLAY,text:Gr.TEXT,script:Gr.SCRIPT,scriptscript:Gr.SCRIPTSCRIPT};function bOe(t){return t in ML}Yt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!bOe(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=ML[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),NZ(t.body,n,e)},mathmlBuilder(t,e){var r=ML[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=ho(t.body,n),a=new Ft("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var xOe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Gr.DISPLAY.size||n.alwaysHandleSupSub);return i?Q0:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Gr.DISPLAY.size||n.limits);return a?DZ:null}else{if(n.type==="accent")return nu(n.base)?vL:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?RZ:null}else return null}else return null};af({type:"supsub",htmlBuilder(t,e){var r=xOe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=kn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&nu(n);if(i){var p=e.havingStyle(e.style.sup());o=kn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=kn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Gr.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Gt(.5/u.ptPerEm/y),T=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof co||x){var w;T=Gt(-((w=s.italic)!=null?w:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var k=u.defaultRuleThickness,S=4*k;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];C=Sn({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];C=Sn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=Sn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var I=fL(s,"right")||"mord";return Dt([I],[s,Dt(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Gn(t.base,e)];t.sub&&a.push(Gn(t.sub,e)),t.sup&&a.push(Gn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Gr.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Gr.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Gr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Gr.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Gr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Gr.DISPLAY)?s="mover":s="msup"}return new Ft(s,a)}}),af({type:"atom",htmlBuilder(t,e){return lL(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Ft("mo",[Mo(t.text,t.mode)]);if(t.family==="bin"){var n=mL(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var $Z={mi:"italic",mn:"normal",mtext:"normal"};af({type:"mathord",htmlBuilder(t,e){return LS(t,e,"mathord")},mathmlBuilder(t,e){var r=new Ft("mi",[Mo(t.text,t.mode,e)]),n=mL(t,e)||"italic";return n!==$Z[r.type]&&r.setAttribute("mathvariant",n),r}}),af({type:"textord",htmlBuilder(t,e){return LS(t,e,"textord")},mathmlBuilder(t,e){var r=Mo(t.text,t.mode,e),n=mL(t,e)||"normal",i;return t.mode==="text"?i=new Ft("mtext",[r]):/[0-9]/.test(t.text)?i=new Ft("mn",[r]):t.text==="\\prime"?i=new Ft("mo",[r]):i=new Ft("mi",[r]),n!==$Z[i.type]&&i.setAttribute("mathvariant",n),i}});var DL={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},NL={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};af({type:"spacing",htmlBuilder(t,e){if(NL.hasOwnProperty(t.text)){var r=NL[t.text].className||"";if(t.mode==="text"){var n=LS(t,e,"textord");return n.classes.push(r),n}else return Dt(["mspace",r],[lL(t.text,t.mode,e)],e)}else{if(DL.hasOwnProperty(t.text))return Dt(["mspace",DL[t.text]],[],e);throw new Pt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(NL.hasOwnProperty(t.text))r=new Ft("mtext",[new qi(" ")]);else{if(DL.hasOwnProperty(t.text))return new Ft("mspace");throw new Pt('Unknown type of space "'+t.text+'"')}return r}});var PZ=()=>{var t=new Ft("mtd",[]);return t.setAttribute("width","50%"),t};af({type:"tag",mathmlBuilder(t,e){var r=new Ft("mtable",[new Ft("mtr",[PZ(),new Ft("mtd",[xh(t.body,e)]),PZ(),new Ft("mtd",[xh(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var BZ={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},FZ={"\\textbf":"textbf","\\textmd":"textmd"},TOe={"\\textit":"textit","\\textup":"textup"},zZ=(t,e)=>{var r=t.font;if(r){if(BZ[r])return e.withTextFontFamily(BZ[r]);if(FZ[r])return e.withTextFontWeight(FZ[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(TOe[r])};Yt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Wi(i),font:n}},htmlBuilder(t,e){var r=zZ(t,e),n=ea(t.body,r,!0);return Dt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=zZ(t,e);return xh(t.body,r)}}),Yt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=kn(t.body,e),n=K0("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Sn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Dt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Ft("mo",[new qi("‾")]);r.setAttribute("stretchy","true");var n=new Ft("munder",[Gn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),Yt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=kn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Sn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ft("mpadded",[Gn(t.body,e)],["vcenter"]);return new Ft("mrow",[r])}}),Yt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Pt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=GZ(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),wh=WK,WZ=`[ \r + ]`,wOe="\\\\[a-zA-Z@]+",COe="\\\\[^\uD800-\uDFFF]",SOe="("+wOe+")"+WZ+"*",kOe=`\\\\( |[ \r ]+ -?)[ \r ]*`,lR="[̀-ͯ]",VLe=new RegExp(lR+"+$"),WLe="("+VX+"+)|"+(qLe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(lR+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(lR+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+GLe)+("|"+zLe+")");let WX=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(WLe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new qs("EOF",new bs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Mt("Unexpected character: '"+e[r]+"'",new qs(e[r],new bs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new qs(i,new bs(this,r,this.tokenRegex.lastIndex))}};class ULe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Mt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var HLe=xX;ge("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ge("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ge("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ge("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ge("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ge("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ge("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var UX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ge("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Mt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=UX[e.text],n==null||n>=r)throw new Mt("Invalid base-"+r+" digit "+e.text);for(var i;(i=UX[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Mt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Mt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Mt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Mt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ge("\\newcommand",t=>cR(t,!1,!0,!1)),ge("\\renewcommand",t=>cR(t,!0,!1,!1)),ge("\\providecommand",t=>cR(t,!0,!0,!0)),ge("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ge("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ge("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Wu[r],Hn.math[r],Hn.text[r]),""}),ge("\\bgroup","{"),ge("\\egroup","}"),ge("~","\\nobreakspace"),ge("\\lq","`"),ge("\\rq","'"),ge("\\aa","\\r a"),ge("\\AA","\\r A"),ge("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ge("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ge("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ge("ℬ","\\mathscr{B}"),ge("ℰ","\\mathscr{E}"),ge("ℱ","\\mathscr{F}"),ge("ℋ","\\mathscr{H}"),ge("ℐ","\\mathscr{I}"),ge("ℒ","\\mathscr{L}"),ge("ℳ","\\mathscr{M}"),ge("ℛ","\\mathscr{R}"),ge("ℭ","\\mathfrak{C}"),ge("ℌ","\\mathfrak{H}"),ge("ℨ","\\mathfrak{Z}"),ge("\\Bbbk","\\Bbb{k}"),ge("\\llap","\\mathllap{\\textrm{#1}}"),ge("\\rlap","\\mathrlap{\\textrm{#1}}"),ge("\\clap","\\mathclap{\\textrm{#1}}"),ge("\\mathstrut","\\vphantom{(}"),ge("\\underbar","\\underline{\\text{#1}}"),ge("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ge("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ge("\\ne","\\neq"),ge("≠","\\neq"),ge("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ge("∉","\\notin"),ge("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ge("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ge("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ge("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ge("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ge("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ge("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ge("⟂","\\perp"),ge("‼","\\mathclose{!\\mkern-0.8mu!}"),ge("∌","\\notni"),ge("⌜","\\ulcorner"),ge("⌝","\\urcorner"),ge("⌞","\\llcorner"),ge("⌟","\\lrcorner"),ge("©","\\copyright"),ge("®","\\textregistered"),ge("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ge("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ge("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ge("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ge("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ge("⋮","\\vdots"),ge("\\varGamma","\\mathit{\\Gamma}"),ge("\\varDelta","\\mathit{\\Delta}"),ge("\\varTheta","\\mathit{\\Theta}"),ge("\\varLambda","\\mathit{\\Lambda}"),ge("\\varXi","\\mathit{\\Xi}"),ge("\\varPi","\\mathit{\\Pi}"),ge("\\varSigma","\\mathit{\\Sigma}"),ge("\\varUpsilon","\\mathit{\\Upsilon}"),ge("\\varPhi","\\mathit{\\Phi}"),ge("\\varPsi","\\mathit{\\Psi}"),ge("\\varOmega","\\mathit{\\Omega}"),ge("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ge("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ge("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ge("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ge("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ge("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ge("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ge("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var HX={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},YLe=new Set(["bin","rel"]);ge("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in HX?e=HX[r]:(r.slice(0,4)==="\\not"||r in Hn.math&&YLe.has(Hn.math[r].group))&&(e="\\dotsb"),e});var uR={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ge("\\dotso",function(t){var e=t.future().text;return e in uR?"\\ldots\\,":"\\ldots"}),ge("\\dotsc",function(t){var e=t.future().text;return e in uR&&e!==","?"\\ldots\\,":"\\ldots"}),ge("\\cdots",function(t){var e=t.future().text;return e in uR?"\\@cdots\\,":"\\@cdots"}),ge("\\dotsb","\\cdots"),ge("\\dotsm","\\cdots"),ge("\\dotsi","\\!\\cdots"),ge("\\dotsx","\\ldots\\,"),ge("\\DOTSI","\\relax"),ge("\\DOTSB","\\relax"),ge("\\DOTSX","\\relax"),ge("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ge("\\,","\\tmspace+{3mu}{.1667em}"),ge("\\thinspace","\\,"),ge("\\>","\\mskip{4mu}"),ge("\\:","\\tmspace+{4mu}{.2222em}"),ge("\\medspace","\\:"),ge("\\;","\\tmspace+{5mu}{.2777em}"),ge("\\thickspace","\\;"),ge("\\!","\\tmspace-{3mu}{.1667em}"),ge("\\negthinspace","\\!"),ge("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ge("\\negthickspace","\\tmspace-{5mu}{.277em}"),ge("\\enspace","\\kern.5em "),ge("\\enskip","\\hskip.5em\\relax"),ge("\\quad","\\hskip1em\\relax"),ge("\\qquad","\\hskip2em\\relax"),ge("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ge("\\tag@paren","\\tag@literal{({#1})}"),ge("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Mt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ge("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ge("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ge("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ge("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ge("\\newline","\\\\\\relax"),ge("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var YX=Pt(Tl["Main-Regular"][84][1]-.7*Tl["Main-Regular"][65][1]);ge("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+YX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ge("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+YX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ge("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ge("\\@hspace","\\hskip #1\\relax"),ge("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ge("\\ordinarycolon",":"),ge("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ge("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ge("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ge("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ge("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ge("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ge("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ge("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ge("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ge("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ge("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ge("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ge("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ge("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ge("∷","\\dblcolon"),ge("∹","\\eqcolon"),ge("≔","\\coloneqq"),ge("≕","\\eqqcolon"),ge("⩴","\\Coloneqq"),ge("\\ratio","\\vcentcolon"),ge("\\coloncolon","\\dblcolon"),ge("\\colonequals","\\coloneqq"),ge("\\coloncolonequals","\\Coloneqq"),ge("\\equalscolon","\\eqqcolon"),ge("\\equalscoloncolon","\\Eqqcolon"),ge("\\colonminus","\\coloneq"),ge("\\coloncolonminus","\\Coloneq"),ge("\\minuscolon","\\eqcolon"),ge("\\minuscoloncolon","\\Eqcolon"),ge("\\coloncolonapprox","\\Colonapprox"),ge("\\coloncolonsim","\\Colonsim"),ge("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ge("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ge("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ge("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ge("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ge("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ge("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ge("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ge("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ge("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ge("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ge("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ge("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ge("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ge("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ge("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ge("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ge("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ge("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ge("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ge("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ge("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ge("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ge("\\imath","\\html@mathml{\\@imath}{ı}"),ge("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ge("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ge("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ge("⟦","\\llbracket"),ge("⟧","\\rrbracket"),ge("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ge("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ge("⦃","\\lBrace"),ge("⦄","\\rBrace"),ge("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ge("⦵","\\minuso"),ge("\\darr","\\downarrow"),ge("\\dArr","\\Downarrow"),ge("\\Darr","\\Downarrow"),ge("\\lang","\\langle"),ge("\\rang","\\rangle"),ge("\\uarr","\\uparrow"),ge("\\uArr","\\Uparrow"),ge("\\Uarr","\\Uparrow"),ge("\\N","\\mathbb{N}"),ge("\\R","\\mathbb{R}"),ge("\\Z","\\mathbb{Z}"),ge("\\alef","\\aleph"),ge("\\alefsym","\\aleph"),ge("\\Alpha","\\mathrm{A}"),ge("\\Beta","\\mathrm{B}"),ge("\\bull","\\bullet"),ge("\\Chi","\\mathrm{X}"),ge("\\clubs","\\clubsuit"),ge("\\cnums","\\mathbb{C}"),ge("\\Complex","\\mathbb{C}"),ge("\\Dagger","\\ddagger"),ge("\\diamonds","\\diamondsuit"),ge("\\empty","\\emptyset"),ge("\\Epsilon","\\mathrm{E}"),ge("\\Eta","\\mathrm{H}"),ge("\\exist","\\exists"),ge("\\harr","\\leftrightarrow"),ge("\\hArr","\\Leftrightarrow"),ge("\\Harr","\\Leftrightarrow"),ge("\\hearts","\\heartsuit"),ge("\\image","\\Im"),ge("\\infin","\\infty"),ge("\\Iota","\\mathrm{I}"),ge("\\isin","\\in"),ge("\\Kappa","\\mathrm{K}"),ge("\\larr","\\leftarrow"),ge("\\lArr","\\Leftarrow"),ge("\\Larr","\\Leftarrow"),ge("\\lrarr","\\leftrightarrow"),ge("\\lrArr","\\Leftrightarrow"),ge("\\Lrarr","\\Leftrightarrow"),ge("\\Mu","\\mathrm{M}"),ge("\\natnums","\\mathbb{N}"),ge("\\Nu","\\mathrm{N}"),ge("\\Omicron","\\mathrm{O}"),ge("\\plusmn","\\pm"),ge("\\rarr","\\rightarrow"),ge("\\rArr","\\Rightarrow"),ge("\\Rarr","\\Rightarrow"),ge("\\real","\\Re"),ge("\\reals","\\mathbb{R}"),ge("\\Reals","\\mathbb{R}"),ge("\\Rho","\\mathrm{P}"),ge("\\sdot","\\cdot"),ge("\\sect","\\S"),ge("\\spades","\\spadesuit"),ge("\\sub","\\subset"),ge("\\sube","\\subseteq"),ge("\\supe","\\supseteq"),ge("\\Tau","\\mathrm{T}"),ge("\\thetasym","\\vartheta"),ge("\\weierp","\\wp"),ge("\\Zeta","\\mathrm{Z}"),ge("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ge("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ge("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ge("\\bra","\\mathinner{\\langle{#1}|}"),ge("\\ket","\\mathinner{|{#1}\\rangle}"),ge("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ge("\\Bra","\\left\\langle#1\\right|"),ge("\\Ket","\\left|#1\\right\\rangle");var XX=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ge("\\bra@ket",XX(!1)),ge("\\bra@set",XX(!0)),ge("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ge("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ge("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ge("\\angln","{\\angl n}"),ge("\\blue","\\textcolor{##6495ed}{#1}"),ge("\\orange","\\textcolor{##ffa500}{#1}"),ge("\\pink","\\textcolor{##ff00af}{#1}"),ge("\\red","\\textcolor{##df0030}{#1}"),ge("\\green","\\textcolor{##28ae7b}{#1}"),ge("\\gray","\\textcolor{gray}{#1}"),ge("\\purple","\\textcolor{##9d38bd}{#1}"),ge("\\blueA","\\textcolor{##ccfaff}{#1}"),ge("\\blueB","\\textcolor{##80f6ff}{#1}"),ge("\\blueC","\\textcolor{##63d9ea}{#1}"),ge("\\blueD","\\textcolor{##11accd}{#1}"),ge("\\blueE","\\textcolor{##0c7f99}{#1}"),ge("\\tealA","\\textcolor{##94fff5}{#1}"),ge("\\tealB","\\textcolor{##26edd5}{#1}"),ge("\\tealC","\\textcolor{##01d1c1}{#1}"),ge("\\tealD","\\textcolor{##01a995}{#1}"),ge("\\tealE","\\textcolor{##208170}{#1}"),ge("\\greenA","\\textcolor{##b6ffb0}{#1}"),ge("\\greenB","\\textcolor{##8af281}{#1}"),ge("\\greenC","\\textcolor{##74cf70}{#1}"),ge("\\greenD","\\textcolor{##1fab54}{#1}"),ge("\\greenE","\\textcolor{##0d923f}{#1}"),ge("\\goldA","\\textcolor{##ffd0a9}{#1}"),ge("\\goldB","\\textcolor{##ffbb71}{#1}"),ge("\\goldC","\\textcolor{##ff9c39}{#1}"),ge("\\goldD","\\textcolor{##e07d10}{#1}"),ge("\\goldE","\\textcolor{##a75a05}{#1}"),ge("\\redA","\\textcolor{##fca9a9}{#1}"),ge("\\redB","\\textcolor{##ff8482}{#1}"),ge("\\redC","\\textcolor{##f9685d}{#1}"),ge("\\redD","\\textcolor{##e84d39}{#1}"),ge("\\redE","\\textcolor{##bc2612}{#1}"),ge("\\maroonA","\\textcolor{##ffbde0}{#1}"),ge("\\maroonB","\\textcolor{##ff92c6}{#1}"),ge("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ge("\\maroonD","\\textcolor{##ca337c}{#1}"),ge("\\maroonE","\\textcolor{##9e034e}{#1}"),ge("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ge("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ge("\\purpleC","\\textcolor{##aa87ff}{#1}"),ge("\\purpleD","\\textcolor{##7854ab}{#1}"),ge("\\purpleE","\\textcolor{##543b78}{#1}"),ge("\\mintA","\\textcolor{##f5f9e8}{#1}"),ge("\\mintB","\\textcolor{##edf2df}{#1}"),ge("\\mintC","\\textcolor{##e0e5cc}{#1}"),ge("\\grayA","\\textcolor{##f6f7f7}{#1}"),ge("\\grayB","\\textcolor{##f0f1f2}{#1}"),ge("\\grayC","\\textcolor{##e3e5e6}{#1}"),ge("\\grayD","\\textcolor{##d6d8da}{#1}"),ge("\\grayE","\\textcolor{##babec2}{#1}"),ge("\\grayF","\\textcolor{##888d93}{#1}"),ge("\\grayG","\\textcolor{##626569}{#1}"),ge("\\grayH","\\textcolor{##3b3e40}{#1}"),ge("\\grayI","\\textcolor{##21242c}{#1}"),ge("\\kaBlue","\\textcolor{##314453}{#1}"),ge("\\kaGreen","\\textcolor{##71B307}{#1}");var KX={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class XLe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new ULe(HLe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new WX(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new qs("EOF",n.loc)),this.pushTokens(i),new qs("",bs.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Mt("Extra }",a)}else if(a.text==="EOF")throw new Mt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Mt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Mt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Mt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Mt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Mt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new qs(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new WX(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Wu.hasOwnProperty(e)||Hn.math.hasOwnProperty(e)||Hn.text.hasOwnProperty(e)||KX.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Wu.hasOwnProperty(e)&&!Wu[e].primitive}}var jX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,HC=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),hR={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},ZX={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let QX=class cbe{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new XLe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Mt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new qs("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(cbe.endOfExpression.has(i.text)||r&&i.text===r||e&&Wu[i.text]&&Wu[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(bY(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:bs.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=PIe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function g0(t){return function(){return t}}var KC=(function(){try{var t=kd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),GIe=KC?function(t,e){return KC(t,"toString",{configurable:!0,enumerable:!1,value:g0(e),writable:!0})}:wd,mK=zIe(GIe);function yK(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var HIe=9007199254740991,YIe=/^(?:0|[1-9]\d*)$/;function jC(t,e){var r=typeof t;return e=e??HIe,!!e&&(r=="number"||r!="symbol"&&YIe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=jIe}function Uu(t){return t!=null&&mR(t.length)&&!xb(t)}function wb(t,e,r){if(!Vs(r))return!1;var n=typeof e;return(n=="number"?Uu(r)&&jC(e,r.length):n=="string"&&e in r)?m0(r[e],t):!1}function ZIe(t){return JC(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&wb(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function sDe(t,e){var r=this.__data__,n=n5(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Mc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&hNe?new _b:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&wb(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var eOe=Math.max;function tOe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:yIe(r);return i<0&&(i=eOe(n+i,0)),vK(t,Hu(e),i)}var $R=JNe(tOe);function yj(t,e){var r=-1,n=Uu(t)?Array(t.length):[];return c5(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function ki(t,e){var r=Ci(t)?p0:yj;return r(t,Hu(e))}function rOe(t,e){return t==null?t:IR(t,OR(e),Ed)}function nOe(t,e){return t&&DR(t,OR(e))}function iOe(t,e){return t>e}var aOe=Object.prototype,sOe=aOe.hasOwnProperty;function oOe(t,e){return t!=null&&sOe.call(t,e)}function vj(t,e){return t!=null&&dj(t,e,oOe)}function lOe(t,e){return p0(e,function(r){return t[r]})}function $c(t){return t==null?[]:lOe(t,Ws(t))}var cOe="[object Map]",uOe="[object Set]",hOe=Object.prototype,dOe=hOe.hasOwnProperty;function bj(t){if(t==null)return!0;if(Uu(t)&&(Ci(t)||typeof t=="string"||typeof t.splice=="function"||v0(t)||r5(t)||y0(t)))return!t.length;var e=co(t);if(e==cOe||e==uOe)return!t.size;if(e5(t))return!LK(t).length;for(var r in t)if(dOe.call(t,r))return!1;return!0}function di(t){return t===void 0}function xj(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function vOe(t,e,r){e.length?e=p0(e,function(a){return Ci(a)?function(s){return s5(s,a.length===1?a[0]:a)}:a}):e=[wd];var n=-1;e=p0(e,t5(Hu));var i=yj(t,function(a,s,o){var l=p0(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return gOe(i,function(a,s){return yOe(a,s,r)})}function bOe(t,e){return pOe(t,e,function(r,n){return fj(t,n)})}var d5=TDe(function(t,e){return t==null?{}:bOe(t,e)}),xOe=Math.ceil,TOe=Math.max;function wOe(t,e,r,n){for(var i=-1,a=TOe(xOe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function COe(t){return function(e,r,n){return n&&typeof n!="number"&&wb(e,r,n)&&(r=n=void 0),e=XC(e),r===void 0?(r=e,e=0):r=XC(r),n=n===void 0?e1&&wb(t,e[0],e[1])?e=[]:r>2&&wb(e[0],e[1],e[2])&&(e=[e[0]]),vOe(t,TR(e),[])}),EOe=1/0,SOe=T0&&1/_R(new T0([,-0]))[1]==EOe?function(t){return new T0(t)}:$Ie,AOe=200;function _Oe(t,e,r){var n=-1,i=UIe,a=t.length,s=!0,o=[],l=o;if(a>=AOe){var u=SOe(t);if(u)return _R(u);s=!1,i=ij,l=new _b}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=_d,this._children[e]={},this._children[_d][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],gt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),gt(Ws(this._in[e]),r),delete this._in[e],delete this._preds[e],gt(Ws(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(di(r))r=_d;else{r+="";for(var n=r;!di(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==_d)return r}}children(e){if(di(e)&&(e=_d),this._isCompound){var r=this._children[e];if(r)return Ws(r)}else{if(e===_d)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Ws(r)}successors(e){var r=this._sucs[e];if(r)return Ws(r)}neighbors(e){var r=this.predecessors(e);if(r)return ROe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;gt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),gt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&>(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return xb(e)||(e=g0(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return $c(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Lb(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,di(n)||(n=""+n);var o=Db(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!di(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=NOe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,wj(this._preds[r],e),wj(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?GR(this._isDirected,arguments[0]):Db(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?GR(this._isDirected,arguments[0]):Db(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?GR(this._isDirected,arguments[0]):Db(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Cj(this._preds[r],e),Cj(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=$c(n);return r?Oc(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=$c(n);return r?Oc(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}xs.prototype._nodeCount=0,xs.prototype._edgeCount=0;function wj(t,e){t[e]?t[e]++:t[e]=1}function Cj(t,e){--t[e]||delete t[e]}function Db(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+Tj+a+Tj+(di(n)?MOe:n)}function NOe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function GR(t,e){return Db(t,e.v,e.w,e.name)}class OOe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return kj(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&kj(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,$Oe)),n=n._prev;return"["+e.join(", ")+"]"}}function kj(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function $Oe(t,e){if(t!=="_next"&&t!=="_prev")return e}var POe=g0(1);function BOe(t,e){if(t.nodeCount()<=1)return[];var r=zOe(t,e||POe),n=FOe(r.graph,r.buckets,r.zeroIdx);return x0(ki(n,function(i){return t.outEdges(i.v,i.w)}))}function FOe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)qR(t,e,r,s);for(;s=i.dequeue();)qR(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(qR(t,e,r,s,!0));break}}}return n}function qR(t,e,r,n,i){var a=i?[]:void 0;return gt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,VR(e,r,l)}),gt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,VR(e,r,u)}),t.removeNode(n.v),a}function zOe(t,e){var r=new xs,n=0,i=0;gt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),gt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=w0(i+n+3).map(function(){return new OOe}),s=n+1;return gt(r.nodes(),function(o){VR(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function VR(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function GOe(t){var e=t.graph().acyclicer==="greedy"?BOe(t,r(t)):qOe(t);gt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,zR("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function qOe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,gt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return gt(t.nodes(),i),e}function VOe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function C0(t,e,r,n){var i;do i=zR(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function WOe(t){var e=new xs().setGraph(t.graph());return gt(t.nodes(),function(r){e.setNode(r,t.node(r))}),gt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function Ej(t){var e=new xs({multigraph:t.isMultigraph()}).setGraph(t.graph());return gt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),gt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function Sj(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function f5(t){var e=ki(w0(_j(t)+1),function(){return[]});return gt(t.nodes(),function(r){var n=t.node(r),i=n.rank;di(i)||(e[i][n.order]=r)}),e}function UOe(t){var e=Rb(ki(t.nodes(),function(r){return t.node(r).rank}));gt(t.nodes(),function(r){var n=t.node(r);vj(n,"rank")&&(n.rank-=e)})}function HOe(t){var e=Rb(ki(t.nodes(),function(a){return t.node(a).rank})),r=[];gt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;gt(r,function(a,s){di(a)&&s%i!==0?--n:n&>(a,function(o){t.node(o).rank+=n})})}function Aj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),C0(t,"border",i,e)}function _j(t){return Ad(ki(t.nodes(),function(e){var r=t.node(e).rank;if(!di(r))return r}))}function YOe(t,e){var r={lhs:[],rhs:[]};return gt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function XOe(t,e){return e()}function KOe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&>(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Oc(e.edges(),function(h){return l===zj(t,t.node(h.v),o)&&l!==zj(t,t.node(h.w),o)});return FR(u,function(h){return Mb(e,h)})}function Fj(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),XR(t),YR(t,e),u$e(t,e)}function u$e(t,e){var r=$R(t.nodes(),function(i){return!e.node(i).parent}),n=l$e(t,r);n=n.slice(1),gt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function h$e(t,e,r){return t.hasEdge(e,r)}function zj(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function d$e(t){switch(t.graph().ranker){case"network-simplex":Gj(t);break;case"tight-tree":p$e(t);break;case"longest-path":f$e(t);break;default:Gj(t)}}var f$e=HR;function p$e(t){HR(t),Dj(t)}function Gj(t){Rd(t)}function g$e(t){var e=C0(t,"root",{},"_root"),r=m$e(t),n=Ad($c(r))-1,i=2*n+1;t.graph().nestingRoot=e,gt(t.edges(),function(s){t.edge(s).minlen*=i});var a=y$e(t)+1;gt(t.children(),function(s){qj(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function qj(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=Aj(t,"_bt"),u=Aj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,gt(o,function(d){qj(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function m$e(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&>(a,function(s){r(s,i+1)}),e[n]=i}return gt(t.children(),function(n){r(n,1)}),e}function y$e(t){return Lb(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function v$e(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,gt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function b$e(t,e,r){var n={},i;gt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function x$e(t,e,r){var n=T$e(t),i=new xs({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return gt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),gt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=di(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function T$e(t){for(var e;t.hasNode(e=zR("_root")););return e}function w$e(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function k$e(t){var e={},r=Oc(t.nodes(),function(o){return!t.children(o).length}),n=Ad(ki(r,function(o){return t.node(o).rank})),i=ki(w0(n+1),function(){return[]});function a(o){if(!vj(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),gt(t.successors(o),a)}}var s=Ib(r,function(o){return t.node(o).rank});return gt(s,a),i}function E$e(t,e){return ki(e,function(r){var n=t.inEdges(r);if(n.length){var i=Lb(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function S$e(t,e){var r={};gt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};di(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),gt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!di(a)&&!di(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Oc(r,function(i){return!i.indegree});return A$e(n)}function A$e(t){var e=[];function r(a){return function(s){s.merged||(di(s.barycenter)||di(a.barycenter)||s.barycenter>=a.barycenter)&&_$e(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),gt(i.in.reverse(),r(i)),gt(i.out,n(i))}return ki(Oc(e,function(a){return!a.merged}),function(a){return d5(a,["vs","i","barycenter","weight"])})}function _$e(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function R$e(t,e){var r=YOe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Ib(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(L$e(!!e)),l=Vj(a,i,l),gt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=Vj(a,i,l)});var u={vs:x0(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function Vj(t,e,r){for(var n;e.length&&(n=u5(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function L$e(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Wj(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Oc(i,function(g){return g!==s&&g!==o}));var u=E$e(t,i);gt(u,function(g){if(t.children(g.v).length){var m=Wj(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&D$e(g,m)}});var h=S$e(u,r);I$e(h,l);var d=R$e(h,n);if(s&&(d.vs=x0([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function I$e(t,e){gt(t,function(r){r.vs=x0(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function D$e(t,e){di(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function M$e(t){var e=_j(t),r=Uj(t,w0(1,e+1),"inEdges"),n=Uj(t,w0(e-1,-1,-1),"outEdges"),i=k$e(t);Hj(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){N$e(o%2?r:n,o%4>=2),i=f5(t);var u=w$e(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function P$e(t){var e={},r=0;function n(i){var a=r;gt(t.children(i),n),e[i]={low:a,lim:r++}}return gt(t.children(),n),e}function B$e(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=u5(a);return gt(a,function(h,d){var f=z$e(t,h),p=f?t.node(f).order:l;(f||h===u)&&(gt(a.slice(o,d+1),function(g){gt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&Yj(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return gt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Lb(e,i),r}function z$e(t,e){if(t.node(e).dummy)return $R(t.predecessors(e),function(r){return t.node(r).dummy})}function Yj(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function G$e(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function q$e(t,e,r,n){var i={},a={},s={};return gt(e,function(o){gt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),gt(e,function(o){var l=-1;gt(o,function(u){var h=n(u);if(h.length){h=Ib(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>cPe(t));r(" runLayout",()=>J$e(n,r)),r(" updateInputGraph",()=>ePe(t,n))})}function J$e(t,e){e(" makeSpaceForEdgeLabels",()=>uPe(t)),e(" removeSelfEdges",()=>bPe(t)),e(" acyclic",()=>GOe(t)),e(" nestingGraph.run",()=>g$e(t)),e(" rank",()=>d$e(Ej(t))),e(" injectEdgeLabelProxies",()=>hPe(t)),e(" removeEmptyRanks",()=>HOe(t)),e(" nestingGraph.cleanup",()=>v$e(t)),e(" normalizeRanks",()=>UOe(t)),e(" assignRankMinMax",()=>dPe(t)),e(" removeEdgeLabelProxies",()=>fPe(t)),e(" normalize.run",()=>e$e(t)),e(" parentDummyChains",()=>O$e(t)),e(" addBorderSegments",()=>KOe(t)),e(" order",()=>M$e(t)),e(" insertSelfEdges",()=>xPe(t)),e(" adjustCoordinateSystem",()=>jOe(t)),e(" position",()=>Z$e(t)),e(" positionSelfEdges",()=>TPe(t)),e(" removeBorderNodes",()=>vPe(t)),e(" normalize.undo",()=>r$e(t)),e(" fixupEdgeLabelCoords",()=>mPe(t)),e(" undoCoordinateSystem",()=>ZOe(t)),e(" translateGraph",()=>pPe(t)),e(" assignNodeIntersects",()=>gPe(t)),e(" reversePoints",()=>yPe(t)),e(" acyclic.undo",()=>VOe(t))}function ePe(t,e){gt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),gt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var tPe=["nodesep","edgesep","ranksep","marginx","marginy"],rPe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},nPe=["acyclicer","ranker","rankdir","align"],iPe=["width","height"],aPe={width:0,height:0},sPe=["minlen","weight","width","height","labeloffset"],oPe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},lPe=["labelpos"];function cPe(t){var e=new xs({multigraph:!0,compound:!0}),r=jR(t.graph());return e.setGraph(BR({},rPe,KR(r,tPe),d5(r,nPe))),gt(t.nodes(),function(n){var i=jR(t.node(n));e.setNode(n,KNe(KR(i,iPe),aPe)),e.setParent(n,t.parent(n))}),gt(t.edges(),function(n){var i=jR(t.edge(n));e.setEdge(n,BR({},oPe,KR(i,sPe),d5(i,lPe)))}),e}function uPe(t){var e=t.graph();e.ranksep/=2,gt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function hPe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};C0(t,"edge-proxy",a,"_ep")}})}function dPe(t){var e=0;gt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=Ad(e,n.maxRank))}),t.graph().maxRank=e}function fPe(t){gt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function pPe(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}gt(t.nodes(),function(u){l(t.node(u))}),gt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,gt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),gt(t.edges(),function(u){var h=t.edge(u);gt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function gPe(t){gt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(Sj(n,a)),r.points.push(Sj(i,s))})}function mPe(t){gt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function yPe(t){gt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function vPe(t){gt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(u5(r.borderLeft)),s=t.node(u5(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),gt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function bPe(t){gt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function xPe(t){var e=f5(t);gt(e,function(r){var n=0;gt(r,function(i,a){var s=t.node(i);s.order=a+n,gt(s.selfEdges,function(o){C0(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function TPe(t){gt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function KR(t,e){return h5(d5(t,e),Number)}function jR(t){var e={};return gt(t,function(r,n){e[n.toLowerCase()]=r}),e}function Al(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:wPe(t),edges:CPe(t)};return di(t.graph())||(e.value=rNe(t.graph())),e}function wPe(t){return ki(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return di(r)||(i.value=r),di(n)||(i.parent=n),i})}function CPe(t){return ki(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return di(e.name)||(n.name=e.name),di(r)||(n.value=r),n})}var Pr=new Map,Ld=new Map,Kj=new Map,kPe=T(()=>{Ld.clear(),Kj.clear(),Pr.clear()},"clear"),p5=T((t,e)=>{const r=Ld.get(e)||[];return ae.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),EPe=T((t,e)=>{const r=Ld.get(e)||[];return ae.info("Descendants of ",e," is ",r),ae.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||p5(t.v,e)||p5(t.w,e)||r.includes(t.w):(ae.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),jj=T((t,e,r,n)=>{ae.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ae.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)jj(a,e,r,n);else{const s=e.node(a);ae.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(ae.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ae.debug("Setting parent",a,t),r.setParent(a,t)):(ae.info("In copy ",t,"root",n,"data",e.node(t),n),ae.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);ae.debug("Copying Edges",o),o.forEach(l=>{ae.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ae.info("Edge data",u,n);try{EPe(l,n)?(ae.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ae.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ae.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ae.error(h)}})}ae.debug("Removing node",a),e.removeNode(a)})},"copy"),Zj=T((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Kj.set(i,t),n=[...n,...Zj(i,e)];return n},"extractDescendants"),SPe=T((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),Nb=T((t,e,r)=>{const n=e.children(t);if(ae.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=Nb(a,e,r),o=SPe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),Qj=T(t=>!Pr.has(t)||!Pr.get(t).externalConnections?t:Pr.has(t)?Pr.get(t).id:t,"getAnchorId"),APe=T((t,e)=>{if(!t||e>10){ae.debug("Opting out, no graph ");return}else ae.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(ae.warn("Cluster identified",r," Replacement id in edges: ",Nb(r,t,r)),Ld.set(r,Zj(r,t)),Pr.set(r,{id:Nb(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(ae.debug("Cluster identified",r,Ld),i.forEach(a=>{const s=p5(a.v,r),o=p5(a.w,r);s^o&&(ae.warn("Edge: ",a," leaves cluster ",r),ae.warn("Descendants of XXX ",r,": ",Ld.get(r)),Pr.get(r).externalConnections=!0)})):ae.debug("Not a cluster ",r,Ld)});for(let r of Pr.keys()){const n=Pr.get(r).id,i=t.parent(n);i!==r&&Pr.has(i)&&!Pr.get(i).externalConnections&&(Pr.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(ae.warn("Fix XXX",Pr,"ids:",r.v,r.w,"Translating: ",Pr.get(r.v)," --- ",Pr.get(r.w)),Pr.get(r.v)||Pr.get(r.w)){if(ae.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Qj(r.v),a=Qj(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);Pr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);Pr.get(s).externalConnections=!0,n.toCluster=r.w}ae.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),ae.warn("Adjusted Graph",Al(t)),Jj(t,0),ae.trace(Pr)},"adjustClustersAndEdges"),Jj=T((t,e)=>{var i,a;if(ae.warn("extractor - ",e,Al(t),t.children("D")),e>10){ae.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){ae.debug("Done, no node has children",t.nodes());return}ae.debug("Nodes = ",r,e);for(const s of r)if(ae.debug("Extracting node",s,Pr,Pr.has(s)&&!Pr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!Pr.has(s))ae.debug("Not a cluster",s,e);else if(!Pr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){ae.warn("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=Pr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=Pr.get(s).clusterData.dir,ae.warn("Fixing dir",Pr.get(s).clusterData.dir,l));const u=new xs({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ae.warn("Old graph before copy",Al(t)),jj(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:Pr.get(s).clusterData,label:Pr.get(s).label,graph:u}),ae.warn("New graph after copy node: (",s,")",Al(u)),ae.debug("Old graph after copy",Al(t))}else ae.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Pr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),ae.debug(Pr);r=t.nodes(),ae.warn("New list of nodes",r);for(const s of r){const o=t.node(s);ae.warn(" Now next level",s,o),o!=null&&o.clusterNode&&Jj(o.graph,e+1)}},"extractor"),eZ=T((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=eZ(t,i);r=[...r,...a]}),r},"sorter"),_Pe=T(t=>eZ(t,t.children()),"sortNodesByHierarchy"),tZ=T(async(t,e,r,n,i,a)=>{ae.warn("Graph in recursive render:XAX",Al(e),i);const s=e.graph().rankdir;ae.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?ae.info("Recursive render XXX",e.nodes()):ae.info("No nodes found for",e),e.edges().length>0&&ae.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));ae.trace(`Setting data for parent cluster XXX - Node.id = `,m,` - data=`,v.height,` -Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(ae.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(ae.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){ae.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:x}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:x});const b=await tZ(d,y.graph,r,n,e.node(m),a),w=b.elem;nr(y,w),y.diff=b.diff||0,ae.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),K6e(w,y)}else e.children(m).length>0?(ae.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),ae.trace(Nb(y.id,e)),Pr.set(y.id,{id:Nb(y.id,e),node:y})):(ae.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await cC(d,e.node(m),{config:a,dir:s}))})),await T(async()=>{const m=e.edges().map(async function(y){const v=e.edge(y.v,y.w,y.name);ae.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),ae.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),ae.info("Fix",Pr,"ids:",y.v,y.w,"Translating: ",Pr.get(y.v),Pr.get(y.w)),await iH(h,v)});await Promise.all(m)},"processEdges")(),ae.info("Graph before layout:",JSON.stringify(Al(e))),ae.info("############################################# XXX"),ae.info("### Layout ### XXX"),ae.info("############################################# XXX"),Xj(e),ae.info("Graph after layout:",JSON.stringify(Al(e)));let p=0,{subGraphTitleTotalMargin:g}=K2(a);return await Promise.all(_Pe(e).map(async function(m){var v;const y=e.node(m);if(ae.info("Position XBX => "+m+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y!=null&&y.clusterNode)y.y+=g,ae.info("A tainted cluster node XBX1",m,y.id,y.width,y.height,y.x,y.y,e.parent(m)),Pr.get(y.id).node=y,r7(y);else if(e.children(m).length>0){ae.info("A pure cluster node XBX1",m,y.id,y.x,y.y,y.width,y.height,e.parent(m)),y.height+=g,e.node(y.parentId);const x=(y==null?void 0:y.padding)/2||0,b=((v=y==null?void 0:y.labelBBox)==null?void 0:v.height)||0,w=b-x||0;ae.debug("OffsetY",w,"labelHeight",b,"halfPadding",x),await j_(l,y),Pr.get(y.id).node=y}else{const x=e.node(y.parentId);y.y+=g/2,ae.info("A regular node XBX1 - using the padding",y.id,"parent",y.parentId,y.width,y.height,y.x,y.y,"offsetY",y.offsetY,"parent",x,x==null?void 0:x.offsetY,y),r7(y)}})),e.edges().forEach(function(m){const y=e.edge(m);ae.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(y),y),y.points.forEach(w=>w.y+=g/2);const v=e.node(m.v);var x=e.node(m.w);const b=cH(u,y,Pr,r,v,x,n);aH(y,b)}),e.nodes().forEach(function(m){const y=e.node(m);ae.info(m,y.type,y.diff),y.isGroup&&(p=y.diff)}),ae.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),RPe=T(async(t,e)=>{var a,s,o,l,u,h;const r=new xs({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");dH(n,t.markers,t.type,t.diagramId),j6e(),tAe(),R6e(),kPe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ae.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),x=structuredClone(d);y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyct.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function rZ(t,e,r){return(e=nZ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OPe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function $Pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ei(t,e){return IPe(t)||OPe(t,e)||QR(t,e)||$Pe()}function g5(t){return DPe(t)||NPe(t)||QR(t)||PPe()}function BPe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function nZ(t){var e=BPe(t,"string");return typeof e=="symbol"?e:e+""}function $i(t){"@babel/helpers - typeof";return $i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$i(t)}function QR(t,e){if(t){if(typeof t=="string")return ZR(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ZR(t,e):void 0}}var Pi=typeof window>"u"?null:window,iZ=Pi?Pi.navigator:null;Pi&&Pi.document;var FPe=$i(""),aZ=$i({}),zPe=$i(function(){}),GPe=typeof HTMLElement>"u"?"undefined":$i(HTMLElement),Ob=function(e){return e&&e.instanceString&&Qn(e.instanceString)?e.instanceString():null},hr=function(e){return e!=null&&$i(e)==FPe},Qn=function(e){return e!=null&&$i(e)===zPe},Cn=function(e){return!Us(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},jr=function(e){return e!=null&&$i(e)===aZ&&!Cn(e)&&e.constructor===Object},qPe=function(e){return e!=null&&$i(e)===aZ},Gt=function(e){return e!=null&&$i(e)===$i(1)&&!isNaN(e)},VPe=function(e){return Gt(e)&&Math.floor(e)===e},m5=function(e){if(GPe!=="undefined")return e!=null&&e instanceof HTMLElement},Us=function(e){return $b(e)||sZ(e)},$b=function(e){return Ob(e)==="collection"&&e._private.single},sZ=function(e){return Ob(e)==="collection"&&!e._private.single},JR=function(e){return Ob(e)==="core"},oZ=function(e){return Ob(e)==="stylesheet"},WPe=function(e){return Ob(e)==="event"},Ku=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},UPe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},HPe=function(e){return jr(e)&&Gt(e.x1)&&Gt(e.x2)&&Gt(e.y1)&&Gt(e.y2)},YPe=function(e){return qPe(e)&&Qn(e.then)},XPe=function(){return iZ&&iZ.userAgent.match(/msie|trident|edge/i)},k0=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},tBe=function(e,r){return-1*uZ(e,r)},yr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+ZPe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},iBe=function(e){var r,n=new RegExp("^"+KPe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},aBe=function(e){return sBe[e.toLowerCase()]},hZ=function(e){return(Cn(e)?e:null)||aBe(e)||rBe(e)||iBe(e)||nBe(e)},sBe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},dZ=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||A<0||x&&R>=f}function _(){var F=e();if(C(F))return L(F);g=setTimeout(_,S(F))}function L(F){return g=void 0,b&&h?w(F):(h=d=void 0,p)}function O(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function D(){return g===void 0?p:L(e())}function z(){var F=e(),A=C(F);if(h=arguments,d=this,m=F,A){if(g===void 0)return k(m);if(x)return clearTimeout(g),g=setTimeout(_,l),w(m)}return g===void 0&&(g=setTimeout(_,l)),p}return z.cancel=O,z.flush=D,z}return g8=s,g8}var mBe=gBe(),zb=Pb(mBe),m8=Pi?Pi.performance:null,RZ=m8&&m8.now?function(){return m8.now()}:function(){return Date.now()},yBe=(function(){if(Pi){if(Pi.requestAnimationFrame)return function(t){Pi.requestAnimationFrame(t)};if(Pi.mozRequestAnimationFrame)return function(t){Pi.mozRequestAnimationFrame(t)};if(Pi.webkitRequestAnimationFrame)return function(t){Pi.webkitRequestAnimationFrame(t)};if(Pi.msRequestAnimationFrame)return function(t){Pi.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(RZ())},1e3/60)}})(),x5=function(e){return yBe(e)},Pc=RZ,Id=9261,LZ=65599,E0=5381,IZ=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id,n=r,i;i=e.next(),!i.done;)n=n*LZ+i.value|0;return n},Gb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id;return r*LZ+e|0},qb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E0;return(r<<5)+r+e|0},vBe=function(e,r){return e*2097152+r},Zu=function(e){return e[0]*2097152+e[1]},T5=function(e,r){return[Gb(e[0],r[0]),qb(e[1],r[1])]},DZ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},b8=function(e){e.splice(0,e.length)},_Be=function(e,r){for(var n=0;n"u"?"undefined":$i(Set))!==LBe?Set:IBe,C5=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!JR(e)){Xn("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){Xn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new S0,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Cn(r.classes)?u=r.classes:hr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,w,k){var S;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bO;0<=O?L++:L--)_.push(L);return _}).apply(this).reverse(),C=[],w=0,k=S.length;wD;0<=D?++_:--_)z.push(s(v,b));return z},m=function(v,x,b,w){var k,S,C;for(w==null&&(w=n),k=v[b];b>x;){if(C=b-1>>1,S=v[C],w(k,S)<0){v[b]=S,b=C;continue}break}return v[b]=k},y=function(v,x,b){var w,k,S,C,_;for(b==null&&(b=n),k=v.length,_=x,S=v[x],w=2*x+1;w0;){var S=x.pop(),C=y(S),_=S.id();if(f[_]=C,C!==1/0)for(var L=S.neighborhood().intersect(g),O=0;O0)for(I.unshift(M);d[P];){var B=d[P];I.unshift(B.edge),I.unshift(B.node),$=B.node,P=$.id()}return o.spawn(I)}}}},BBe={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var k=0;k0;){if(k(),C++,w===h){for(var _=[],L=a,O=h,D=v[O];_.unshift(L),D!=null&&_.unshift(D),L=y[O],L!=null;)O=L.id(),D=v[O];return{found:!0,distance:d[w],path:this.spawn(_),steps:C}}p[w]=!0;for(var z=b._private.edges,F=0;FD&&(g[O]=D,x[O]=L,b[O]=k),!a){var z=L*h+_;!a&&g[z]>D&&(g[z]=D,x[z]=_,b[z]=k)}}}for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:s,Fe=b(Ce),ye=[],He=Fe;;){if(He==null)return r.spawn();var xe=x(He),Ve=xe.edge,Je=xe.pred;if(ye.unshift(He[0]),He.same(be)&&ye.length>0)break;Ve!=null&&ye.unshift(Ve),He=Je}return l.spawn(ye)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=HBe(a,e,r),n--}return r},YBe={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(I){return I.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/UBe);if(a<2){Xn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},JBe=function(e){return Math.PI*e/180},S5=function(e,r){return Math.atan2(r,e)-Math.PI/2},C8=Math.log2||function(t){return Math.log(t)/Math.log(2)},k8=function(e){return e>0?1:e<0?-1:0},Md=function(e,r){return Math.sqrt(Nd(e,r))},Nd=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},eFe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},rFe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},nFe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},iFe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},WZ=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},A5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},_5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Ei(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},UZ=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},E8=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Ju=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},HZ=function(e,r){return Ju(e,r.x,r.y)},YZ=function(e,r){return Ju(e,r.x1,r.y1)&&Ju(e,r.x2,r.y2)},aFe=(w8=Math.hypot)!==null&&w8!==void 0?w8:function(t,e){return Math.sqrt(t*t+e*e)};function sFe(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},n=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},i=function(_,L){return{x:_.x*L,y:_.y*L}},a=function(_,L){return _.x*L.y-_.y*L.x},s=function(_){var L=aFe(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,O=0;O<_.length;O++){var D=_[O],z=_[(O+1)%_.length];L+=D.x*z.y-z.x*D.y}return L/2},l=function(_,L,O,D){var z=n(L,_),F=n(D,O),A=a(z,F);if(Math.abs(A)<1e-9)return r(_,i(z,.5));var R=a(n(O,_),F)/A;return r(_,i(z,R))},u=t.map(function(C){return{x:C.x,y:C.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?th(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,x=y;if(g=eh(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,k=b,S=i+d-u+o;if(g=eh(e,r,n,i,b,w,k,S,!1),g.length>0)return g}if(f){var C=n-h+u-o,_=i+d+o,L=n+h-u+o,O=_;if(g=eh(e,r,n,i,C,_,L,O,!1),g.length>0)return g}if(p){var D=n-h-o,z=i-d+u-o,F=D,A=i+d-u+o;if(g=eh(e,r,n,i,D,z,F,A,!1),g.length>0)return g}var R;{var N=n-h+u,M=i-d+u;if(R=Hb(e,r,n,i,N,M,u+o),R.length>0&&R[0]<=N&&R[1]<=M)return[R[0],R[1]]}{var I=n+h-u,$=i-d+u;if(R=Hb(e,r,n,i,I,$,u+o),R.length>0&&R[0]>=I&&R[1]<=$)return[R[0],R[1]]}{var P=n+h-u,B=i+d-u;if(R=Hb(e,r,n,i,P,B,u+o),R.length>0&&R[0]>=P&&R[1]>=B)return[R[0],R[1]]}{var q=n-h+u,V=i+d-u;if(R=Hb(e,r,n,i,q,V,u+o),R.length>0&&R[0]<=q&&R[1]>=V)return[R[0],R[1]]}return[]},lFe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},cFe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},uFe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},hFe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},dFe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];hFe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,x,b,w,k=0;k=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},ws=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Fc=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=L5(h,-u);m=R5(y)}else m=h;return ws(e,r,m)},pFe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,w=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,w];var k=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,w,k,S]}else return[b,w]},S8=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},eh=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,x=m*d-f*g;if(x!==0){var b=y/x,w=v/x,k=.001,S=0-k,C=1+k;return S<=b&&b<=C&&S<=w&&w<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?S8(e,n,o)===o?[o,l]:S8(e,n,a)===a?[a,s]:S8(a,o,n)===n?[n,i]:[]:[]},mFe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=L5(d,-l);p=R5(m)}else p=d}else p=n;for(var y,v,x,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?R=A.edgesTo(F)[0]:R=F.edgesTo(A)[0];var N=i(R);F=F.id(),C[F]>C[D]+N&&(C[F]=C[D]+N,_.nodes.indexOf(F)<0?_.push(F):_.updateItem(F),S[F]=0,k[F]=[]),C[F]==C[D]+N&&(S[F]=S[F]+S[D],k[F].push(D))}else for(var M=0;M0;){for(var B=w.pop(),q=0;q0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},IFe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:NFe,o=i,l,u,h=0;h=2?Xb(e,r,n,0,nQ,OFe):Xb(e,r,n,0,rQ)},squaredEuclidean:function(e,r,n){return Xb(e,r,n,0,nQ)},manhattan:function(e,r,n){return Xb(e,r,n,0,rQ)},max:function(e,r,n){return Xb(e,r,n,-1/0,$Fe)}};I0["squared-euclidean"]=I0.squaredEuclidean,I0.squaredeuclidean=I0.squaredEuclidean;function D5(t,e,r,n,i,a){var s;return Qn(t)?s=t:s=I0[t]||I0.euclidean,e===0&&Qn(t)?s(i,a):s(e,r,n,i,a)}var PFe=ua({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),D8=function(e){return PFe(e)},M5=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return D5(e,i.length,o,l,u,h)},M8=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},zFe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][x.key]&&(l=n[m.key][x.key])):a.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(a);return i},hQ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=hQ(e,r,n),i},dQ=function(e){for(var r=this.cy(),n=this.nodes(),i=QFe(e),a={},s=0;s=D?(z=D,D=A,F=R):A>z&&(z=A);for(var N=0;N0?1:0;C[L%i.minIterations*o+q]=V,B+=V}if(B>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var X=0,W=0;W1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(_){_.isEdge()&&d[b].push(_.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var w=x.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[x.source().id(),x.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,k=[b],S,C,_;d[w].length;)S=d[w].shift(),C=f[S][0],_=f[S][1],w!=_?(d[_]=d[_].filter(function(L){return L!=S}),w=_):!a&&w!=C&&(d[C]=d[C].filter(function(L){return L!=S}),w=C),k.unshift(S),k.unshift(w);return k},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},N5=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var w=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(k.filter(function(S){return S.isLoop()})):y.merge(k)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,x,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),x=y===p?v:y,x!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:x,edge:w})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},sze={hopcroftTarjanBiconnected:N5,htbc:N5,htb:N5,hopcroftTarjanBiconnectedComponents:N5},O5=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},oze={tarjanStronglyConnected:O5,tsc:O5,tscc:O5,tarjanStronglyConnectedComponents:O5},fQ={};[Vb,PBe,BBe,zBe,qBe,WBe,YBe,xFe,R0,L0,I8,MFe,HFe,jFe,nze,aze,sze,oze].forEach(function(t){yr(fQ,t)});/*! +?)[ \r ]*`,OL="[̀-ͯ]",EOe=new RegExp(OL+"+$"),AOe="("+WZ+"+)|"+(kOe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(OL+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(OL+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+SOe)+("|"+COe+")");let qZ=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(AOe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new fo("EOF",new Ws(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Pt("Unexpected character: '"+e[r]+"'",new fo(e[r],new Ws(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new fo(i,new Ws(this,r,this.tokenRegex.lastIndex))}};class _Oe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Pt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var ROe=bZ;Ee("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),Ee("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),Ee("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),Ee("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),Ee("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),Ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Ee("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var VZ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Ee("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Pt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=VZ[e.text],n==null||n>=r)throw new Pt("Invalid base-"+r+" digit "+e.text);for(var i;(i=VZ[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Pt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Pt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Pt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Pt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};Ee("\\newcommand",t=>$L(t,!1,!0,!1)),Ee("\\renewcommand",t=>$L(t,!0,!1,!1)),Ee("\\providecommand",t=>$L(t,!0,!0,!0)),Ee("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),Ee("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),Ee("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),wh[r],ui.math[r],ui.text[r]),""}),Ee("\\bgroup","{"),Ee("\\egroup","}"),Ee("~","\\nobreakspace"),Ee("\\lq","`"),Ee("\\rq","'"),Ee("\\aa","\\r a"),Ee("\\AA","\\r A"),Ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Ee("ℬ","\\mathscr{B}"),Ee("ℰ","\\mathscr{E}"),Ee("ℱ","\\mathscr{F}"),Ee("ℋ","\\mathscr{H}"),Ee("ℐ","\\mathscr{I}"),Ee("ℒ","\\mathscr{L}"),Ee("ℳ","\\mathscr{M}"),Ee("ℛ","\\mathscr{R}"),Ee("ℭ","\\mathfrak{C}"),Ee("ℌ","\\mathfrak{H}"),Ee("ℨ","\\mathfrak{Z}"),Ee("\\Bbbk","\\Bbb{k}"),Ee("\\llap","\\mathllap{\\textrm{#1}}"),Ee("\\rlap","\\mathrlap{\\textrm{#1}}"),Ee("\\clap","\\mathclap{\\textrm{#1}}"),Ee("\\mathstrut","\\vphantom{(}"),Ee("\\underbar","\\underline{\\text{#1}}"),Ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),Ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Ee("\\ne","\\neq"),Ee("≠","\\neq"),Ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Ee("∉","\\notin"),Ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Ee("⟂","\\perp"),Ee("‼","\\mathclose{!\\mkern-0.8mu!}"),Ee("∌","\\notni"),Ee("⌜","\\ulcorner"),Ee("⌝","\\urcorner"),Ee("⌞","\\llcorner"),Ee("⌟","\\lrcorner"),Ee("©","\\copyright"),Ee("®","\\textregistered"),Ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Ee("⋮","\\vdots"),Ee("\\varGamma","\\mathit{\\Gamma}"),Ee("\\varDelta","\\mathit{\\Delta}"),Ee("\\varTheta","\\mathit{\\Theta}"),Ee("\\varLambda","\\mathit{\\Lambda}"),Ee("\\varXi","\\mathit{\\Xi}"),Ee("\\varPi","\\mathit{\\Pi}"),Ee("\\varSigma","\\mathit{\\Sigma}"),Ee("\\varUpsilon","\\mathit{\\Upsilon}"),Ee("\\varPhi","\\mathit{\\Phi}"),Ee("\\varPsi","\\mathit{\\Psi}"),Ee("\\varOmega","\\mathit{\\Omega}"),Ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Ee("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UZ={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},LOe=new Set(["bin","rel"]);Ee("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in UZ?e=UZ[r]:(r.slice(0,4)==="\\not"||r in ui.math&&LOe.has(ui.math[r].group))&&(e="\\dotsb"),e});var PL={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Ee("\\dotso",function(t){var e=t.future().text;return e in PL?"\\ldots\\,":"\\ldots"}),Ee("\\dotsc",function(t){var e=t.future().text;return e in PL&&e!==","?"\\ldots\\,":"\\ldots"}),Ee("\\cdots",function(t){var e=t.future().text;return e in PL?"\\@cdots\\,":"\\@cdots"}),Ee("\\dotsb","\\cdots"),Ee("\\dotsm","\\cdots"),Ee("\\dotsi","\\!\\cdots"),Ee("\\dotsx","\\ldots\\,"),Ee("\\DOTSI","\\relax"),Ee("\\DOTSB","\\relax"),Ee("\\DOTSX","\\relax"),Ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Ee("\\,","\\tmspace+{3mu}{.1667em}"),Ee("\\thinspace","\\,"),Ee("\\>","\\mskip{4mu}"),Ee("\\:","\\tmspace+{4mu}{.2222em}"),Ee("\\medspace","\\:"),Ee("\\;","\\tmspace+{5mu}{.2777em}"),Ee("\\thickspace","\\;"),Ee("\\!","\\tmspace-{3mu}{.1667em}"),Ee("\\negthinspace","\\!"),Ee("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Ee("\\negthickspace","\\tmspace-{5mu}{.277em}"),Ee("\\enspace","\\kern.5em "),Ee("\\enskip","\\hskip.5em\\relax"),Ee("\\quad","\\hskip1em\\relax"),Ee("\\qquad","\\hskip2em\\relax"),Ee("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Ee("\\tag@paren","\\tag@literal{({#1})}"),Ee("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Pt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Ee("\\newline","\\\\\\relax"),Ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var HZ=Gt(Kl["Main-Regular"][84][1]-.7*Kl["Main-Regular"][65][1]);Ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+HZ+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),Ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+HZ+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),Ee("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Ee("\\@hspace","\\hskip #1\\relax"),Ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Ee("\\ordinarycolon",":"),Ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Ee("∷","\\dblcolon"),Ee("∹","\\eqcolon"),Ee("≔","\\coloneqq"),Ee("≕","\\eqqcolon"),Ee("⩴","\\Coloneqq"),Ee("\\ratio","\\vcentcolon"),Ee("\\coloncolon","\\dblcolon"),Ee("\\colonequals","\\coloneqq"),Ee("\\coloncolonequals","\\Coloneqq"),Ee("\\equalscolon","\\eqqcolon"),Ee("\\equalscoloncolon","\\Eqqcolon"),Ee("\\colonminus","\\coloneq"),Ee("\\coloncolonminus","\\Coloneq"),Ee("\\minuscolon","\\eqcolon"),Ee("\\minuscoloncolon","\\Eqcolon"),Ee("\\coloncolonapprox","\\Colonapprox"),Ee("\\coloncolonsim","\\Colonsim"),Ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Ee("\\imath","\\html@mathml{\\@imath}{ı}"),Ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Ee("⟦","\\llbracket"),Ee("⟧","\\rrbracket"),Ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Ee("⦃","\\lBrace"),Ee("⦄","\\rBrace"),Ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Ee("⦵","\\minuso"),Ee("\\darr","\\downarrow"),Ee("\\dArr","\\Downarrow"),Ee("\\Darr","\\Downarrow"),Ee("\\lang","\\langle"),Ee("\\rang","\\rangle"),Ee("\\uarr","\\uparrow"),Ee("\\uArr","\\Uparrow"),Ee("\\Uarr","\\Uparrow"),Ee("\\N","\\mathbb{N}"),Ee("\\R","\\mathbb{R}"),Ee("\\Z","\\mathbb{Z}"),Ee("\\alef","\\aleph"),Ee("\\alefsym","\\aleph"),Ee("\\Alpha","\\mathrm{A}"),Ee("\\Beta","\\mathrm{B}"),Ee("\\bull","\\bullet"),Ee("\\Chi","\\mathrm{X}"),Ee("\\clubs","\\clubsuit"),Ee("\\cnums","\\mathbb{C}"),Ee("\\Complex","\\mathbb{C}"),Ee("\\Dagger","\\ddagger"),Ee("\\diamonds","\\diamondsuit"),Ee("\\empty","\\emptyset"),Ee("\\Epsilon","\\mathrm{E}"),Ee("\\Eta","\\mathrm{H}"),Ee("\\exist","\\exists"),Ee("\\harr","\\leftrightarrow"),Ee("\\hArr","\\Leftrightarrow"),Ee("\\Harr","\\Leftrightarrow"),Ee("\\hearts","\\heartsuit"),Ee("\\image","\\Im"),Ee("\\infin","\\infty"),Ee("\\Iota","\\mathrm{I}"),Ee("\\isin","\\in"),Ee("\\Kappa","\\mathrm{K}"),Ee("\\larr","\\leftarrow"),Ee("\\lArr","\\Leftarrow"),Ee("\\Larr","\\Leftarrow"),Ee("\\lrarr","\\leftrightarrow"),Ee("\\lrArr","\\Leftrightarrow"),Ee("\\Lrarr","\\Leftrightarrow"),Ee("\\Mu","\\mathrm{M}"),Ee("\\natnums","\\mathbb{N}"),Ee("\\Nu","\\mathrm{N}"),Ee("\\Omicron","\\mathrm{O}"),Ee("\\plusmn","\\pm"),Ee("\\rarr","\\rightarrow"),Ee("\\rArr","\\Rightarrow"),Ee("\\Rarr","\\Rightarrow"),Ee("\\real","\\Re"),Ee("\\reals","\\mathbb{R}"),Ee("\\Reals","\\mathbb{R}"),Ee("\\Rho","\\mathrm{P}"),Ee("\\sdot","\\cdot"),Ee("\\sect","\\S"),Ee("\\spades","\\spadesuit"),Ee("\\sub","\\subset"),Ee("\\sube","\\subseteq"),Ee("\\supe","\\supseteq"),Ee("\\Tau","\\mathrm{T}"),Ee("\\thetasym","\\vartheta"),Ee("\\weierp","\\wp"),Ee("\\Zeta","\\mathrm{Z}"),Ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Ee("\\bra","\\mathinner{\\langle{#1}|}"),Ee("\\ket","\\mathinner{|{#1}\\rangle}"),Ee("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Ee("\\Bra","\\left\\langle#1\\right|"),Ee("\\Ket","\\left|#1\\right\\rangle");var YZ=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Ee("\\bra@ket",YZ(!1)),Ee("\\bra@set",YZ(!0)),Ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Ee("\\angln","{\\angl n}"),Ee("\\blue","\\textcolor{##6495ed}{#1}"),Ee("\\orange","\\textcolor{##ffa500}{#1}"),Ee("\\pink","\\textcolor{##ff00af}{#1}"),Ee("\\red","\\textcolor{##df0030}{#1}"),Ee("\\green","\\textcolor{##28ae7b}{#1}"),Ee("\\gray","\\textcolor{gray}{#1}"),Ee("\\purple","\\textcolor{##9d38bd}{#1}"),Ee("\\blueA","\\textcolor{##ccfaff}{#1}"),Ee("\\blueB","\\textcolor{##80f6ff}{#1}"),Ee("\\blueC","\\textcolor{##63d9ea}{#1}"),Ee("\\blueD","\\textcolor{##11accd}{#1}"),Ee("\\blueE","\\textcolor{##0c7f99}{#1}"),Ee("\\tealA","\\textcolor{##94fff5}{#1}"),Ee("\\tealB","\\textcolor{##26edd5}{#1}"),Ee("\\tealC","\\textcolor{##01d1c1}{#1}"),Ee("\\tealD","\\textcolor{##01a995}{#1}"),Ee("\\tealE","\\textcolor{##208170}{#1}"),Ee("\\greenA","\\textcolor{##b6ffb0}{#1}"),Ee("\\greenB","\\textcolor{##8af281}{#1}"),Ee("\\greenC","\\textcolor{##74cf70}{#1}"),Ee("\\greenD","\\textcolor{##1fab54}{#1}"),Ee("\\greenE","\\textcolor{##0d923f}{#1}"),Ee("\\goldA","\\textcolor{##ffd0a9}{#1}"),Ee("\\goldB","\\textcolor{##ffbb71}{#1}"),Ee("\\goldC","\\textcolor{##ff9c39}{#1}"),Ee("\\goldD","\\textcolor{##e07d10}{#1}"),Ee("\\goldE","\\textcolor{##a75a05}{#1}"),Ee("\\redA","\\textcolor{##fca9a9}{#1}"),Ee("\\redB","\\textcolor{##ff8482}{#1}"),Ee("\\redC","\\textcolor{##f9685d}{#1}"),Ee("\\redD","\\textcolor{##e84d39}{#1}"),Ee("\\redE","\\textcolor{##bc2612}{#1}"),Ee("\\maroonA","\\textcolor{##ffbde0}{#1}"),Ee("\\maroonB","\\textcolor{##ff92c6}{#1}"),Ee("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Ee("\\maroonD","\\textcolor{##ca337c}{#1}"),Ee("\\maroonE","\\textcolor{##9e034e}{#1}"),Ee("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Ee("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Ee("\\purpleC","\\textcolor{##aa87ff}{#1}"),Ee("\\purpleD","\\textcolor{##7854ab}{#1}"),Ee("\\purpleE","\\textcolor{##543b78}{#1}"),Ee("\\mintA","\\textcolor{##f5f9e8}{#1}"),Ee("\\mintB","\\textcolor{##edf2df}{#1}"),Ee("\\mintC","\\textcolor{##e0e5cc}{#1}"),Ee("\\grayA","\\textcolor{##f6f7f7}{#1}"),Ee("\\grayB","\\textcolor{##f0f1f2}{#1}"),Ee("\\grayC","\\textcolor{##e3e5e6}{#1}"),Ee("\\grayD","\\textcolor{##d6d8da}{#1}"),Ee("\\grayE","\\textcolor{##babec2}{#1}"),Ee("\\grayF","\\textcolor{##888d93}{#1}"),Ee("\\grayG","\\textcolor{##626569}{#1}"),Ee("\\grayH","\\textcolor{##3b3e40}{#1}"),Ee("\\grayI","\\textcolor{##21242c}{#1}"),Ee("\\kaBlue","\\textcolor{##314453}{#1}"),Ee("\\kaGreen","\\textcolor{##71B307}{#1}");var XZ={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class IOe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new _Oe(ROe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new qZ(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new fo("EOF",n.loc)),this.pushTokens(i),new fo("",Ws.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Pt("Extra }",a)}else if(a.text==="EOF")throw new Pt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Pt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Pt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Pt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Pt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Pt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new fo(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new qZ(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||wh.hasOwnProperty(e)||ui.math.hasOwnProperty(e)||ui.text.hasOwnProperty(e)||XZ.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:wh.hasOwnProperty(e)&&!wh[e].primitive}}var jZ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,YS=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),BL={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},KZ={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let ZZ=class E4e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new IOe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Pt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new fo("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(E4e.endOfExpression.has(i.text)||r&&i.text===r||e&&wh[i.text]&&wh[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(vK(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ws.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=x$e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function eg(t){return function(){return t}}var KS=(function(){try{var t=uf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),S$e=KS?function(t,e){return KS(t,"toString",{configurable:!0,enumerable:!1,value:eg(e),writable:!0})}:lf,gQ=C$e(S$e);function mQ(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var R$e=9007199254740991,L$e=/^(?:0|[1-9]\d*)$/;function ZS(t,e){var r=typeof t;return e=e??R$e,!!e&&(r=="number"||r!="symbol"&&L$e.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=D$e}function Ch(t){return t!=null&&qL(t.length)&&!mx(t)}function vx(t,e,r){if(!po(r))return!1;var n=typeof e;return(n=="number"?Ch(r)&&ZS(e,r.length):n=="string"&&e in r)?tg(r[e],t):!1}function N$e(t){return ek(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&vx(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function qPe(t,e){var r=this.__data__,n=ik(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function uu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&XFe?new Sx:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&vx(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var Pze=Math.max;function Bze(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:e$e(r);return i<0&&(i=Pze(n+i,0)),yQ(t,Sh(e),i)}var c8=$ze(Bze);function mJ(t,e){var r=-1,n=Ch(t)?Array(t.length):[];return uk(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Ui(t,e){var r=Vi(t)?J0:mJ;return r(t,Sh(e))}function Fze(t,e){return t==null?t:i8(t,l8(e),hf)}function zze(t,e){return t&&a8(t,l8(e))}function Gze(t,e){return t>e}var Wze=Object.prototype,qze=Wze.hasOwnProperty;function Vze(t,e){return t!=null&&qze.call(t,e)}function yJ(t,e){return t!=null&&hJ(t,e,Vze)}function Uze(t,e){return J0(e,function(r){return t[r]})}function fu(t){return t==null?[]:Uze(t,go(t))}var Hze="[object Map]",Yze="[object Set]",Xze=Object.prototype,jze=Xze.hasOwnProperty;function vJ(t){if(t==null)return!0;if(Ch(t)&&(Vi(t)||typeof t=="string"||typeof t.splice=="function"||ng(t)||nk(t)||rg(t)))return!t.length;var e=No(t);if(e==Hze||e==Yze)return!t.size;if(tk(t))return!RQ(t).length;for(var r in t)if(jze.call(t,r))return!1;return!0}function Ni(t){return t===void 0}function bJ(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function tGe(t,e,r){e.length?e=J0(e,function(a){return Vi(a)?function(s){return ok(s,a.length===1?a[0]:a)}:a}):e=[lf];var n=-1;e=J0(e,rk(Sh));var i=mJ(t,function(a,s,o){var l=J0(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Qze(i,function(a,s){return eGe(a,s,r)})}function rGe(t,e){return Zze(t,e,function(r,n){return dJ(t,n)})}var fk=iBe(function(t,e){return t==null?{}:rGe(t,e)}),nGe=Math.ceil,iGe=Math.max;function aGe(t,e,r,n){for(var i=-1,a=iGe(nGe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function sGe(t){return function(e,r,n){return n&&typeof n!="number"&&vx(e,r,n)&&(r=n=void 0),e=jS(e),r===void 0?(r=e,e=0):r=jS(r),n=n===void 0?e1&&vx(t,e[0],e[1])?e=[]:r>2&&vx(e[0],e[1],e[2])&&(e=[e[0]]),tGe(t,XL(e),[])}),lGe=1/0,cGe=sg&&1/t8(new sg([,-0]))[1]==lGe?function(t){return new sg(t)}:b$e,uGe=200;function hGe(t,e,r){var n=-1,i=_$e,a=t.length,s=!0,o=[],l=o;if(a>=uGe){var u=cGe(t);if(u)return t8(u);s=!1,i=nJ,l=new Sx}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=pf,this._children[e]={},this._children[pf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Tt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Tt(go(this._in[e]),r),delete this._in[e],delete this._preds[e],Tt(go(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ni(r))r=pf;else{r+="";for(var n=r;!Ni(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==pf)return r}}children(e){if(Ni(e)&&(e=pf),this._isCompound){var r=this._children[e];if(r)return go(r)}else{if(e===pf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return go(r)}successors(e){var r=this._sucs[e];if(r)return go(r)}neighbors(e){var r=this.predecessors(e);if(r)return dGe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Tt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),Tt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&Tt(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return mx(e)||(e=eg(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return fu(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Ex(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Ni(n)||(n=""+n);var o=_x(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Ni(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=yGe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,TJ(this._preds[r],e),TJ(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?p8(this._isDirected,arguments[0]):_x(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?p8(this._isDirected,arguments[0]):_x(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?p8(this._isDirected,arguments[0]):_x(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],wJ(this._preds[r],e),wJ(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=fu(n);return r?du(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=fu(n);return r?du(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ts.prototype._nodeCount=0,ts.prototype._edgeCount=0;function TJ(t,e){t[e]?t[e]++:t[e]=1}function wJ(t,e){--t[e]||delete t[e]}function _x(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+xJ+a+xJ+(Ni(n)?mGe:n)}function yGe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function p8(t,e){return _x(t,e.v,e.w,e.name)}function pu(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:vGe(t),edges:bGe(t)};return Ni(t.graph())||(e.value=FFe(t.graph())),e}function vGe(t){return Ui(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ni(r)||(i.value=r),Ni(n)||(i.parent=n),i})}function bGe(t){return Ui(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ni(e.name)||(n.name=e.name),Ni(r)||(n.value=r),n})}var zr=new Map,kh=new Map,CJ=new Map,SJ=b(()=>{kh.clear(),CJ.clear(),zr.clear()},"clear"),gf=b((t,e)=>{const r=kh.get(e)||[];return he.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),xGe=b((t,e)=>{const r=kh.get(e)||[];return he.info("Descendants of ",e," is ",r),he.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||gf(t.v,e)||gf(t.w,e)||r.includes(t.w):(he.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),g8=b((t,e,r,n)=>{he.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),he.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)g8(a,e,r,n);else{const s=e.node(a);he.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(he.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(he.debug("Setting parent",a,t),r.setParent(a,t)):(he.info("In copy ",t,"root",n,"data",e.node(t),n),he.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);he.debug("Copying Edges",o),o.forEach(l=>{he.info("Edge",l);const u=e.edge(l.v,l.w,l.name);he.info("Edge data",u,n);try{if(xGe(l,n)){const h=kh.get(n)||[],d=h.includes(l.v)||gf(l.v,n)||l.v===n,f=h.includes(l.w)||gf(l.w,n)||l.w===n;if(d&&f)he.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),he.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;he.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else he.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){he.error(h)}})}he.debug("Removing node",a),e.removeNode(a)})},"copy"),kJ=b((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)CJ.set(i,t),n=[...n,...kJ(i,e)];return n},"extractDescendants"),TGe=b((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),lg=b((t,e,r)=>{const n=e.children(t);if(he.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=lg(a,e,r),o=TGe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),EJ=b(t=>!zr.has(t)||!zr.get(t).externalConnections?t:zr.has(t)?zr.get(t).id:t,"getAnchorId"),wGe=b((t,e)=>{var r;if(!t||e>10){he.debug("Opting out, no graph ");return}else he.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(he.warn("Cluster identified",n," Replacement id in edges: ",lg(n,t,n)),kh.set(n,kJ(n,t)),zr.set(n,{id:lg(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(he.debug("Cluster identified",n,kh),a.forEach(s=>{const o=gf(s.v,n),l=gf(s.w,n);o^l&&(he.warn("Edge: ",s," leaves cluster ",n),he.warn("Descendants of XXX ",n,": ",kh.get(n)),zr.get(n).externalConnections=!0)})):he.debug("Not a cluster ",n,kh)});for(let n of zr.keys()){const i=zr.get(n).id,a=t.parent(i);a!==n&&zr.has(a)&&!zr.get(a).externalConnections&&(zr.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=zr.get(n))!=null&&r.externalConnections)&&s&&RJ(t,i,n)){const o=SGe(t,n,t.parent(i));o&&(zr.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(he.warn("Fix XXX",zr,"ids:",n.v,n.w,"Translating: ",zr.get(n.v)," --- ",zr.get(n.w)),zr.get(n.v)||zr.get(n.w)){if(he.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=EJ(n.v),s=EJ(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);zr.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);zr.get(o).externalConnections=!0,i.toCluster=n.w}he.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),he.warn("Adjusted Graph",pu(t)),AJ(t,0),he.trace(zr)},"adjustClustersAndEdges"),AJ=b((t,e)=>{var i,a,s,o;if(he.warn("extractor - ",e,pu(t),t.children("D")),e>10){he.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){he.debug("Done, no node has children",t.nodes());return}he.debug("Nodes = ",r,e);for(const l of r)if(he.debug("Extracting node",l,zr,zr.has(l)&&!zr.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!zr.has(l))he.debug("Not a cluster",l,e);else if((a=(i=zr.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){he.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=zr.get(l).clusterData.dir,h=new ts({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});g8(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:zr.get(l).clusterData,label:zr.get(l).label,graph:h}),he.warn("Subgraph for cluster with explicit dir created:",l,pu(h))}else if(!zr.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){he.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=zr.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=zr.get(l).clusterData.dir,he.warn("Fixing dir",zr.get(l).clusterData.dir,h));const d=new ts({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});g8(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:zr.get(l).clusterData,label:zr.get(l).label,graph:d}),he.debug("Old graph after copy",pu(t))}else he.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!zr.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),he.debug(zr);r=t.nodes(),he.warn("New list of nodes",r);for(const l of r){const u=t.node(l);he.warn(" Now next level",l,u),u!=null&&u.clusterNode&&AJ(u.graph,e+1)}},"extractor"),_J=b((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=_J(t,i);r=[...r,...a]}),r},"sorter"),CGe=b(t=>_J(t,t.children()),"sortNodesByHierarchy"),RJ=b((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=zr.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),SGe=b((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||gf(i,r))continue;const a=lg(i,t,e);if(a&&!RJ(t,a,e))return a}return null},"findSafeAnchorNode");class kGe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return LJ(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&LJ(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,EGe)),n=n._prev;return"["+e.join(", ")+"]"}}function LJ(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function EGe(t,e){if(t!=="_next"&&t!=="_prev")return e}var AGe=eg(1);function _Ge(t,e){if(t.nodeCount()<=1)return[];var r=LGe(t,e||AGe),n=RGe(r.graph,r.buckets,r.zeroIdx);return ag(Ui(n,function(i){return t.outEdges(i.v,i.w)}))}function RGe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)m8(t,e,r,s);for(;s=i.dequeue();)m8(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(m8(t,e,r,s,!0));break}}}return n}function m8(t,e,r,n,i){var a=i?[]:void 0;return Tt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,y8(e,r,l)}),Tt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,y8(e,r,u)}),t.removeNode(n.v),a}function LGe(t,e){var r=new ts,n=0,i=0;Tt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),Tt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=og(i+n+3).map(function(){return new kGe}),s=n+1;return Tt(r.nodes(),function(o){y8(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function y8(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function IGe(t){var e=t.graph().acyclicer==="greedy"?_Ge(t,r(t)):MGe(t);Tt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,f8("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function MGe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,Tt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return Tt(t.nodes(),i),e}function DGe(t){Tt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function cg(t,e,r,n){var i;do i=f8(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function NGe(t){var e=new ts().setGraph(t.graph());return Tt(t.nodes(),function(r){e.setNode(r,t.node(r))}),Tt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function IJ(t){var e=new ts({multigraph:t.isMultigraph()}).setGraph(t.graph());return Tt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Tt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function MJ(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function pk(t){var e=Ui(og(NJ(t)+1),function(){return[]});return Tt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ni(i)||(e[i][n.order]=r)}),e}function OGe(t){var e=kx(Ui(t.nodes(),function(r){return t.node(r).rank}));Tt(t.nodes(),function(r){var n=t.node(r);yJ(n,"rank")&&(n.rank-=e)})}function $Ge(t){var e=kx(Ui(t.nodes(),function(a){return t.node(a).rank})),r=[];Tt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;Tt(r,function(a,s){Ni(a)&&s%i!==0?--n:n&&Tt(a,function(o){t.node(o).rank+=n})})}function DJ(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),cg(t,"border",i,e)}function NJ(t){return ff(Ui(t.nodes(),function(e){var r=t.node(e).rank;if(!Ni(r))return r}))}function PGe(t,e){var r={lhs:[],rhs:[]};return Tt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function BGe(t,e){return e()}function FGe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Tt(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=du(e.edges(),function(h){return l===HJ(t,t.node(h.v),o)&&l!==HJ(t,t.node(h.w),o)});return d8(u,function(h){return Rx(e,h)})}function UJ(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),w8(t),T8(t,e),eWe(t,e)}function eWe(t,e){var r=c8(t.nodes(),function(i){return!e.node(i).parent}),n=QGe(t,r);n=n.slice(1),Tt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function tWe(t,e,r){return t.hasEdge(e,r)}function HJ(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function rWe(t){switch(t.graph().ranker){case"network-simplex":YJ(t);break;case"tight-tree":iWe(t);break;case"longest-path":nWe(t);break;default:YJ(t)}}var nWe=x8;function iWe(t){x8(t),BJ(t)}function YJ(t){mf(t)}function aWe(t){var e=cg(t,"root",{},"_root"),r=sWe(t),n=ff(fu(r))-1,i=2*n+1;t.graph().nestingRoot=e,Tt(t.edges(),function(s){t.edge(s).minlen*=i});var a=oWe(t)+1;Tt(t.children(),function(s){XJ(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function XJ(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=DJ(t,"_bt"),u=DJ(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,Tt(o,function(d){XJ(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function sWe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&Tt(a,function(s){r(s,i+1)}),e[n]=i}return Tt(t.children(),function(n){r(n,1)}),e}function oWe(t){return Ex(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function lWe(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Tt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function cWe(t,e,r){var n={},i;Tt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function uWe(t,e,r){var n=hWe(t),i=new ts({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return Tt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),Tt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Ni(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function hWe(t){for(var e;t.hasNode(e=f8("_root")););return e}function dWe(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function pWe(t){var e={},r=du(t.nodes(),function(o){return!t.children(o).length}),n=ff(Ui(r,function(o){return t.node(o).rank})),i=Ui(og(n+1),function(){return[]});function a(o){if(!yJ(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Tt(t.successors(o),a)}}var s=Ax(r,function(o){return t.node(o).rank});return Tt(s,a),i}function gWe(t,e){return Ui(e,function(r){var n=t.inEdges(r);if(n.length){var i=Ex(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function mWe(t,e){var r={};Tt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ni(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),Tt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Ni(a)&&!Ni(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=du(r,function(i){return!i.indegree});return yWe(n)}function yWe(t){var e=[];function r(a){return function(s){s.merged||(Ni(s.barycenter)||Ni(a.barycenter)||s.barycenter>=a.barycenter)&&vWe(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),Tt(i.in.reverse(),r(i)),Tt(i.out,n(i))}return Ui(du(e,function(a){return!a.merged}),function(a){return fk(a,["vs","i","barycenter","weight"])})}function vWe(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function bWe(t,e){var r=PGe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Ax(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(xWe(!!e)),l=jJ(a,i,l),Tt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=jJ(a,i,l)});var u={vs:ag(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function jJ(t,e,r){for(var n;e.length&&(n=hk(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function xWe(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function KJ(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=du(i,function(g){return g!==s&&g!==o}));var u=gWe(t,i);Tt(u,function(g){if(t.children(g.v).length){var m=KJ(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&wWe(g,m)}});var h=mWe(u,r);TWe(h,l);var d=bWe(h,n);if(s&&(d.vs=ag([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function TWe(t,e){Tt(t,function(r){r.vs=ag(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function wWe(t,e){Ni(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function CWe(t){var e=NJ(t),r=ZJ(t,og(1,e+1),"inEdges"),n=ZJ(t,og(e-1,-1,-1),"outEdges"),i=pWe(t);QJ(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){SWe(o%2?r:n,o%4>=2),i=pk(t);var u=dWe(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function AWe(t){var e={},r=0;function n(i){var a=r;Tt(t.children(i),n),e[i]={low:a,lim:r++}}return Tt(t.children(),n),e}function _We(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=hk(a);return Tt(a,function(h,d){var f=LWe(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Tt(a.slice(o,d+1),function(g){Tt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&JJ(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return Tt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Ex(e,i),r}function LWe(t,e){if(t.node(e).dummy)return c8(t.predecessors(e),function(r){return t.node(r).dummy})}function JJ(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function IWe(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function MWe(t,e,r,n){var i={},a={},s={};return Tt(e,function(o){Tt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),Tt(e,function(o){var l=-1;Tt(o,function(u){var h=n(u);if(h.length){h=Ax(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>JWe(t));r(" runLayout",()=>qWe(n,r)),r(" updateInputGraph",()=>VWe(t,n))})}function qWe(t,e){e(" makeSpaceForEdgeLabels",()=>eqe(t)),e(" removeSelfEdges",()=>cqe(t)),e(" acyclic",()=>IGe(t)),e(" nestingGraph.run",()=>aWe(t)),e(" rank",()=>rWe(IJ(t))),e(" injectEdgeLabelProxies",()=>tqe(t)),e(" removeEmptyRanks",()=>$Ge(t)),e(" nestingGraph.cleanup",()=>lWe(t)),e(" normalizeRanks",()=>OGe(t)),e(" assignRankMinMax",()=>rqe(t)),e(" removeEdgeLabelProxies",()=>nqe(t)),e(" normalize.run",()=>VGe(t)),e(" parentDummyChains",()=>kWe(t)),e(" addBorderSegments",()=>FGe(t)),e(" order",()=>CWe(t)),e(" insertSelfEdges",()=>uqe(t)),e(" adjustCoordinateSystem",()=>zGe(t)),e(" position",()=>GWe(t)),e(" positionSelfEdges",()=>hqe(t)),e(" removeBorderNodes",()=>lqe(t)),e(" normalize.undo",()=>HGe(t)),e(" fixupEdgeLabelCoords",()=>sqe(t)),e(" undoCoordinateSystem",()=>GGe(t)),e(" translateGraph",()=>iqe(t)),e(" assignNodeIntersects",()=>aqe(t)),e(" reversePoints",()=>oqe(t)),e(" acyclic.undo",()=>DGe(t))}function VWe(t,e){Tt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),Tt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var UWe=["nodesep","edgesep","ranksep","marginx","marginy"],HWe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},YWe=["acyclicer","ranker","rankdir","align"],XWe=["width","height"],jWe={width:0,height:0},KWe=["minlen","weight","width","height","labeloffset"],ZWe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},QWe=["labelpos"];function JWe(t){var e=new ts({multigraph:!0,compound:!0}),r=S8(t.graph());return e.setGraph(h8({},HWe,C8(r,UWe),fk(r,YWe))),Tt(t.nodes(),function(n){var i=S8(t.node(n));e.setNode(n,Mze(C8(i,XWe),jWe)),e.setParent(n,t.parent(n))}),Tt(t.edges(),function(n){var i=S8(t.edge(n));e.setEdge(n,h8({},ZWe,C8(i,KWe),fk(i,QWe)))}),e}function eqe(t){var e=t.graph();e.ranksep/=2,Tt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function tqe(t){Tt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};cg(t,"edge-proxy",a,"_ep")}})}function rqe(t){var e=0;Tt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=ff(e,n.maxRank))}),t.graph().maxRank=e}function nqe(t){Tt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function iqe(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}Tt(t.nodes(),function(u){l(t.node(u))}),Tt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,Tt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Tt(t.edges(),function(u){var h=t.edge(u);Tt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function aqe(t){Tt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(MJ(n,a)),r.points.push(MJ(i,s))})}function sqe(t){Tt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function oqe(t){Tt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function lqe(t){Tt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(hk(r.borderLeft)),s=t.node(hk(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),Tt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function cqe(t){Tt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function uqe(t){var e=pk(t);Tt(e,function(r){var n=0;Tt(r,function(i,a){var s=t.node(i);s.order=a+n,Tt(s.selfEdges,function(o){cg(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function hqe(t){Tt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function C8(t,e){return dk(fk(t,e),Number)}function S8(t){var e={};return Tt(t,function(r,n){e[n.toLowerCase()]=r}),e}var tee=b((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),ree=b((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),dqe=b(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),fqe=b((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return ree(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":ree(i)},"getSelfLoopSide"),pqe=b((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=tee(Math.max(n,t.width*.35),36,l),h=tee(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),gqe=b((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),nee=b((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,x)=>T.edge.selfLoop.order-x.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(T=>i.push(T));return}const p={width:u.edge.width,height:u.edge.height},g=fqe(t,f,o,d.start,a),m=pqe(f,g,e,p.width??0),y=gqe(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),iee=b(async(t,e,r,n,i,a)=>{he.warn("Graph in recursive render:XAX",pu(e),i);const s=e.graph().rankdir;he.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?he.info("Recursive render XXX",e.nodes()):he.info("No nodes found for",e),e.edges().length>0&&he.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=dqe(r);await Promise.all(e.nodes().map(async function(T){const x=e.node(T);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));he.trace(`Setting data for parent cluster XXX + Node.id = `,T,` + data=`,w.height,` +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(T)||(he.trace("Setting parent",T,i.id),e.setParent(T,i.id,w))}if(he.info("(Insert) Node XXX"+T+": "+JSON.stringify(e.node(T))),x!=null&&x.clusterNode){he.info("Cluster identified XBX",T,x.width,e.node(T));const{ranksep:w,nodesep:C}=e.graph();x.graph.setGraph({...x.graph.graph(),ranksep:w+25,nodesep:C});const k=await iee(d,x.graph,r,n,e.node(T),a),S=k.elem;dr(x,S),x.diff=k.diff||0,he.info("New compound node after recursive render XAX",T,"width",x.width,"height",x.height),p8e(S,x)}else e.children(T).length>0?(he.trace("Cluster - the non recursive path XBX",T,x.id,x,x.width,"Graph:",e),he.trace(lg(x.id,e)),zr.set(x.id,{id:lg(x.id,e),node:x})):(he.trace("Node - the non recursive path XAX",T,d,e.node(T),s),await Jb(d,e.node(T),{config:a,dir:s}))})),await b(async()=>{const T=e.edges().map(async function(x){const w=e.edge(x.v,x.w,x.name);if(he.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),he.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),he.info("Fix",zr,"ids:",x.v,x.w,"Translating: ",zr.get(x.v),zr.get(x.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const C=w.id;w.id=w.selfLoop.id,await hS(h,w),w.id=C;return}await hS(h,w)});await Promise.all(T)},"processEdges")(),he.info("Graph before layout:",JSON.stringify(pu(e))),he.info("############################################# XXX"),he.info("### Layout ### XXX"),he.info("############################################# XXX"),eee(e),he.info("Graph after layout:",JSON.stringify(pu(e)));let g=0,{subGraphTitleTotalMargin:m}=M0(a);await Promise.all(CGe(e).map(async function(T){var w;const x=e.node(T);if(he.info("Position XBX => "+T+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,he.info("A tainted cluster node XBX1",T,x.id,x.width,x.height,x.x,x.y,e.parent(T)),zr.get(x.id).node=x,uS(x);else if(e.children(T).length>0){he.info("A pure cluster node XBX1",T,x.id,x.x,x.y,x.width,x.height,e.parent(T)),x.height+=m,e.node(x.parentId);const C=(x==null?void 0:x.padding)/2||0,k=((w=x==null?void 0:x.labelBBox)==null?void 0:w.height)||0,S=k-C||0;he.debug("OffsetY",S,"labelHeight",k,"halfPadding",C),await oS(l,x),zr.get(x.id).node=x}else{const C=e.node(x.parentId);x.y+=m/2,he.info("A regular node XBX1 - using the padding",x.id,"parent",x.parentId,x.width,x.height,x.x,x.y,"offsetY",x.offsetY,"parent",C,C==null?void 0:C.offsetY,x),uS(x)}}));const y=m/2;return nee(e,y,{mergeSelfLoops:f}).forEach(function({edge:T,start:x,end:w}){he.info("Edge "+x+" -> "+w+": "+JSON.stringify(T),T),T.points.forEach(E=>E.y+=y);const C=e.node(x),k=e.node(w),S=_7(u,T,zr,r,C,k,n);ej(T,S)}),e.nodes().forEach(function(T){const x=e.node(T);he.info(T,x.type,x.diff),x.isGroup&&(g=x.diff)}),he.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),mqe=b(async(t,e)=>{var a,s,o,l,u,h;const r=new ts({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");L7(n,t.markers,t.type,t.diagramId),jX(),JX(),yY(),SJ(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),he.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d),x=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},T.originalEdge=y,T.selfLoop={id:y.id,order:1},x.originalEdge=y,x.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",T.startLabelRight="",T.startLabelLeft="",T.endLabelLeft="",T.endLabelRight="",T.arrowTypeStart="none",T.arrowTypeEnd="none",T.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,T,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),he.warn("Graph at first:",JSON.stringify(pu(r))),wGe(r),he.warn("Graph after XAX:",JSON.stringify(pu(r)));const i=Ve();await iee(n,r,t.type,t.diagramId,void 0,i)},"render");const yqe=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:nee,render:mqe},Symbol.toStringTag,{value:"Module"}));async function aee(t,e){const r=new ts({multigraph:!0,compound:!0}),n=[...e.edges],i=Ve(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await Jb(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await Promise.resolve().then(()=>bwt);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}b(aee,"createGraphWithElements");var see=5,gk=1e-5,mk=1e-6;function yk(t){const e=[];for(let r=0;r=1-mk||f<=mk||f>=1-mk?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}b(oee,"segmentIntersection");function k8(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}b(k8,"isHorizontalSeg");function lee(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}b(cee,"getArcSweepFlag");var vqe=.001;function uee(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&pa[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&pa[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}b(uee,"applyMarkerOffsets");function hee(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${ug(o)}`];return i==="arc"?u.push(`A${hl(t.r)},${hl(t.r)} 0 0 ${n} ${ug(l)}`):u.push(`M${ug(l)}`),u}b(hee,"emitJump");function E8(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const x=E8(i[u-1],i[u],i[u+1]??i[u],see);x&&(m=x.cutLen)}let y=d,v=null;a&&ux.t-w.t);for(const x of T)x.r=Math.min(x.r,x.d-m,y-x.d);for(let x=0;xw){const C=w/2;T[x].r=Math.min(T[x].r,C),T[x+1].r=Math.min(T[x+1].r,C)}}for(const x of T)x.r=2?n:null}catch{return null}}b(gee,"decodeDataPoints");function mee(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=gee(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=lee(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!pee(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!fee(x))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,T=dee(u,h,r);if(p.setAttribute("d",T),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const x=p.getTotalLength(),w=Math.max(0,x-y-v),C=`0 ${y} ${w} ${v}`,k=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",k)}}}b(mee,"applyLineJumpsToSvg");async function yee(t,e){var i,a;for(const s of t.nodes)s.isGroup?await oS(e.clusters,s):uS(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=_7(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await hS(e.rootGroups,s),s.label&&vee(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));mee(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}b(yee,"adjustLayout");function vee(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=sr(),{subGraphTitleTotalMargin:i}=M0({flowchart:n.flowchart??{}});if(t.label){const a=tx.get(t.id);let s=t.x,o=t.y;if(r){const l=Er.calcLabelPosition(r);he.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=Di.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Di.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Di.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Di.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}b(vee,"positionEdgeLabel");var A8="__swimlane_default__",bqe=21,bee=20;function _8(t){return Math.max(t.padding??bee,bee)}b(_8,"topLaneHorizontalPadding");function xee(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(bqe,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}b(xee,"assignTopLaneTitleRect");function Tee(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===A8);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:A8,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=A8}b(Tee,"prepareLayoutForSwimlanes");function wee(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}b(wee,"toGraphView");function Cee(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*s;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(T=>T.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const T of p){const x=T.x??r.x[T.id],w=T.y??r.y[T.id],C=T.width??0,k=T.height??0;x!=null&&w!=null&&(g=Math.min(g,x-C/2),m=Math.max(m,x+C/2),y=Math.min(y,w-k/2),v=Math.max(v,w+k/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const T=f.padding??20,x=f.parentId?T:2*_8(f),w=T,C=Math.max(0,m-g)+x,k=Math.max(0,v-y)+w,S=(g+m)/2,E=(y+v)/2;f.x=S,f.y=E,f.width=C,f.height=k,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),T=m+2*v,x=(f+p)/2;for(const L of d)L.y=x,L.height=T,L.swimlaneContentTop=f;const w=[...d].sort((L,M)=>{const I=L.x??0,P=M.x??0;return I-P}),C=[],k=[],S=[];for(const L of w){const M=h.get(L.id);if(!M)continue;const I=Math.max(0,M.maxX-M.minX)+2*_8(L),P=(M.minX+M.maxX)/2;C.push(L.id),k.push(P),S.push(I)}const E=C.length;if(E>0){const L=new Map;if(E===1)L.set(C[0],S[0]);else{const M=[];for(let R=0;R0&&i>0?{cx:e,cy:r,rect:dg(e,r,n,i)}:void 0}b(R8,"measuredNodeRect");function L8(t){if(t.isGroup)return;const e=R8(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}b(L8,"nodeBoundsInfoFor");function Oo(t,e,r=ga){return Math.abs(t.x-e.x)r}b(wi,"isHorizontalSegment");function Ci(t,e,r=ga){return tn(t,e,r)&&Math.abs(t.y-e.y)>r}b(Ci,"isVerticalSegment");function ys(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}b(ys,"overlapLength");function rc(t,e,r=ga){return t.horizontal&&e.horizontal&&sn(t.a,e.a,r)?ys(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&tn(t.a,e.a,r)?ys(t.a.y,t.b.y,e.a.y,e.b.y):0}b(rc,"sameAxisSegmentOverlapLength");function hg(t,e=ga){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Oo(i,n,e))&&r.push({x:n.x,y:n.y})}return r}b(pn,"dedupeConsecutivePoints");function I8(t,e=ga){if(!t||t.length!==4)return;const[r,n,i,a]=t;return wi(r,n,e)&&Ci(n,i,e)&&wi(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ci(r,n,e)&&wi(n,i,e)&&Ci(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}b(I8,"classifyThreeSegmentRoute");function vk(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}b(kee,"rectContainsRect");function bk(t,e){return t.lefte.left&&t.tope.top}b(bk,"rectsOverlap");function D8(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}b(D8,"inflateRect");function dg(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}b(dg,"rectFromCenterSize");function qs(t){var e;return(e=R8(t))==null?void 0:e.rect}b(qs,"rectOfNodeBounds");function yf(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}b(yf,"portForRectSide");function N8(t,e,r,n,i,a=ga){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(sn(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(sn(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(tn(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(tn(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}b(N8,"buildOrthogonalPortPath");function O8(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}b(O8,"buildSameSideTrackPath");function xk(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=L8(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}b(xk,"collectRealNodeBounds");function Eh(t){const e=[],r=[];for(const n of t){const i=L8(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}b(Eh,"collectNodeRectEntries");function Eee(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...dg(i,a,s,o)})}return r}b(Eee,"collectLayoutNodeRects");function $8(t,e,r=ga){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fv)return!1;const T=Math.abs(m-h.a.x)i:a&&o&&sn(t,r,i)?ys(t.x,e.x,r.x,n.x)>i:!1}b(Aee,"sameAxisSegmentsOverlap");function Tk(t,e,r,n,{epsilon:i=ga,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+ga&&t=2?e[e.length-2]:void 0,l=(s?tn(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!Oo(i,n))&&r.push(n)}return r}b(wk,"orthogonalizePolyline");function nc(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=Ree(e);if(e=n.points,!n.changed)break}return e}b(nc,"simplifyPolyline");var Rr=.001,Tqe=.5,Lee=4;function F8(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=Iee(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}b(z8,"clipEndpoint");function Mee(t,e){for(const r of t){const n=F8(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=z8(i,n.srcRect,!0)),n.dstRect&&(i=z8(i,n.dstRect,!1)),i=nc(wk(i)),i=U8(i,n.srcRect,n.dstRect),n.edge.points=nc(wk(i))}}b(Mee,"clipEdgeEndpointsToNodeBoundaries");function G8(t,e,r,n=!1){if(sn(t,e,Rr)){if(e.yr.bottom+Rr)return e;if(n){if(t.xr.right+Rr)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(tn(t,e,Rr)){if(e.xr.right+Rr)return e;if(n){if(t.yr.bottom+Rr)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}b(G8,"snapEndpointToBoundary");function Ck(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}b(Dee,"intersectRanges");function q8(t,e){return e==="left"||e==="right"?Sk(t.top,t.bottom):Sk(t.left,t.right)}b(q8,"clearanceRangeForSide");function kk(t,e,r){const n=t.y>=r.top-Rr&&t.y<=r.bottom+Rr,i=t.x>=r.left-Rr&&t.x<=r.right+Rr;if(sn(t,e,Rr)&&n){if(Math.abs(t.x-r.left)0?Dee(a):void 0}b(Nee,"straightClearanceRange");function V8(t,e,r,n,i){const a=Nee(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-Rr&&Math.max(t.x,e.x)<=r.right+Rr,i=Math.min(t.y,e.y)>=r.top-Rr&&Math.max(t.y,e.y)<=r.bottom+Rr;if(Math.abs(t.y-r.top)n.bottom+Rr;case"left":return sn(e,r,Rr)&&r.xn.right+Rr}}b(X8,"leavesOutward");function j8(t,e,r){if(t.length<3)return t;if(r){const a=Y8(t[0],t[1],e);return a&&X8(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=Y8(t[n-1],t[n],e);return i&&X8(i,t[n-1],t[n-2],e)?t.slice(0,n):t}b(j8,"collapseOwnBorderStub");function Pee(t,e,r){let n=t;if(e){const a=Ck(n,0,1);if(a){const s=G8(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=j8(n,e,!0)}if(r){const a=n.length-1,s=Ck(n,a,-1);if(s){const o=G8(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=j8(n,r,!1)}const i=U8(n,e,r);return i!==n||n.length===2?i:(e&&(n=H8(n,e,!0)),r&&(n=H8(n,r,!1)),n)}b(Pee,"snapAndCollapseEndpoints");function K8(t,e){for(const r of t){const n=F8(r,e,2);if(!n)continue;const i=pn(n.points,Rr),a=Pee(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}b(K8,"prepareEdgeEndpointsForRenderer");function Z8(t){return new Map(t.map(e=>[e.id,e]))}b(Z8,"buildNodeMap");function Bee(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}b(Bee,"resolveTopLevelGroupId");function Q8(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}b(Q8,"groupDepth");function J8(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}b(J8,"boundsForChildren");function Fee(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}b(Fee,"applyGroupBounds");function zee(t){const e=Z8(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>Q8(i,e)-Q8(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=J8(i);a&&Fee(n,a)}}b(zee,"recomputeNestedGroupBounds");function Ek(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=b(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}b(Ek,"mirrorAxis");function Gee(t){return(t.nodes??[]).some(r=>!r.isGroup)?Ek(t,"y"):!0}b(Gee,"applyBtDirectionTransform");function Wee(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter($=>!$.isGroup);let a=1/0,s=1/0;for(const $ of i){const _=$.x??0,R=$.y??0;_0?Math.max(1,h/d):1;for(const $ of i){const _=$.x??0,O=(($.y??0)-s)*f+o,D=_-a;$.x=O,$.y=D}for(const $ of n)if($.points)for(const _ of $.points){const R=_.x,D=(_.y-s)*f+o,N=R-a;_.x=D,_.y=N}zee(r);const p=r.filter($=>$.isGroup&&!$.parentId);if(p.length===0)return e==="RL"&&Ek(t,"x"),!0;const g=Z8(r),m=new Map;for(const $ of r){if($.isGroup)continue;const _=Bee($,g);if(!_)continue;const R=m.get(_)??[];R.push($),m.set(_,R)}let y=0;for(const $ of p){const _=$.padding??0;_>y&&(y=_)}const v=[];let T=1/0,x=-1/0;for(const $ of p){const _=m.get($.id)??[],R=J8(_);R&&(T=Math.min(T,R.minX),x=Math.max(x,R.maxX),v.push({lane:$,contentTop:R.minY,contentBottom:R.maxY,centerY:(R.minY+R.maxY)/2}))}if(T===1/0||x===-1/0)return!0;const w=Math.max(0,x-T),C=Math.max(y,10),k=w+2*C,S=o+k,M=(T+x)/2-k/2-o,I=M+S/2,P=Math.max(y,o);v.sort(($,_)=>$.centerY-_.centerY);for(let $=0;$f.cy?v.bottom:v.top,P=f.cx+T;if(P<=v.left+dl||P>=v.right-dl)continue;x={x:P,y:I},w={x:P,y:o.y},C={x:o.x,y:o.y}}else{const I=p.cx>f.cx?v.right:v.left,P=f.cy+T;if(P<=v.top+dl||P>=v.bottom-dl)continue;x={x:I,y:P},w={x:o.x,y:P},C={x:o.x,y:o.y}}const k=Oo(x,w,dl),S=Oo(w,C,dl);if(k&&S||!k&&Oi(x,w,n,[h],1)||!S&&Oi(w,C,n,[d],1))continue;const E=!k&&Tk(x,w,t,i,{epsilon:dl,skipDegenerateOther:!0}),L=!S&&Tk(w,C,t,i,{epsilon:dl,skipDegenerateOther:!0});if(!(E||L)){k?y=[w,C]:S?y=[x,w]:y=[x,w,C];break}}y&&(i.points=y)}}b(qee,"portSwapToLShape");function Vee(t,e){const{realNodeRects:a,labelNodeRects:s}=Eh(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=pn(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,T=f.y-p.y;if(Math.hypot(v,T)<.001)continue;const w=wi(f,d,.001),C=Ci(f,d,.001),k=wi(p,f,.001),S=Ci(p,f,.001);if(!(w&&S||C&&k))continue;const E=o.end,L=o.start,M=E?e.get(E):void 0;if(!M)continue;const I=M.x??0,P=M.y??0,$=qs(M);if(!$)continue;let _,R;if(S){const z=T<0;_={x:I,y:p.y},R={x:I,y:z?$.bottom:$.top}}else{const z=v>0;_={x:p.x,y:P},R={x:z?$.right:$.left,y:P}}if(Oi(_,R,a,E?[E]:[],-2)||Oi(_,R,s,[],-2))continue;if(L){const z=e.get(L),W=z?qs(z):void 0;if(W&&M8(_,W,2))continue}const O=b((z,W)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${W.x.toFixed(3)},${W.y.toFixed(3)}`,"ownSegmentKey"),D=new Set;for(let z=0;z{for(const V of t){if(V===o||V.isLayoutOnly)continue;const H=V.points;if(!(!H||H.length<2))for(let te=0;te=0){const z=u[h-3],W=[L,E].filter(V=>!!V);if(Oi(z,_,a,W,-2)||N(z,_))continue}const F=[...u.slice(0,h-2),_,R];o.points=F;const G=o.labelNodeId;if(G){const z=e.get(G);if(z){const W=z.width??0,V=z.height??0;if(W>0&&V>0){let H,te,Y=-1;for(let se=0;se=W+2||ge&&ee>=V+2)&&ee>Y&&(Y=ee,H=(J.x+Z.x)/2,te=(J.y+Z.y)/2)}H!==void 0&&te!==void 0&&(z.x=H,z.y=te)}}}}}b(Vee,"collapseShortTerminalStub");var or=.001,ma=8,Hr=hg,eI=b((t,e)=>tn(t,e,or)||sn(t,e,or),"orthogonallyAligned");function Uee(t,e){const i=b((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,T=g.y-y;let x=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(T)*x>Math.abs(v)*w?(T<0&&(w=-w),{x:m+(T===0?0:w*v/T),y:y+w}):(v<0&&(x=-x),{x:m+x,y:y+(v===0?0:x*T/v)})},"rectIntersect"),a=b((p,g)=>{const m=pn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,T=v?qs(v):void 0;if(!v||!y||!T)return;const x=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],C=i(v,x);let k=x;if(eI(w,C)&&(k=w),tn(C,k,or))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,k.y),max:Math.max(C.y,k.y),boundary:C,railEnd:k,rect:T};if(sn(C,k,or))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,k.x),max:Math.max(C.x,k.x),boundary:C,railEnd:k,rect:T}},"terminalLaneFor"),s=b((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=b((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&tn(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&sn(p.boundary,g.boundary,1),"sameTerminalFace"),l=b((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=ma&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=b((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=b((p,g)=>{const m=pn(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!b(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?sn(y,p.boundary,or)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?tn(y,p.boundary,or)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const k=m.length>1&&Oo(m[1],p.railEnd,or),S=m.slice(k?2:1),E=S[0];return E&&!eI(E,v)?void 0:[y,v,...S]}const x=m.length>1&&Oo(m[m.length-2],p.railEnd,or),w=m.slice(0,x?-2:-1),C=w[w.length-1];if(!(C&&!eI(C,v)))return[...w,v,y]},"shiftedCandidate"),d=b(p=>{const g=p.edge,m=pn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,T=y?e.get(y):void 0,x=v?e.get(v):void 0;if(!T||!x)return!1;const w=T.x??0,C=T.y??0,k=x.x??0,S=x.y??0,[E,L]=m;return sn(E,L,or)&&Math.abs(C-S)<1&&Math.abs(w-k)>1||tn(E,L,or)&&Math.abs(w-k)<1&&Math.abs(C-S)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(k),L=d(S);return E!==L?Number(E)-Number(L):+!S.atStart-+!k.atStart});for(const k of C){for(const S of f){const E=h(k,S);if(!E)continue;const L=a({...k.edge,points:E},k.atStart);if(!(!L||g.some(M=>M.edge!==k.edge&&(l(L,M)||w&&u(L,M))))){k.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}b(Uee,"separateSharedRenderedTerminalLanes");function Hee(t,e){const{realNodeRects:n,labelNodeRects:i}=Eh(e.values()),a=b((o,l)=>{const u=o.start,h=o.end,d=Hr(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Oi(p.a,p.b,n,f,-2)||Oi(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of Hr(pn(g)))if(rc(m,y,.5)>=ma||gu(m.a,m.b,y.a,y.b,or))return!1}}return!0},"candidateIsSafe"),s=b((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=wi(u,h)&&Ci(h,d)&&wi(d,f)&&Ci(f,p)&&tn(u,f,or)&&tn(u,p,or)&&tn(h,d,or)&&(h.x-u.x)*(f.x-d.x)<0,m=Ci(u,h)&&wi(h,d)&&Ci(d,f)&&wi(f,p)&&sn(u,f,or)&&sn(u,p,or)&&sn(h,d,or)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return pn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ci(u,h)&&wi(h,d)&&Ci(d,f)&&wi(f,p)&&Ci(p,y)&&tn(u,p,or)&&tn(u,y,or)&&tn(d,f,or)&&(d.x-h.x)*(p.x-f.x)<0,T=wi(u,h)&&Ci(h,d)&&wi(d,f)&&Ci(f,p)&&wi(p,y)&&sn(u,p,or)&&sn(u,y,or)&&sn(d,f,or)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!T))return pn([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=pn(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}b(Hee,"collapseRedundantRectangularDoglegs");function tI(t,e){const{realNodeRects:a,labelNodeRects:s}=Eh(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=b((g,m,y)=>pn(g===m?y??[]:g.points??[]),"pointsFor"),u=b((g,m)=>{let y=0;for(let v=0;v{const m=Hr(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=b((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const T=v.rect;return m.horizontal?ys(m.a.x,m.b.x,T.left,T.right)>=ma&&m.a.y>=T.top-2&&m.a.y<=T.bottom+2:ys(m.a.y,m.b.y,T.top,T.bottom)>=ma&&m.a.x>=T.left-2&&m.a.x<=T.right+2})},"blockingRectsFor"),f=b((g,m,y)=>{const v=g.map(x=>({...x}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const T=nc(pn(v));return Hr(T).length===T.length-1?T:void 0},"candidateByMovingRail"),p=b((g,m,y)=>{const v=[g.start,g.end].filter(x=>!!x),T=Hr(m);if(T.length!==m.length-1)return!1;for(const x of T)if(Oi(x.a,x.b,a,v,-2)||Oi(x.a,x.b,s,[],-2))return!1;for(const x of o)if(x!==g){for(const w of T)for(const C of Hr(l(x)))if(rc(w,C,.5)>=ma)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const T=l(v),x=h(T);if(!x)continue;const w=d(v,x.segment);if(w.length===0)continue;const C=x.horizontal?[Math.min(...w.map(k=>k.rect.top))-20,Math.max(...w.map(k=>k.rect.bottom))+20]:[Math.min(...w.map(k=>k.rect.left))-20,Math.max(...w.map(k=>k.rect.right))+20];for(const k of C){const S=f(T,x.segment,k);if(!(!S||!p(v,S,m))){v.points=S,y=!0;break}}if(y)break}if(!y)return}}b(tI,"liftObstacleHuggingSameSideRails");function rI(t,e){const n=b(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=b(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+or||h>=u.bottom-or?!1:ys(l.a.x,l.b.x,u.left,u.right)>=ma},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=pn(l.points??[]);for(const h of Hr(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=or))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}b(rI,"liftTopLaneTitleBandsAboveRails");function nI(t,e){const n=b(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=b(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+or||d>=h.right-or?!1:ys(u.a.y,u.b.y,h.top,h.bottom)>=ma},"verticalSegmentIntersectsTitle"),s=b((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+or||d>=h.bottom-or?!1:ys(u.a.x,u.b.x,h.left,h.right)>=ma},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=pn(u.points??[]);for(const d of Hr(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=or))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}b(nI,"shiftLeftLaneTitleBandsLeftOfRails");function Yee(t,e){const{realNodeRects:n}=Eh(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=b((g,m=new Map)=>pn(m.get(g)??g.points??[]),"replacementPointsFor"),s=b((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+mo(a(y,g)),0),"totalBends"),l=b(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!wi(y,v,or)&&!Ci(y,v,or)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=b((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],T=y[1];let x;if(wi(v,T,or))x={x:T.x,y:m.tailStart.y};else if(Ci(v,T,or))x={x:m.tailStart.x,y:T.y};else return;const w=nc(pn([v,T,x,m.tailStart,m.terminal]));return Hr(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=b((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of Hr(m))if(Oi(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=b((g,m,y)=>{for(const v of i)if(v!==g){for(const T of Hr(m))for(const x of Hr(a(v,y)))if(rc(T,x,.5)>=ma)return!0}return!1},"pathHasSharedTrack"),f=b((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=b(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const T=g.get(y)??[];T.push(m),g.set(y,T)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,T=m,x=y;for(const w of p().values())for(let C=0;C=m||_>T||_===T&&R>=x||(v=$,T=_,x=R)}if(!v)return;for(const[w,C]of v)w.points=C}}b(Yee,"swapDestinationTerminalTailsToReduceCrossings");function Xee(t,e){const{realNodeRects:a,labelNodeRects:s}=Eh(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=b((w,C=new Map)=>pn(C.get(w)??w.points??[]),"replacementPointsFor"),u=b((w=new Map)=>{let C=0;for(let k=0;ko.reduce((C,k)=>C+mo(l(k,w)),0),"totalBends"),d=b(w=>{const C=w.start,k=w.end,S=C?e.get(C):void 0,E=k?e.get(k):void 0,L=S?qs(S):void 0,M=E?qs(E):void 0;return L&&M?{src:L,dst:M}:void 0},"endpointRectsFor"),f=b((w,C,k)=>{if(k.index<=0||k.index+1>=C.length-1)return;const S=d(w);if(S){if(k.vertical){const E=k.a.x,L=Math.min(S.src.left,S.dst.left),M=Math.max(S.src.right,S.dst.right),I=EM+or?"right":void 0;return I?{edge:w,points:C,segmentIndex:k.index,axis:"vertical",side:I,coord:E,min:Math.min(k.a.y,k.b.y),max:Math.max(k.a.y,k.b.y)}:void 0}if(k.horizontal){const E=k.a.y,L=Math.min(S.src.top,S.dst.top),M=Math.max(S.src.bottom,S.dst.bottom),I=EM+or?"bottom":void 0;return I?{edge:w,points:C,segmentIndex:k.index,axis:"horizontal",side:I,coord:E,min:Math.min(k.a.x,k.b.x),max:Math.max(k.a.x,k.b.x)}:void 0}}},"externalRailForSegment"),p=b(()=>{const w=[];for(const C of o){const k=l(C);for(const S of Hr(k)){const E=f(C,k,S);E&&w.push(E)}}return w},"collectExternalRails"),g=b((w,C)=>w.edge!==C.edge&&w.axis===C.axis&&w.side===C.side&&ys(w.min,w.max,C.min,C.max)>=ma,"railsInteract"),m=b(w=>{const C=[],k=new Set;for(const S of w){if(k.has(S))continue;const E=[S],L=[];for(k.add(S);E.length>0;){const M=E.pop();L.push(M);for(const I of w)!k.has(I)&&g(M,I)&&(k.add(I),E.push(I))}L.length>1&&C.push(L)}return C},"connectedComponents"),y=b(w=>{const C=[];for(const k of w)C.some(S=>Math.abs(S-k.coord){const C=w.map(E=>E.coord),k=y(w),S=[];if(w.length<=6){const E=new Array(k.length).fill(!1),L=[],M=b(()=>{if(L.length===w.length){L.some((I,P)=>Math.abs(I-C[P])>=or)&&S.push([...L]);return}for(const[I,P]of k.entries())E[I]||(E[I]=!0,L.push(P),M(),L.pop(),E[I]=!1)},"visit");return M(),S}for(let E=0;E{const k=new Map;for(const[E,L]of w.entries()){const M=C[E],I=k.get(L.edge)??L.points.map(P=>({x:P.x,y:P.y}));L.axis==="vertical"?(I[L.segmentIndex].x=M,I[L.segmentIndex+1].x=M):(I[L.segmentIndex].y=M,I[L.segmentIndex+1].y=M),k.set(L.edge,I)}const S=new Map;for(const[E,L]of k){const M=nc(pn(L));if(Hr(M).length!==M.length-1)return;S.set(E,M)}return S},"replacementsForAssignment"),x=b(w=>{for(const[C,k]of w){const S=[C.start,C.end].filter(E=>!!E);for(const E of Hr(k))if(Oi(E.a,E.b,a,S,-2)||Oi(E.a,E.b,s,[],-2))return!1}for(let C=0;C=ma)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const C=u();if(C===0)return;let k,S=C,E=h(),L=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const I of v(M)){const P=T(M,I);if(!P||!x(P))continue;const $=u(P);if($>=C)continue;const _=h(P),R=M.reduce((O,D,N)=>O+Math.abs(I[N]-D.coord),0);$>S||$===S&&(_>E||_===E&&R>=L)||(k=P,S=$,E=_,L=R)}if(!k)return;for(const[M,I]of k)M.points=I}}b(Xee,"reassignCrossingExternalRailChannels");function jee(t,e){const{realNodeRects:n,labelNodeRects:i}=Eh(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=b((p,g,m)=>pn(p===g?m??[]:p.points??[]),"pointsFor"),o=b(p=>Hr(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=b((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&ys(p.a.x,p.b.x,g.left,g.right)>=ma}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&ys(p.a.y,p.b.y,g.top,g.bottom)>=ma}return!1},"segmentRunsAlongRectBorder"),h=b(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),T=v?qs(v):void 0;T&&m.push(T)}return m},"endpointRectsFor"),d=b((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],T=p[g+3],x=wi(m,y,or)&&Ci(y,v,or)&&wi(v,T,or),w=Ci(m,y,or)&&wi(y,v,or)&&Ci(v,T,or);if(!x&&!w)return[];if(!(x?Math.sign(y.x-m.x)!==Math.sign(T.x-v.x):Math.sign(y.y-m.y)!==Math.sign(T.y-v.y)))return[];const k=tn(m,T,or)||sn(m,T,or)?[]:[{x:m.x,y:T.y},{x:T.x,y:m.y}],S=k.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:k.map(L=>[...p.slice(0,g+1),L,...p.slice(g+3)]),E=new Set;return S.map(L=>nc(pn(L))).filter(L=>{if(Hr(L).length!==L.length-1||!L.some(I=>Oo(I,T,or)))return!1;const M=L.map(I=>`${I.x.toFixed(3)},${I.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=b((p,g,m)=>{const y=[p.start,p.end].filter(T=>!!T),v=h(p);for(const T of Hr(g))if(Oi(T.a,T.b,n,y,-2)||Oi(T.a,T.b,i,[],-2)||v.some(x=>u(T,x)))return!1;for(const T of a)if(T!==p){for(const x of Hr(g))for(const w of Hr(s(T)))if(rc(x,w,.5)>=ma)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,T=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(const w of a){const C=s(w),k=mo(C,or),S=o(C);for(let E=0;E<=C.length-4;E++)for(const L of d(C,E)){const M=mo(L,or),I=o(L);if(!(Mv||$===v&&(M>T||M===T&&I>=x)||(m=w,y=L,v=$,T=M,x=I)}}if(!m||!y)return;m.points=y}}b(jee,"shortcutRedundantOrthogonalJogs");function Kee(t,e){const s=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const de=ue.x??0,Ce=ue.y??0,me=qs(ue);me&&s.push({id:String(ue.id??""),cx:de,cy:Ce,rect:me})}if(s.length===0)return;const o=new Map(s.map(ue=>[ue.id,ue])),l=s.map(ue=>({id:ue.id,rect:ue.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ue=>ue.rect.top))-20,bottom:Math.max(...s.map(ue=>ue.rect.bottom))+20,left:Math.min(...s.map(ue=>ue.rect.left))-20,right:Math.max(...s.map(ue=>ue.rect.right))+20},d=t.filter(ue=>!ue.isLayoutOnly),f=new Map(d.map((ue,de)=>[ue,de])),p=b(ue=>{const de=ue==="left"||ue==="top"?-1:1,Ce=[];for(let me=0;me<=2;me++)Ce.push(h[ue]+de*20*me);return Ce},"outwardTracksForSide"),g=b((ue,de=new Map)=>pn(de.get(ue)??ue.points??[]),"replacementPointsFor"),m=b((ue,de)=>{let Ce=0;for(const me of ue)for(const $e of de)gu(me.a,me.b,$e.a,$e.b,or)&&Ce++;return Ce},"crossingCountBetweenSegments"),y=b((ue,de)=>m(Hr(ue),Hr(de)),"crossingCountBetweenPaths"),v=b((ue=new Map)=>{let de=0;const Ce=[],me=new Set,$e=[],we=b(Le=>{me.has(Le)||(me.add(Le),$e.push(Le))},"addEdge");for(let Le=0;Le0&&(de+=le,Ce.push({first:Ye,second:ke,count:le}),we(Ye),we(ke))}}return $e.sort((Le,Ye)=>(f.get(Le)??0)-(f.get(Ye)??0)),{count:de,pairs:Ce,edgeSet:me,edges:$e}},"crossingSnapshot"),T=b((ue,de)=>{const Ce=new Set(de.keys());if(Ce.size===0)return ue.count;let me=0;for(const we of ue.pairs)(Ce.has(we.first)||Ce.has(we.second))&&(me+=we.count);let $e=0;for(let we=0;we{const de=new Map;for(const $e of ue.pairs){const we=de.get($e.first)??new Set;we.add($e.second),de.set($e.first,we);const Le=de.get($e.second)??new Set;Le.add($e.first),de.set($e.second,Le)}const Ce=[],me=new Set;for(const $e of ue.edges){if(me.has($e))continue;const we=[$e],Le=[];for(me.add($e);we.length>0;){const Ye=we.pop();Le.push(Ye);for(const ce of de.get(Ye)??[])me.has(ce)||(me.add(ce),we.push(ce))}Le.sort((Ye,ce)=>(f.get(Ye)??0)-(f.get(ce)??0)),Le.length>1&&Ce.push(Le)}return Ce},"crossingComponents"),w=b(ue=>[ue.start,ue.end].filter(de=>!!de),"endpointIdsFor"),C=b(ue=>{const de=[];for(const Ce of x(ue)){const me=new Set(Ce),$e=new Set(Ce.flatMap(Le=>w(Le))),we=[...Ce];for(const Le of d)me.has(Le)||w(Le).some(Ye=>$e.has(Ye))&&we.push(Le);we.sort((Le,Ye)=>(f.get(Le)??0)-(f.get(Ye)??0)),de.push(we)}return de},"pairSearchGroups"),k=b((ue,de,Ce)=>T(ue,new Map([[de,Ce]])),"crossingCountWithSingleReplacement"),S=b(ue=>{const de=new Map;for(const Ce of ue.pairs)de.set(Ce.first,(de.get(Ce.first)??0)+Ce.count),de.set(Ce.second,(de.get(Ce.second)??0)+Ce.count);return de},"currentCrossingsByEdge"),E=b(ue=>ue.slice(1).reduce((de,Ce,me)=>{const $e=ue[me];return de+Math.abs(Ce.x-$e.x)+Math.abs(Ce.y-$e.y)},0),"pathLength"),L=b((ue=new Map)=>d.reduce((de,Ce)=>de+mo(g(Ce,ue)),0),"totalBends"),M=b((ue=new Map)=>d.reduce((de,Ce)=>de+E(g(Ce,ue)),0),"totalLength"),I=b((ue,de,Ce=new Map)=>{const me=Hr(de);for(const $e of d)if($e!==ue){for(const we of me)for(const Le of Hr(g($e,Ce)))if(rc(we,Le,.5)>=ma)return!0}return!1},"pathHasSegmentConflict"),P=b((ue,de)=>{const Ce=[ue.start,ue.end].filter(me=>!!me);for(const me of Hr(de))if(Oi(me.a,me.b,l,Ce,-2))return!0;return!1},"pathHitsNode"),$=b((ue,de)=>{const Ce=nc(pn(de));Hr(Ce).length===Ce.length-1&&ue.push(Ce)},"pushOrthogonalCandidate"),_=b(ue=>ue==="left"||ue==="right","sideIsHorizontal"),R=b((ue,de,Ce)=>{switch(de){case"left":return Math.min(ue.x,Ce.x)-20;case"right":return Math.max(ue.x,Ce.x)+20;case"top":return Math.min(ue.y,Ce.y)-20;case"bottom":return Math.max(ue.y,Ce.y)+20}},"localTrackForSameSide"),O=b((ue,de,Ce,me)=>{const $e=Ce==="left"||Ce==="top"?-1:1,we=[R(de,Ce,me),h[Ce]];for(const Le of we)for(let Ye=0;Ye<=2;Ye++)$(ue,O8(de,Ce,me,Le+$e*20*Ye))},"addSameSideCandidates"),D=b((ue,de,Ce,me,$e)=>{for(const we of p(Ce))for(const Le of p($e))$(ue,[de,{x:we,y:de.y},{x:we,y:Le},{x:me.x,y:Le},me])},"addHorizontalToVerticalCandidates"),N=b((ue,de,Ce,me,$e)=>{for(const we of p(Ce))for(const Le of p($e))$(ue,[de,{x:de.x,y:we},{x:Le,y:we},{x:Le,y:me.y},me])},"addVerticalToHorizontalCandidates"),B=b((ue,de,Ce,me,$e)=>{const we=[...p("top"),...p("bottom")];for(const Le of p(Ce))for(const Ye of p($e))for(const ce of we)$(ue,[de,{x:Le,y:de.y},{x:Le,y:ce},{x:Ye,y:ce},{x:Ye,y:me.y},me])},"addHorizontalPairCandidates"),F=b((ue,de,Ce,me,$e)=>{const we=[...p("left"),...p("right")];for(const Le of p(Ce))for(const Ye of p($e))for(const ce of we)$(ue,[de,{x:de.x,y:Le},{x:ce,y:Le},{x:ce,y:Ye},{x:me.x,y:Ye},me])},"addVerticalPairCandidates"),G=b(ue=>{const de=new Set;return ue.map(Ce=>pn(Ce)).filter(Ce=>{const me=Ce.map($e=>`${$e.x.toFixed(3)},${$e.y.toFixed(3)}`).join("|");return de.has(me)||Ce.length<2?!1:(de.add(me),!0)})},"dedupeCandidatePaths"),z=b((ue,de,Ce,me)=>{const $e=[],we=N8(ue,de,Ce,me,20,or);we&&$($e,we),de===me&&O($e,ue,de,Ce);const Le=_(de),Ye=_(me);return Le&&!Ye?D($e,ue,de,Ce,me):!Le&&Ye?N($e,ue,de,Ce,me):Le?B($e,ue,de,Ce,me):F($e,ue,de,Ce,me),G($e)},"buildCandidatesForSides"),W=b((ue,de,Ce,me)=>{const $e=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Le of u){const Ye=yf(me,Le),ce=Le==="top"||Le==="bottom"?p(Le):we;for(const ye of $e){$(ue,[de,Ce,{x:ye,y:Ce.y},{x:ye,y:Ye.y},Ye]);for(const ke of ce)$(ue,[de,Ce,{x:ye,y:Ce.y},{x:ye,y:ke},{x:Ye.x,y:ke},Ye])}}},"addVerticalDepartureOuterTrackCandidates"),V=b((ue,de,Ce,me)=>{const $e=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Le of u){const Ye=yf(me,Le),ce=Le==="left"||Le==="right"?p(Le):$e;for(const ye of we){$(ue,[de,Ce,{x:Ce.x,y:ye},{x:Ye.x,y:ye},Ye]);for(const ke of ce)$(ue,[de,Ce,{x:Ce.x,y:ye},{x:ke,y:ye},{x:ke,y:Ye.y},Ye])}}},"addHorizontalDepartureOuterTrackCandidates"),H=b(ue=>{const de=ue.start,Ce=ue.end,me=Ce?o.get(Ce):void 0;if(!de||!me)return[];const $e=pn(ue.points??[]);if($e.length<4)return[];const we=$e[0],Le=$e[1],Ye=[];return Ci(we,Le,or)?W(Ye,we,Le,me):wi(we,Le,or)&&V(Ye,we,Le,me),Ye},"terminalPreservingOuterTrackCandidates"),te=b(ue=>{const de=ue.start,Ce=ue.end,me=de?o.get(de):void 0,$e=Ce?o.get(Ce):void 0;if(!me||!$e)return[];const we=[];for(const Le of u){const Ye=yf(me,Le);for(const ce of u)we.push(...z(Ye,Le,yf($e,ce),ce))}return we.push(...H(ue)),we},"candidatePathsFor"),Y=b(()=>new Map(d.map(ue=>[ue,Hr(g(ue))])),"currentSegmentsByEdge"),se=b((ue,de,Ce)=>{const me=new Set;for(const $e of d){if($e===ue)continue;const we=Ce.get($e)??Hr(g($e));de.some(Le=>we.some(Ye=>rc(Le,Ye,.5)>=ma))&&me.add($e)}return me},"sharedTrackConflictsFor"),J=b((ue,de,Ce,me)=>{const $e=new Set;return te(ue).map(Le=>nc(pn(Le))).filter(Le=>{if(P(ue,Le))return!1;const Ye=Le.map(ce=>`${ce.x.toFixed(3)},${ce.y.toFixed(3)}`).join("|");return $e.has(Ye)||Le.length<2?!1:($e.add(Ye),!0)}).map(Le=>{const Ye=Hr(Le);let ce=0;for(const ye of d)ye!==ue&&(ce+=m(Ye,Ce.get(ye)??Hr(g(ye))));return{candidate:Le,candidateSegments:Ye,crossings:de.count-(me.get(ue)??0)+ce,bends:mo(Le,or),totalBends:mo(Le),length:E(Le)}}).filter(({crossings:Le})=>Le<=de.count).sort((Le,Ye)=>Le.crossings-Ye.crossings||Le.bends-Ye.bends||Le.length-Ye.length).slice(0,48).map(Le=>({path:Le.candidate,segments:Le.candidateSegments,sharedTrackConflicts:se(ue,Le.candidateSegments,Ce),totalBends:Le.totalBends,length:Le.length}))},"pairCandidatesFor"),Z=b((ue,de,Ce,me,$e,we)=>{let Le=0;for(const ce of ue.pairs)(ce.first===de||ce.second===de||ce.first===me||ce.second===me)&&(Le+=ce.count);let Ye=m(Ce.segments,$e.segments);for(const ce of d){if(ce===de||ce===me)continue;const ye=we.get(ce)??Hr(g(ce));Ye+=m(Ce.segments,ye)+m($e.segments,ye)}return ue.count-Le+Ye},"pairCrossingCount"),ee=b((ue,de)=>{for(const Ce of ue.sharedTrackConflicts)if(Ce!==de)return!1;return!0},"conflictsOnlyWith"),re=b((ue,de)=>ue.segments.some(Ce=>de.segments.some(me=>rc(Ce,me,.5)>=ma)),"candidatesShareTrack"),ge=b((ue,de,Ce,me)=>ee(de,Ce.edge)&&ee(me,ue.edge)&&!re(de,me),"pairCandidatesAreCompatible"),ae=b((ue,de,Ce,me,$e)=>{const we=Z(ue.current,de.edge,Ce,me.edge,$e,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[de.edge,Ce.path],[me.edge,$e.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(de.edge)??0)-(ue.baseBendsByEdge.get(me.edge)??0)+Ce.totalBends+$e.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(de.edge)??0)-(ue.baseLengthByEdge.get(me.edge)??0)+Ce.length+$e.length}},"scorePairReplacement"),_e=b((ue,de)=>ue.crossings{let $e=me;for(const we of de.candidates)for(const Le of Ce.candidates){if(!ge(de,we,Ce,Le))continue;const Ye=ae(ue,de,we,Ce,Le);Ye&&_e(Ye,$e)&&($e=Ye)}return $e},"bestScoreForOptionPair"),qe=b(ue=>{const de=L(),Ce=M(),me=Y(),$e=S(ue),we=new Map(d.map(le=>[le,mo(g(le))])),Le=new Map(d.map(le=>[le,E(g(le))])),Ye=new Map,ce=C(ue);for(const le of ce)for(const pe of le){if(Ye.has(pe))continue;const U=J(pe,ue,me,$e);U.length>0&&Ye.set(pe,{edge:pe,candidates:U})}let ye={replacements:new Map,crossings:ue.count,bends:de,length:Ce};const ke={current:ue,currentBends:de,currentLength:Ce,baseBendsByEdge:we,baseLengthByEdge:Le,baseSegments:me};for(const le of ce){const pe=new Set(le.filter(oe=>ue.edgeSet.has(oe))),U=le.map(oe=>Ye.get(oe)).filter(oe=>!!oe);for(let oe=0;oe0?ye.replacements:void 0},"bestPairedReplacement");for(let ue=0;ue<4;ue++){const de=v(),Ce=de.count;if(Ce===0)return;let me,$e,we=Ce,Le=Number.POSITIVE_INFINITY;for(const ce of de.edges){const ye=mo(g(ce),or);for(const ke of te(ce)){const le=P(ce,ke),pe=!le&&I(ce,ke),U=k(de,ce,ke),oe=mo(ke,or);le||pe||!(Uwe||U===we&&oe>=Le||(me=ce,$e=ke,we=U,Le=oe)}}if(me&&$e){me.points=$e;continue}const Ye=qe(de);if(!Ye)return;for(const[ce,ye]of Ye)ce.points=ye}}b(Kee,"resolveRenderedOrthogonalCrossings");var Ah=.001,Sqe=8;function Zee(t,e){const{nodeInfoById:r,realNodeRects:n}=xk(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=b((m,y,v,T)=>{const x=[],w=N8(m,y,v,T,a,Ah);return w&&x.push(w),y===T&&x.push(O8(m,y,v,s[y])),x},"buildOrthogonalPathCandidates"),l=b((m,y)=>{for(let v=0;v{let T=0;const x=hg(m,Ah),w=y.start,C=y.end;for(const k of t){if(k===y||k.isLayoutOnly)continue;const S=k.start,E=k.end;if(!v&&w&&C&&(S===w||S===C||E===w||E===C))continue;const L=k.points;if(!(!L||L.length<2))for(const M of x)for(const I of hg(L,Ah)){if(P8(M.a,M.b,I.a,I.b,Ah,Ah)){T++;continue}rc(M,I,Ah)>=Sqe&&T++}}return T},"pathConflictCount"),h=4,d=b((m,y)=>{const v=Math.abs(m.y-y.rect.top),T=Math.abs(m.y-y.rect.bottom),x=Math.abs(m.x-y.rect.left),w=Math.abs(m.x-y.rect.right);let C="top",k=v;return T{const T=f.get(m)??[];T.push({side:y,edgeId:v}),f.set(m,T)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",T=m.start,x=m.end;if(T){const w=r.get(T);w&&p(T,d(y[0],w),v)}if(x){const w=r.get(x);w&&p(x,d(y[y.length-1],w),v)}}const g=b((m,y,v)=>{var T;return((T=f.get(m))==null?void 0:T.some(x=>x.edgeId!==v&&x.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=mo(y,Ah);if(v0){const N=u(O,m,!0);if(N>M||N===M&&D>=I)continue;M=N,I=D,L=O;continue}u(O,m)>E||D_.edgeId!==k));const $=f.get(x);$&&f.set(x,$.filter(_=>_.edgeId!==k)),p(T,d(L[0],w),k),p(x,d(L[L.length-1],C),k)}}}b(Zee,"simplifyDetouredEdges");var Vs=.001,Qee=10,_k=7;function iI(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&bk(t,Jee(a)))}b(aI,"labelOverlapsOwnMarker");function Rk(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=D8(m,a);for(const{nodeId:v,rect:T}of n)if(v!==g&&bk(y,T))return!0;return!1},"labelOverlapsForeignNode"),u=b((g,m)=>{const y=D8(m,a);for(const v of r)if(v.edgeId!==g&&vk(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=b((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=b(g=>{for(const{id:m,rect:y}of i)if(kee(y,g))return m},"findContainingLane"),p=b((g,m)=>d.some(y=>y.labelId!==g&&bk(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const T=y.width??0,x=y.height??0;if(T<=0||x<=0)continue;const w=[];for(let G=0;G=Vs&&H>=Vs||w.push({idx:G,length:V+H,orientation:V>=Vs?"horizontal":"vertical",midX:(z.x+W.x)/2,midY:(z.y+W.y)/2})}if(w.length===0)continue;const C=w.length>=3?w.filter(G=>G.idx>0&&G.idx0?C:w,S=T>=x?"horizontal":"vertical",E=b(G=>[...G].sort((z,W)=>{const V=z.orientation===S,H=W.orientation===S;if(V!==H)return V?-1:1;const te=z.length>=(z.orientation==="horizontal"?T:x)+2,Y=W.length>=(W.orientation==="horizontal"?T:x)+2;return te!==Y?te?-1:1:W.length-z.length}),"rankSegments"),L=w[0],M=w[w.length-1],I=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=b((G,z)=>{const W=v[G.idx],V=v[G.idx+1];return{midX:W.x+(V.x-W.x)*z,midY:W.y+(V.y-W.y)*z}},"anchorAtT"),$=b((G,z,W)=>Math.min(W,Math.max(z,G)),"clamp"),_=b((G,z)=>G.midX>=z.left-Vs&&G.midX<=z.right+Vs&&G.midY>=z.top-Vs&&G.midY<=z.bottom+Vs,"pointInsideRectInclusive"),R=b(G=>{const z=dg(G.midX,G.midY,T,x),W=f(z);if(W)return{laneId:W,anchor:G,rect:z};const V=i.find(({rect:ee})=>_(G,ee));if(!V)return;const H=V.rect.left+T/2+s,te=V.rect.right-T/2-s,Y=V.rect.top+x/2+s,se=V.rect.bottom-x/2-s;if(H>te||Y>se)return;const J={midX:$(G.midX,H,te),midY:$(G.midY,Y,se)},Z=dg(J.midX,J.midY,T,x);return _(G,Z)?{laneId:V.id,anchor:J,rect:Z}:void 0},"placementForAnchor"),O=b((G,z,W)=>G.orientation==="horizontal"?Math.abs(z.midX-W.x):Math.abs(z.midY-W.y),"distanceAlongSegment"),D=b((G,z)=>{const V=(G.orientation==="horizontal"?T/2:x/2)+o;if(G===L){const H=v[G.idx];if(O(G,z,H)+Vs{const z=E(G);for(const W of z)for(const V of I){const H=P(W,V);if(!D(W,H))continue;const te=R(H);if(te&&!aI(te.rect,v)&&!p(m,te.rect)&&!h(m,g.id,te.rect))return{laneId:te.laneId,anchor:te.anchor}}},"tryPool"),B=b((G,z,W=!1)=>{const V=E(G);for(const H of V){const te={midX:H.midX,midY:H.midY};if(z&&!D(H,te))continue;const Y=R(te);if(Y&&!aI(Y.rect,v)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(W||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),F=N(k)??(k.lengthW.labelId===m);z>=0?d[z]={labelId:m,rect:G}:d.push({labelId:m,rect:G})}}}b(Rk,"anchorLabelsToPolyline");var sI=1e-6,kqe=8,ete=kqe/2,Eqe=3;function oI(t,e){return t{const h=oI(o,l);let d=0;const f=b(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||oI(g,m)===h&&f(p.labelNodeId)}return d>0?d+Eqe:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!I8(o,sI))continue;const l=$8(s,r,sI);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Oi(m,y,n,[u,h],1))continue;const T=a(s,u,h,p?"x":"y"),x=T>ete?T:ete,w=[0,x,-x];for(const C of w){const k={...m},S={...y};if(p){if(k.x+=C,S.x+=C,k.x<=d.rect.left||k.x>=d.rect.right||S.x<=f.rect.left||S.x>=f.rect.right)continue}else if(k.y+=C,S.y+=C,k.y<=d.rect.top||k.y>=d.rect.bottom||S.y<=f.rect.top||S.y>=f.rect.bottom)continue;if(!Oi(k,S,n,[u,h],1)&&!Tk(k,S,t,s,{epsilon:sI})){s.points=[k,S];break}}}}b(tte,"straightenCollinearSiblingDetours");function lI(t,e){const{realNodeRects:l,labelNodeRects:u}=Eh(e.values()),h=b((C,k)=>hg(k,.001).map(S=>({...S,edge:C,interior:S.index>=1&&S.index<=k.length-3})),"segmentsFor"),d=b(()=>{const C=[];for(const k of t){if(k.isLayoutOnly)continue;const S=k.points;!S||S.length<2||C.push(...h(k,pn(S)))}return C},"allSegments"),f=b((C,k)=>C.horizontal&&k.horizontal?ys(C.a.x,C.b.x,k.a.x,k.b.x)>=8&&Math.abs(C.a.y-k.a.y)<7:C.vertical&&k.vertical?ys(C.a.y,C.b.y,k.a.y,k.b.y)>=8&&Math.abs(C.a.x-k.a.x)<7:!1,"hasCrowdedParallelTrack"),p=b((C,k)=>{const S=C.start,E=C.end,L=h(C,k);if(L.length!==k.length-1)return!1;const M=[S,E].filter(P=>!!P),I=C.labelNodeId?[C.labelNodeId]:[];for(const P of L)if(Oi(P.a,P.b,l,M,-2)||Oi(P.a,P.b,u,I,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const $=P.points;if(!(!$||$.length<2)){for(const _ of L)for(const R of h(P,pn($)))if(f(_,R)||gu(_.a,_.b,R.a,R.b,.001))return!1}}return!0},"candidateIsSafe"),g=b((C,k)=>{const S=pn(C.edge.points??[]);if(S.length<4||C.index>=S.length-1)return;const E=S.map(L=>({...L}));if(C.horizontal)E[C.index].y+=k,E[C.index+1].y+=k;else if(C.vertical)E[C.index].x+=k,E[C.index+1].x+=k;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=b((C,k)=>({x:C.x??(k.left+k.right)/2,y:C.y??(k.top+k.bottom)/2}),"nodeCenter"),y=b(C=>{const k=C.edge,S=pn(k.points??[]);if(S.length!==4||C.index!==1)return;const E=k.start?e.get(k.start):void 0,L=k.end?e.get(k.end):void 0,M=E?qs(E):void 0,I=L?qs(L):void 0,P=S.slice(C.index+2);if(!(!E||!L||!M||!I||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(L,I),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=b((C,k,S,E,L,M)=>{const I=E.y>=S.y,P=I?L.bottom:L.top,$=P+(I?20:-20);if(I&&C.b.y<=$+.001||!I&&C.b.y>=$-.001)return;const _=C.a.x+k;return pn([{x:S.x,y:P},{x:S.x,y:$},{x:_,y:$},{x:_,y:C.b.y},...M],.001)},"verticalSourceDetour"),T=b((C,k,S,E,L,M)=>{const I=E.x>=S.x,P=I?L.right:L.left,$=P+(I?20:-20);if(I&&C.b.x<=$+.001||!I&&C.b.x>=$-.001)return;const _=C.a.y+k;return pn([{x:P,y:S.y},{x:$,y:S.y},{x:$,y:_},{x:C.b.x,y:_},...M],.001)},"horizontalSourceDetour"),x=b((C,k)=>{const S=y(C);if(S){if(C.vertical)return v(C,k,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail);if(C.horizontal)return T(C,k,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const k=d();let S=!1;for(let E=0;E$.interior);for(const $ of P){for(const _ of w){const R=g($,_);if(R&&p($.edge,R)){$.edge.points=R,S=!0;break}const O=x($,_);if(O&&p($.edge,O)){$.edge.points=O,S=!0;break}}if(S)break}}if(!S)return}}b(lI,"nudgeSharedInteriorSubpaths");function rte(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}b(rte,"segmentsIntersect");function nte(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=Eee(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;he.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)he.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}b(nte,"validateSwimlanesLayout");function ite(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!Wee(t,e)||e==="BT"&&i.length>0&&!Gee(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=nc(wk(l)))}Zee(n,r),tte(n,r),qee(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);Rk(n,a),Mee(n,a),Vee(n,a),lI(n,a),Uee(n,a),Hee(n,a),tI(n,a),Yee(n,a);const s=b(()=>{Kee(n,a),Xee(n,a),jee(n,a),Rk(n,a),K8(n,a),tI(n,a),Rk(n,a),K8(n,a)},"finalizeRenderedEdges");s(),lI(n,a),s(),rI(n,a),nI(n,a),rI(n,a),nI(n,a)}b(ite,"postProcessSwimlaneLayout");function _h(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}b(_h,"normalizeGraph");function cI(t,e){return t.edges.filter(r=>r.dst===e)}b(cI,"incoming");function ate(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}b(ate,"buildSuccessorMap");function uI(t){const e=ate(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}b(uI,"buildSortedSuccessorMap");function hI(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}b(hI,"buildInDegreeMap");function dI(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}b(dI,"sortedZeroInDegreeNodes");function Lk(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}b(Lk,"buildPredecessorSuccessorMaps");function fI(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}b(fI,"buildLayersFromRanks");function Ix(t){const e=hI(t),r=dI(e),n=[],i=uI(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=b(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}b(ste,"removeCycles_DFS");function ote(t){const e=new Map,r=b(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}b(ote,"buildTopLaneMap");function mu(t){const e=ote(t);return r=>e.get(r)??null}b(mu,"createTopLaneResolver");function Ik(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}b(Ik,"buildTopLaneOrder");function gI(t,e){const r=Ik(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}b(gI,"resolveTopLaneOrder");var Aqe={EPSILON:1e-6},Mk={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},lte={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function cte(t,e){const r=_h(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=Lk(r);for(const C of a.values())C.sort((k,S)=>k.localeCompare(S));const s=Ix(r)??[...r.nodes].sort((C,k)=>C.localeCompare(k)),o=new Map;for(const[C,k]of s.entries())o.set(k,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of s){const k=(a.get(C)??[]).filter(S=>l.has(S));if(k.length>0){const S=ute(C,k,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,S),u.get(S).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,k)=>{const S=o.get(C)??0,E=o.get(k)??0;return S===E?C.localeCompare(k):S-E}),f=hte(r),p=new Map;for(const[C,k]of f.entries())p.set(C,[...k].sort((S,E)=>S.localeCompare(E)));const g=dte(p),m=fte(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const k of C.nodes){const S=y.get(k);S?S.push(C.id):y.set(k,[C.id])}const v=[],T=[],x=new Set,w=b(C=>{if(!x.has(C)){x.add(C),v.push(C);for(const k of u.get(C)??[])w(k);T.push(C)}},"walk");for(const C of d)w(C);for(const C of s)w(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:T,topologicalOrder:s}}b(cte,"buildDrivingTree");function ute(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,y;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(y=r.rankHint)==null?void 0:y[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}b(ute,"chooseParent");function hte(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}b(hte,"buildAdjacency");function dte(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}b(dte,"assignComponents");function fte(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=b((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(pte(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}b(fte,"computeBlocks");function pte(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}b(pte,"popBlock");function gte(t,e,r){const n=[...t.nodes],i=new Map;for(const[T,x]of n.entries())i.set(x,T);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const T of n){const x=r.parent.get(T)??null,w=i.get(T);w!=null&&x==null&&(s[w]=-1,o[w]=0,u.has(T)||(u.add(T),l.push(T)))}for(;l.length>0;){const T=l.shift(),x=i.get(T);if(x==null)continue;const w=r.children.get(T)??[];for(const C of w){if(u.has(C))continue;const k=i.get(C);k!=null&&(s[k]=x,o[k]=o[x]+1,u.add(C),l.push(C))}}for(const T of n){if(u.has(T))continue;const x=i.get(T);x!=null&&(s[x]=-1,o[x]=0,u.add(T))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let T=0;T{if(T===-1||x===-1)return-1;o[T]>C&1&&(T=d[C][T],T===-1))return-1;if(T===x)return T;for(let C=h-1;C>=0;C--){const k=d[C][T],S=d[C][x];k===-1||S===-1||k!==S&&(T=k,x=S)}return d[0][T]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const T of t.edges){let x=T.src,w=T.dst,C=e[x],k=e[w];if(C==null||k==null||(C>k&&([x,w]=[w,x],[C,k]=[k,C]),C==null||k==null||C===k))continue;const S=i.get(x),E=i.get(w);if(S==null||E==null)continue;const L=f(S,E);if(L===-1)continue;const M=p[L];for(let I=C;I{if(x.size!==0)for(const[w,C]of x)T.set(w,(T.get(w)??0)+C)},"mergeInto"),y=new Set,v=b(T=>{const x=i.get(T);y.add(T);const w=x==null?void 0:p[x],C=w?new Map(w):new Map,k=r.children.get(T)??[];for(const S of k){const E=v(S),L=e[T];if(L!=null){let M=g.get(T);M||(M=new Map,g.set(T,M));let I=E.get(L)??0;const P=e[S];P!=null&&P>L&&(I+=1),M.set(S,I)}m(C,E)}return C},"dfs");for(const T of r.roots)y.has(T)||v(T);for(const T of n)y.has(T)||v(T);return g}b(gte,"computeSubtreeCrossCounts");function mte(t,e,r){const n=new Map,i=b(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(mI(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}b(mte,"annotateMinimumLayers");function mI(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}b(mI,"compareByRankThenId");function yte(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=b(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}b(yte,"emitNodesInTreeOrder");function vte(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}b(vte,"deduplicateLayers");function bte(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}b(bte,"createChildOrderer");function Dk(t,e,r){const n=cte(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=gte(t,e,n),o=[...a].sort(mI(e)),l=mte(o,i,e),u=bte(i,e,s,l);let h=yte(o,t.nodes,e,u);return h=vte(h),h}b(Dk,"buildMultitreeLayerOrder");function xte(t,e,r){const n=new Set(t),i=new Set(e),a=fg(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return pI(s)}b(xte,"countCrossingsBetweenAdjacent");function yI(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=Dk(t,r,i),y=yI(m,t.edges,r);y(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const y=r(m.dst);y==null||y===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}b(wte,"adjustCrossLaneSources");function Cte(t,e){const r=_h(t),n=Ix(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=mu(r);let s=Object.create(null);for(const l of n){const u=cI(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=Tte(r,s)),e!=null&&e.ignoreCrossLaneEdges&&wte(r,s),{layers:Dk(r,s,a),rankOf:s,dummy:new Set}}b(Cte,"assignLayers_LongestPath");function Ste(t,e){const r=_h(t),i={...Cte(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=mu(r),{preds:s,succs:o}=Lk(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),y=a(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=Ix(r)??[...r.nodes],u=[...l].reverse(),h=b((g,m)=>{let y=0;for(const x of s.get(g)??[])y=Math.max(y,(i[x]??0)+1);let v=Number.POSITIVE_INFINITY;const T=o.get(g)??[];return T.length>0&&(v=Math.min(...T.map(x=>(i[x]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=Mk.GRAVITY_ITERATIONS,f=b(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],T=o.get(y)??[];if(v.length===0&&T.length===0)continue;const x=v.length>0?v.reduce((S,E)=>S+(i[E]??0)+1,0)/v.length:i[y]??0,w=T.length>0?T.reduce((S,E)=>S+(i[E]??0)-1,0)/T.length:i[y]??0,C=Math.round((x+w)/2),k=h(y,C);k!==i[y]&&(i[y]=k,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:fI(r,l,i),rankOf:i,dummy:new Set}}b(Ste,"assignLayers_Gravity");function kte(t){const e=hI(t),r=uI(t);let n=dI(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}b(kte,"topoSortByGenerationIfAcyclic");function Ete(t,e){const r=_h(t),n=(e==null?void 0:e.direction)==="LR"?kte(r)??[...r.nodes].sort():Ix(r)??[...r.nodes].sort(),i=mu(r),a=b(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=b((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=cI(r,h);let p=0;if(f.length>0)for(const v of f){const T=v.src,x=s[T]??0;p=Math.max(p,x+l(T,h))}const g=a(h),m=o.get(g)??0,y=Math.max(p,m);s[h]=y,o.set(g,y+1)}return{layers:fI(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}b(Ete,"assignLayers_LaneAwareCompact");function Ate(t,e){const r=_h(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=b(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let T=g+1,x=0;T!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}b(Ate,"makeProperLayering");function vI(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}b(vI,"median");function bI(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}b(bI,"barycenter");function _te(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}b(_te,"neighborPositionsFor");function Rte(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}b(Rte,"currentOrderTieBreak");function xI(t,e,r){const n=new Set(t),i=new Set(e),a=fg(t),s=fg(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return pI(l)}b(xI,"countCrossingsBetweenAdjacent");function Nk(t,e,r){return[...t].sort((n,i)=>{const a=vI(e.get(n)??[]),s=vI(e.get(i)??[]);return a===s?Rte(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}b(Nk,"sortByHeuristic");function TI(t,e,r,n,i,a){const s=fg(t),o=fg(e),l=_te(e,s,r,n);if(!i||!a||a.length===0)return Nk(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=Nk(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=Nk(d,l,o);for(const p of f){const g=bI(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const T=bI(l.get(v)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=b(m=>{let y=xI(t,m,u);return h&&n&&(y+=xI(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=mu(e),s=gI(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=TI(n[l+1],n[l],i,"up",a,s),n[l]=wI(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}b(Lte,"orderLayers");function Ite(t,e,r){const n=(r==null?void 0:r.layerGap)??lte.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??lte.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=b(M=>e.nodeById.get(M),"getNode"),f=b(M=>{var I;return((I=d(M))==null?void 0:I.width)??0},"getWidth"),p=b(M=>{var I;return((I=d(M))==null?void 0:I.height)??0},"getHeight"),g=mu(e),m=gI(e,r==null?void 0:r.laneOrder),y=l.map(M=>M.reduce((I,P)=>Math.max(I,p(P)),0)),v=[];if(o)for(let M=0;M+1Math.max(N,f(B)),0),P=l[M+1].reduce((N,B)=>Math.max(N,f(B)),0),$=y[M],_=y[M+1],R=$/2+_/2,O=(I+P)/2,D=Math.max(0,O-R-n);v.push(D)}const T=new Set;for(const M of l)for(const I of M)T.add(g(I));const x=T.has(null),w=m.filter(M=>T.has(M)),C=[...x?[null]:[],...w],k=Object.create(null);for(const M of w)k[M]=0;x&&(k.null=0);for(const M of l){const I=Object.create(null),P=[];for(const $ of M){const _=g($);_===null?P.push($):(I[_]||(I[_]=[])).push($)}for(const[$,_]of Object.entries(I)){const R=_.reduce((O,D)=>O+f(D),0)+i*Math.max(0,_.length-1);k[$]=Math.max(k[$]??0,R)}if(x&&P.length){const $=P.reduce((_,R)=>_+f(R),0)+i*Math.max(0,P.length-1);k.null=Math.max(k.null??0,$)}}const S=new Map;{const M=C.map($=>($===null?k.null:k[$])??0);let P=-(M.reduce(($,_)=>$+_,0)+a*Math.max(0,C.length-1))/2;for(let $=0;$f(G)),B=N.reduce((G,z)=>G+z,0)+i*(O.length-1);let F=D-B/2;for(const[G,z]of O.entries()){const W=N[G];u[z]=F+W/2,h[z]=E+P/2,F+=W+i}}}const _=v[M]??0;E+=P+n+_}const L=new Map;for(const M of e.edges){const I=M.ref.id;L.has(I)||L.set(I,[]),L.get(I).push(M)}for(const[,M]of L){if(M.length===0)continue;const I=M[0].ref,P=I.start,$=I.end;if(P==null||$==null)continue;const _=Math.round(((u[P]??0)+(u[$]??0))/2),R=new Set;for(const O of M)R.add(O.src),R.add(O.dst);for(const O of R){if(O===P||O===$)continue;const D=e.nodeById.get(O);D!=null&&D.isDummy&&(u[O]=_)}}return{x:u,y:h}}b(Ite,"assignCoordinates");var Mte=8;function Dte(t){let e=2166136261;for(let r=0;r>>0}b(Dte,"hashString");function Nte(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}b(Nte,"mulberry32");function Ote(t,e){const r=[...t],n=Nte(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}b(Ote,"deterministicShuffle");function $te(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}b($te,"sourceDistance");function CI(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}b(CI,"laneArrangementCost");function Pte(t){const e=Ik(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=mu(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}b(Pte,"buildWeightedLaneEdges");function SI(t,e,r){const n=[...t];let i=CI(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return Dte(`${t.join("|")}#${n}#${r}`)}b(Fte,"seedForRestart");function zte(t,e={}){const r=Ik(t);if(r.length<2)return r;const n=Pte(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=SI(r,n,i);const s=Math.max(0,e.restarts??Mte);for(let o=0;oKr&&l*3>=o?s>0?"bottom":"top":o>Kr?a>0?"right":"left":r}b(EI,"chooseOrthogonalSide");function AI(t,e){return Math.abs(t.to-e.from)ce.isGroup&&!ce.parentId);for(const ce of u){const ye={id:ce.id},ke=b(le=>{s.set(le.id,ye),r.filter(pe=>pe.parentId===le.id).forEach(ke)},"assignLane");ke(ce)}const h=r.filter(ce=>!ce.isGroup&&!ce.isEdgeLabel).map(ce=>{const ye=ce.width??10,ke=ce.height??10,le=ce.x??0,pe=ce.y??0,U=_qe;return{nodeId:ce.id,minX:le-ye/2-U,maxX:le+ye/2+U,minY:pe-ke/2-U,maxY:pe+ke/2+U,visualXHalfExtent:l?ke/2+U:ye/2+U}}),d=b((ce,ye,ke,le)=>{let pe=o.find(U=>U.orientation===ce&&Math.abs(U.coord-ye)<1);return pe||(pe={id:`pipe-${ce}-${ye.toFixed(0)}`,orientation:ce,coord:ye,spanMin:ke,spanMax:le,tracks:[]},o.push(pe)),pe.spanMin=Math.min(pe.spanMin,ke),pe.spanMax=Math.max(pe.spanMax,le),pe},"getOrAddPipe"),f=b((ce,ye)=>{const ke=ce.width??10,le=ce.height??10,pe=ce.x??0,U=ce.y??0;switch(ye){case"top":return{x:pe,y:U-le/2};case"bottom":return{x:pe,y:U+le/2};case"left":return{x:pe-ke/2,y:U};case"right":return{x:pe+ke/2,y:U}}},"portForSide"),p=b((ce,ye,ke)=>f(ce,EI(ce,ye,ke?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,T=b((ce,ye,ke)=>{if(g.length===0)return 0;const le=Math.abs(ye.y-ke.y)fe||j.from-Kr<=oe&&j.to+Kr>=oe&&(U+=v)}else if(pe){const oe=ye.x,Q=Math.min(ye.y,ke.y)-Kr,fe=Math.max(ye.y,ke.y)+Kr;if(fe<=Q)return 0;for(const j of g)j.edgeIndex===ce||j.orientation!=="horizontal"||j.pipe.coordfe||j.from-Kr<=oe&&j.to+Kr>=oe&&(U+=v)}return U},"crossingPenalty"),x=i.map((ce,ye)=>{if(!ce.start||!ce.end)return{idx:ye,crossLane:0,dx:0,dy:0};const ke=a.get(ce.start),le=a.get(ce.end),pe=s.get(ce.start),U=s.get(ce.end),oe=pe&&U&&pe.id!==U.id?1:0,Q=ke&&le?Math.abs((le.x??0)-(ke.x??0)):0,fe=ke&&le?Math.abs((le.y??0)-(ke.y??0)):0;return{idx:ye,crossLane:oe,dx:Q,dy:fe}}).sort((ce,ye)=>{if(ce.crossLane!==ye.crossLane)return ye.crossLane-ce.crossLane;const ke=ce.dx+ce.dy,le=ye.dx+ye.dy;return Math.abs(ke-le)>1?ke-le:ce.idx-ye.idx}).map(ce=>ce.idx),w=b((ce,ye,ke,le)=>{const pe=Math.min(ce.x,ye.x),U=Math.max(ce.x,ye.x),oe=Math.min(ce.y,ye.y),Q=Math.max(ce.y,ye.y);return!!h.find(j=>ke&&j.nodeId===ke||le&&j.nodeId===le?!1:Math.abs(ce.x-ye.x)>Kr?j.minYce.y&&j.maxX>pe&&j.minXce.x&&j.maxY>oe&&j.minYEI(ce,ye,"bottom"),"determineSide"),E=new Map;for(const[ce,ye]of i.entries()){if(!ye.start||!ye.end||ye.start===ye.end||ye.points&&ye.points.length>0)continue;const ke=a.get(ye.start),le=a.get(ye.end);if(!ke||!le)continue;const pe=(le.x??0)-(ke.x??0),U=(le.y??0)-(ke.y??0);E.set(ce,{edgeIdx:ce,srcId:ye.start,dstId:ye.end,srcSide:S(ke,{x:le.x??0,y:le.y??0}),dstSide:S(le,{x:ke.x??0,y:ke.y??0}),absDx:Math.abs(pe),absDy:Math.abs(U),dxSign:Math.sign(pe),dySign:Math.sign(U)})}const L=b(ce=>ce.srcSide==="top"||ce.srcSide==="bottom"?ce.absDx===0?1/0:ce.absDy/ce.absDx:ce.absDy===0?1/0:ce.absDx/ce.absDy,"preferenceStrength"),M=b(ce=>ce.srcSide==="top"||ce.srcSide==="bottom"?ce.dxSign>=0?"right":"left":ce.dySign>=0?"bottom":"top","secondarySide"),I=new Map;for(const ce of E.values()){const ye=`${ce.srcId}:${ce.srcSide}`;I.has(ye)||I.set(ye,[]),I.get(ye).push(ce)}const P=new Map,$=b((ce,ye)=>`${ce}:${ye}`,"loadKey");for(const ce of E.values())P.set($(ce.srcId,ce.srcSide),(P.get($(ce.srcId,ce.srcSide))??0)+1),P.set($(ce.dstId,ce.dstSide),(P.get($(ce.dstId,ce.dstSide))??0)+1);for(const ce of I.values())if(!(ce.length<2)){ce.sort((ye,ke)=>{const le=L(ye),pe=L(ke);return Math.abs(le-pe)>1e-9?pe-le:ye.edgeIdx-ke.edgeIdx});for(let ye=1;ye=pe||(P.set($(ke.srcId,ke.srcSide),pe-1),P.set($(ke.srcId,le),U+1),ke.srcSide=le)}}const _=b(ce=>{const ye=ce==null?void 0:ce.shape;return ye==="question"||ye==="diamond"},"isDiamondNode"),R=new Map;for(const ce of E.values())R.has(ce.dstId)||R.set(ce.dstId,new Set),R.get(ce.dstId).add(ce.dstSide);for(const ce of E.values()){if(!_(a.get(ce.srcId)))continue;const ye=R.get(ce.srcId);if(!(ye!=null&&ye.has(ce.srcSide)))continue;const ke=M(ce);if(ye.has(ke)||(P.get($(ce.srcId,ke))??0)>0)continue;const le=P.get($(ce.srcId,ce.srcSide))??0;P.set($(ce.srcId,ce.srcSide),Math.max(0,le-1)),P.set($(ce.srcId,ke),1),ce.srcSide=ke}for(const ce of E.values()){const{edgeIdx:ye,srcId:ke,dstId:le,srcSide:pe,dstSide:U}=ce,oe=a.get(ke),Q=a.get(le),fe=`${ke}:${pe}:src`,j=pe==="top"||pe==="bottom"?Q.x??0:Q.y??0;C.has(fe)||C.set(fe,[]),C.get(fe).push({edgeIdx:ye,oppositeCoord:j});const Be=`${le}:${U}:dst`,Se=U==="top"||U==="bottom"?oe.x??0:oe.y??0;C.has(Be)||C.set(Be,[]),C.get(Be).push({edgeIdx:ye,oppositeCoord:Se})}const O=new Map,D=8;for(const[ce,ye]of C){if(ye.length<2)continue;ye.sort((Ze,Pe)=>Ze.oppositeCoord-Pe.oppositeCoord);const ke=ce.split(":"),le=ke.slice(0,-2).join(":"),pe=ke[ke.length-2],U=ke[ke.length-1],oe=a.get(le);if(!oe)continue;const fe=pe==="left"||pe==="right"?oe.height??10:oe.width??10,j=oe.shape,Se=j==="question"||j==="diamond"?fe*.3:fe,De=Math.min(20,Math.max(D,Se/(ye.length+1))),Ne=-(De*(ye.length-1))/2;for(const[Ze,Pe]of ye.entries()){const nt=Ne+Ze*De,Ie=`${Pe.edgeIdx}:${U}`;O.set(Ie,nt)}}const N=b(ce=>{var ye;return!!((ye=i[ce])!=null&&ye.labelNodeId)},"edgeHasLabelNode"),B=b((ce,ye)=>ce?(C.get(`${ce}:${ye}:src`)??[]).some(({edgeIdx:ke})=>N(ke))||(C.get(`${ce}:${ye}:dst`)??[]).some(({edgeIdx:ke})=>N(ke)):!1,"faceHasLabelNode"),F=b((ce,ye,ke)=>ye==="top"||ye==="bottom"?{x:ce.x+ke,y:ce.y}:{x:ce.x,y:ce.y+ke},"applyPortOffset"),G=b((ce,ye,ke)=>{const le=E.get(ce),pe={x:ke.x??0,y:ke.y??0},U={x:ye.x??0,y:ye.y??0},oe=(le==null?void 0:le.srcSide)??S(ye,pe),Q=(le==null?void 0:le.dstSide)??S(ke,U);let fe=le?f(ye,le.srcSide):p(ye,pe,!0),j=le?f(ke,le.dstSide):p(ke,U,!1);const Be=O.get(`${ce}:src`),Se=O.get(`${ce}:dst`);return Be!==void 0&&(fe=F(fe,oe,Be)),Se!==void 0&&(j=F(j,Q,Se)),{pSrcPort:fe,pDstPort:j,srcSide:oe,dstSide:Q}},"portsForEdge");for(const ce of x){const ye=i[ce];if(m[ce]=[],!ye.start||!ye.end||ye.points&&ye.points.length>0||ye.start===ye.end)continue;const ke=a.get(ye.start),le=a.get(ye.end);if(!ke||!le)continue;const{pSrcPort:pe,pDstPort:U,srcSide:oe,dstSide:Q}=G(ce,ke,le),fe={...pe},j={...U},Be=oe==="top"||oe==="bottom",Se=Q==="top"||Q==="bottom";if(Be){const at=pe.y>(ke.y??0);fe.y=at?pe.y+$o:pe.y-$o}else{const at=pe.x>(ke.x??0);fe.x=at?pe.x+$o:pe.x-$o}if(Se){const at=U.y>(le.y??0);j.y=at?U.y+$o:U.y-$o}else{const at=U.x>(le.x??0);j.x=at?U.x+$o:U.x-$o}const He=b((at,vt)=>{for(const zt of h)if(!vt.includes(zt.nodeId)&&at.x>zt.minX&&at.xzt.minY&&at.y{if(Wr){const Rt=at.y>(vt.y??0);return{x:(zt.x??0)>=at.x?br.maxX+vf:br.minX-vf,y:Rt?br.maxY+pg:br.minY-pg,leavesPositiveSide:Rt}}const xt=at.x>(vt.x??0),ht=(zt.y??0)>=at.y;return{x:xt?br.maxX+vf:br.minX-vf,y:ht?br.maxY+pg:br.minY-pg,leavesPositiveSide:xt}},"obstacleDetour");let We=[];const Ne=[ye.start,ye.end],Ze=He(fe,Ne);if(Ze.inside&&Ze.obstacle){const at=Ze.obstacle;if(Be){const vt=De(pe,ke,le,at,!0);fe.x=vt.x,fe.y=vt.y;const zt=vt.leavesPositiveSide?Math.min(at.minY-2,pe.y+$o):Math.max(at.maxY+2,pe.y-$o);We=[{x:pe.x,y:zt},{x:vt.x,y:zt},{x:vt.x,y:vt.y}]}else{const vt=De(pe,ke,le,at,!1),zt=vt.leavesPositiveSide?Math.min(at.minX-2,pe.x+$o):Math.max(at.maxX+2,pe.x-$o);fe.x=vt.x,fe.y=vt.y,We=[{x:zt,y:pe.y},{x:zt,y:vt.y},{x:vt.x,y:vt.y}]}}let Pe=[];const nt=He(j,Ne);if(nt.inside&&nt.obstacle){const at=nt.obstacle;if(Se){const vt=De(U,le,ke,at,!0);j.x=vt.x,j.y=vt.y,Pe=[{x:vt.x,y:vt.y},{x:U.x,y:vt.y}]}else{const vt=De(U,le,ke,at,!1);j.x=vt.x,j.y=vt.y,Pe=[{x:vt.x,y:vt.y},{x:vt.x,y:U.y}]}}if(We.length===0&&Pe.length===0){const at=vf,vt=Math.abs(fe.x-j.x)1||xt>1,Rt=k.get(ye.start??"")??0,ut=k.get(ye.end??"")??0,Kt=Wr>1&&B(ye.start,oe)||xt>1&&B(ye.end,Q),Me=Wr<=1||Rt<=2,Yr=xt<=1||ut<=2;if((vt||zt)&&!br&&(!ht||ht&&!Kt&&Me&&Yr)&&!w(pe,U,ye.start,ye.end)){ye.points=[{...pe},{...fe},{...j},{...U}],y.add(ce);const nn=zt?"horizontal":"vertical",_i=zt?pe.y:pe.x,ln=zt?Math.min(pe.x,U.x):Math.min(pe.y,U.y),cn=zt?Math.max(pe.x,U.x):Math.max(pe.y,U.y),Xr={id:`fast-path-${nn}-${_i.toFixed(0)}-${ce}`,orientation:nn,coord:_i,spanMin:ln,spanMax:cn,tracks:[]};g.push({edgeIndex:ce,segmentIndex:0,orientation:nn,pipe:Xr,trackIndex:0,from:ln,to:cn});continue}}const Ie=d("vertical",fe.x,fe.y,fe.y);fe.x=Ie.coord;const pt=d("vertical",j.x,j.y,j.y);j.x=pt.coord;let Re=Math.min(fe.x,j.x)-50,kt=Math.max(fe.x,j.x)+50,bt=Math.min(fe.y,j.y)-50,lt=Math.max(fe.y,j.y)+50;for(const at of h){const vt=Math.min(fe.x,j.x),zt=Math.max(fe.x,j.x),br=Math.min(fe.y,j.y),Wr=Math.max(fe.y,j.y);at.minXvt&&at.minYbr&&(Re=Math.min(Re,at.minX-Ok),kt=Math.max(kt,at.maxX+Ok),bt=Math.min(bt,at.minY-Ok),lt=Math.max(lt,at.maxY+Ok))}for(const at of h){if(at.maxXkt||at.maxYlt)continue;const vt=vf;d("horizontal",at.minY-vt,Re,kt),d("horizontal",at.maxY+vt,Re,kt);const zt=pg;d("vertical",at.minX-zt,bt,lt),d("vertical",at.maxX+zt,bt,lt)}d("horizontal",fe.y,Re,kt),d("horizontal",j.y,Re,kt);const Nt=o.filter(at=>at.orientation==="horizontal"&&at.coord>=bt&&at.coord<=lt),Ct=o.filter(at=>at.orientation==="vertical"&&at.coord>=Re&&at.coord<=kt),dt=b((at,vt)=>`${at.toFixed(1)},${vt.toFixed(1)}`,"getKey"),ve=dt(fe.x,fe.y),_t=dt(j.x,j.y),gt=new Map,ft=new Map,Et=new Map,Nr=new Set,Ae=[];gt.set(ve,0),Et.set(ve,"n"),Ae.push({key:ve,f:Math.hypot(j.x-fe.x,j.y-fe.y),pt:fe}),Nr.add(ve);let tt=[];const ct=b((at,vt)=>w(at,vt,ye.start,ye.end),"checkSegmentBlocked"),Mt={x:j.x,y:fe.y},Wt=ct(fe,Mt),gr=ct(Mt,j),lr=Wt||gr,Tr={x:fe.x,y:j.y},fr=ct(fe,Tr),Or=ct(Tr,j);if(lr?fr||Or||(Math.abs(fe.x-j.x)0;){Ae.sort((ut,Kt)=>ut.f-Kt.f);const at=Ae.shift();if(Nr.delete(at.key),at.key===_t){let ut=_t,Kt=j;for(tt=[Kt];ft.has(ut);){const Me=ft.get(ut);tt.unshift(Me),Kt=Me,ut=dt(Me.x,Me.y)}break}const vt=at.pt.x,zt=at.pt.y,br=Ct.sort((ut,Kt)=>ut.coord-Kt.coord),Wr=br.findIndex(ut=>Math.abs(ut.coord-vt)<1),xt=Nt.sort((ut,Kt)=>ut.coord-Kt.coord),ht=xt.findIndex(ut=>Math.abs(ut.coord-zt)<1),Rt=[];Wr>0&&Rt.push({x:br[Wr-1].coord,y:zt}),Wr>=0&&Wr0&&Rt.push({x:vt,y:xt[ht-1].coord}),ht>=0&&hter.nodeId===ye.start||er.nodeId===ye.end?!1:Kt!==Me?er.minYzt&&er.maxX>Kt&&er.minXvt&&er.maxY>Yr&&er.minY10&&io<-5||Ea<-10&&io>5)&&(cn=Math.abs(io)*100),(Xr>10&&Bs<-5||Xr<-10&&Bs>5)&&(cn+=Math.abs(Bs)*50);let Oc=0;const Bt=Et.get(at.key)??"n",Oe=Math.abs(Bs)>Kr?"h":"v";Bt!=="n"&&Bt!==Oe&&(Oc=50);const rt=_i+ln+cn+Oc,St=(gt.get(at.key)??1/0)+rt,Ut=Math.abs(j.x-ut.x)+Math.abs(j.y-ut.y);if(St<(gt.get(nn)??1/0))if(ft.set(nn,at.pt),gt.set(nn,St),Et.set(nn,Oe),!Nr.has(nn))Ae.push({key:nn,f:St+Ut,pt:ut}),Nr.add(nn);else{const er=Ae.findIndex(xr=>xr.key===nn);er!==-1&&(Ae[er].f=St+Ut)}}}if(tt.length===0&&(tt=[fe,{x:fe.x,y:j.y},j]),tt.length>4){const at=tt[0],vt=tt[tt.length-1];let zt=Math.min(at.x,vt.x),br=Math.max(at.x,vt.x),Wr=Math.min(at.y,vt.y),xt=Math.max(at.y,vt.y);for(const Yr of tt)zt=Math.min(zt,Yr.x),br=Math.max(br,Yr.x),Wr=Math.min(Wr,Yr.y),xt=Math.max(xt,Yr.y);const ht=br>Math.max(at.x,vt.x),Rt=ztln.minXze&&ln.minYFr);if(_i.length>0){let ln=Math.max(at.x,vt.x);for(const cn of _i){const Xr=(cn.minX+cn.maxX)/2;if(cn.visualXHalfExtent===void 0||isNaN(cn.visualXHalfExtent))continue;const Ea=Xr+cn.visualXHalfExtent+Yr;ln=Math.max(ln,Ea)}isNaN(ln)||(br=ln)}}if(Rt){const ze=h.filter(Fr=>Fr.minXMath.min(at.y,vt.y));if(ze.length>0){let Fr=Math.min(at.x,vt.x);for(const nn of ze){const ln=(nn.minX+nn.maxX)/2-nn.visualXHalfExtent-Yr;Fr=Math.min(Fr,ln)}zt=Fr}}}const ut=b(Yr=>{const ze=vt.y>at.y,Fr=h.filter(ln=>{const cn=Math.min(at.x,vt.x)ln.minX,Xr=Math.min(at.y,vt.y)ln.minY;return cn&&Xr});let nn=Fr;if(l&&Fr.length>0){const ln=Fr.filter(cn=>cn.minXYr);ln.length>0&&(nn=ln)}if(nn.length===0)return vt.y;const _i=vf;if(ze){const cn=Math.max(...nn.map(Xr=>Xr.maxY))+_i;if(cnXr.minY))-_i;if(cn>vt.y+Kr)return cn}return vt.y},"findBestReturnY"),Kt=b(Yr=>{const ze=ut(Yr),Fr={x:Yr,y:at.y},nn={x:Yr,y:ze},_i={x:vt.x,y:ze},ln=ct(at,Fr),cn=ct(Fr,nn),Xr=ct(nn,_i),Ea=ze!==vt.y?ct(_i,vt):!1;return!ln&&!cn&&!Xr&&!Ea?Math.abs(ze-vt.y)=3){const at=cr[cr.length-1],vt=cr[cr.length-2],zt=cr[cr.length-3],br=Math.abs(zt.y-vt.y)Math.abs(at.x-zt.x)&&cr.splice(-2,1)}else if(Wr){const xt=Math.sign(vt.y-zt.y),ht=Math.sign(at.y-zt.y);xt!==0&&xt===ht&&Math.abs(vt.y-zt.y)>Math.abs(at.y-zt.y)&&cr.splice(-2,1)}}const Vr=[cr[0]];for(let at=1;atvt.x,xt=br.x>zt.x;if(Wr!==xt){Vr.push(zt);continue}continue}if(Math.abs(vt.x-zt.x)vt.y,xt=br.y>zt.y;if(Wr!==xt){Vr.push(zt);continue}continue}Vr.push(zt)}Vr.push(cr[cr.length-1]);for(let at=0;atce.from{const pe=!le.segments.some(oe=>(oe.edgeIndex!==ye.edgeIndex||oe.segmentIndex!==ye.segmentIndex)&&z(oe,ce)),U=!ke.segments.some(oe=>(oe.edgeIndex!==ce.edgeIndex||oe.segmentIndex!==ce.segmentIndex)&&z(oe,ye));return pe&&U?(ce.trackIndex=le.index,ye.trackIndex=ke.index,ke.segments=[...ke.segments.filter(oe=>oe.edgeIndex!==ce.edgeIndex||oe.segmentIndex!==ce.segmentIndex),{edgeIndex:ye.edgeIndex,segmentIndex:ye.segmentIndex,from:ye.from,to:ye.to}],le.segments=[...le.segments.filter(oe=>oe.edgeIndex!==ye.edgeIndex||oe.segmentIndex!==ye.segmentIndex),{edgeIndex:ce.edgeIndex,segmentIndex:ce.segmentIndex,from:ce.from,to:ce.to}],!0):!1},"trySwapSegmentsAcrossTracks"),V=b(ce=>{const ye=ce.tracks.length;return ce.tracks[ye]={index:ye,coord:ce.coord,segments:[]},ye},"createNewTrack"),H=b((ce,ye)=>{const ke=ce.pipe.tracks[ce.trackIndex];ke.segments=ke.segments.filter(pe=>pe.edgeIndex!==ce.edgeIndex||pe.segmentIndex!==ce.segmentIndex),ce.trackIndex=ye,ce.pipe.tracks[ye].segments.push({edgeIndex:ce.edgeIndex,segmentIndex:ce.segmentIndex,from:ce.from,to:ce.to})},"moveSegmentToTrack"),te=b((ce,ye)=>{const ke=m[ce.edgeIndex];for(const le of ke){const pe=g[le];pe.pipe===ce.pipe&&H(pe,ye)}},"moveSegmentChainToTrack"),Y=b(ce=>{const ye=m[ce.edgeIndex],ke=ye.indexOf(g.indexOf(ce)),le=[];return ke>0&&le.push(g[ye[ke-1]]),ke{if(ce.orientation===ye.orientation)return!1;const ke=ce.orientation==="horizontal"?ce:ye,le=ce.orientation==="horizontal"?ye:ce;return le.pipe.coord>ke.from&&le.pipe.coordle.from&&ke.pipe.coord{for(const ke of ce.tracks)if(!ke.segments.some(pe=>(pe.edgeIndex!==ye.edgeIndex||pe.segmentIndex!==ye.segmentIndex)&&z(pe,ye)))return ke.index;return-1},"findAvailableTrack"),Z=b((ce,ye)=>{if(ce.trackIndex===ye.trackIndex)return z(ce,ye);const ke=Y(ce),le=Y(ye);return ke.some(pe=>le.some(U=>se(pe,U)))},"segmentsConflict"),ee=b((ce,ye,ke)=>{if(W(ce,ye,ce.pipe.tracks[ce.trackIndex],ye.pipe.tracks[ye.trackIndex]))return;const le=J(ce.pipe,ye);ke(ye,le!==-1?le:V(ce.pipe))},"resolveTrackConflict"),re=b(ce=>{let ye=0;for(let ke=0;ke{if(ge.has(ce))return ge.get(ce);const ye=m[ce];if(ye.length===0){const Q={dest:0,deviation:0,base:0,delta:0};return ge.set(ce,Q),Q}const le=g[ye[0]].pipe.coord;let pe=le;for(let Q=1;QMath.abs(Be-le)?j:Be;break}}const U=Math.abs(pe-le),oe={dest:pe,deviation:U,base:le,delta:pe-le};return ge.set(ce,oe),oe},"getDestInfo"),_e=b(()=>{let ce=0;const ye=new Map;for(const[le,pe]of i.entries())m[le].length!==0&&pe.start&&(ye.has(pe.start)||ye.set(pe.start,[]),ye.get(pe.start).push(le));const ke=b(le=>{const pe=i[le];if(!pe.start||!pe.end)return 0;const U=a.get(pe.start),oe=a.get(pe.end);if(!U||!oe)return 0;const Q=(oe.x??0)-(U.x??0),fe=(oe.y??0)-(U.y??0);return Math.abs(Q)+Math.abs(fe)},"getEdgeDistance");for(const le of ye.values()){le.sort((U,oe)=>{const Q=ae(U),fe=ae(oe);if(Math.abs(Q.deviation-fe.deviation)>1)return Q.deviation-fe.deviation;if(Math.abs(Q.dest-fe.dest)>1)return Q.dest-fe.dest;const j=ke(U),Be=ke(oe);if(Math.abs(j-Be)>1)return Be-j;const Se=m[U].length,He=m[oe].length;if(Se!==He)return Se-He;if(Se===1){const De=m[U][0],We=m[oe][0];if(g[De]&&g[We]){const Ne=g[De],Ze=g[We],Pe=Math.abs(Ne.to-Ne.from),nt=Math.abs(Ze.to-Ze.from);if(Math.abs(Pe-nt)>1)return Pe-nt}}return 0});const pe=le.map(U=>g[m[U][0]]);ce+=re(pe)}return ce},"fixSourceHandleCrossings"),Fe=b(()=>{let ce=0;const ye=new Map;for(const[ke,le]of i.entries())m[ke].length!==0&&le.end&&(ye.has(le.end)||ye.set(le.end,[]),ye.get(le.end).push(ke));for(const ke of ye.values()){ke.sort((pe,U)=>{const oe=b(j=>{const Be=m[j];if(Be.length<2)return 0;const Se=g[Be[Be.length-2]];return Math.abs(Se.to-Se.from)},"getDist"),Q=oe(pe),fe=oe(U);return Math.abs(Q-fe)>.1?Q-fe:pe-U});const le=ke.map(pe=>g[m[pe][m[pe].length-1]]);ce+=re(le)}return ce},"fixTargetHandleCrossings"),qe=b(()=>{let ce=0;for(const ye of o){const ke=[];for(const le of ye.tracks)for(const pe of le.segments){const U=m[pe.edgeIndex].find(oe=>g[oe].segmentIndex===pe.segmentIndex);U!==void 0&&ke.push(g[U])}ke.sort((le,pe)=>le.edgeIndex-pe.edgeIndex||le.segmentIndex-pe.segmentIndex);for(let le=0;le{le.segments.forEach(pe=>{ye.push({edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,trackIndex:le.index,from:pe.from,to:pe.to})})}),ye.sort((le,pe)=>le.from-pe.from);const ke=[];if(ye.length>0){let le=[ye[0]],pe=ye[0].to;for(let U=1;Upe.add(De.trackIndex));const U=new Map;le.forEach(De=>{const We=ae(De.edgeIndex);U.set(De.trackIndex,(U.get(De.trackIndex)??0)+We.delta)});const oe=[...pe].filter(De=>(U.get(De)??0)<-1),Q=[...pe].filter(De=>(U.get(De)??0)>1),fe=[...pe].filter(De=>Math.abs(U.get(De)??0)<=1);oe.sort((De,We)=>(U.get(We)??0)-(U.get(De)??0)),Q.sort((De,We)=>(U.get(De)??0)-(U.get(We)??0));const j=b((De,We)=>{le.filter(Ne=>Ne.trackIndex===De).forEach(Ne=>{const Ze=y.has(Ne.edgeIndex)?ce.coord:We;Ce.set(`${Ne.edgeIndex}-${Ne.segmentIndex}`,Ze)})},"assignCoord");let Be=0;for(const De of oe)Be++,j(De,ce.coord-Be*kI);if(fe.length===0&&pe.size>0){const De=[...pe].sort((Ze,Pe)=>Math.abs(U.get(Ze)??0)-Math.abs(U.get(Pe)??0))[0],We=oe.indexOf(De);We!==-1&&oe.splice(We,1);const Ne=Q.indexOf(De);Ne!==-1&&Q.splice(Ne,1),fe.push(De)}let Se=0;for(const De of fe){if(Se===0)j(De,ce.coord);else{const We=Se%2===1?1:-1,Ne=Math.ceil(Se/2);j(De,ce.coord+We*Ne*kI*.5)}Se++}let He=0;for(const De of Q)He++,j(De,ce.coord+He*kI)}}for(const[ce,ye]of i.entries()){const ke=m[ce]??[];if(ke.length===0)continue;const le=[],pe=a.get(ye.start),U=a.get(ye.end),{pSrcPort:oe,pDstPort:Q}=G(ce,pe,U),fe=ke.map(Se=>{const He=g[Se],De=Ce.get(`${He.edgeIndex}-${He.segmentIndex}`)??He.pipe.coord;return{orient:He.orientation,coord:De,from:He.from,to:He.to}});le.push(oe);for(let Se=0;SeKr&&le.push(bf(He,We)),Pe&&Ze.orient===He.orient)if(Math.abs(He.coord-Ze.coord)>Kr){const nt=He.orient==="vertical"?(We+Ze.from)/2:AI(He,Ze);le.push(bf(He,nt),bf(Ze,nt))}else(Se===0||Se===fe.length-2)&&le.push(bf(He,AI(He,Ze)));else if(Pe)le.push(bf(He,Ze.coord));else{const nt=Math.abs(He.from-We)Kr||Math.abs(j.y-Q.y)>Kr)&&le.push(Q);const Be=[];le.length>0&&Be.push(le[0]);for(let Se=1;SeKr||Math.abs(He.y-De.y)>Kr)&&Be.push(He)}ye.points=Be}for(const ce of i){const ye=ce.__originalEdge;ye&&ce.points&&(ye.points=ce.points)}t.edges=(t.edges??[]).filter(ce=>!ce.isLayoutOnly);const me=b((ce,ye)=>{const ke=ye.x??0,le=ye.y??0,pe=ye.width??0,U=ye.height??0;if(pe<=0||U<=0)return ce;const oe=ke-pe/2,Q=ke+pe/2,fe=le-U/2,j=le+U/2;if(ce.xQ||ce.yj)return ce;const Be=ce.x-oe,Se=Q-ce.x,He=ce.y-fe,De=j-ce.y,We=Math.min(Be,Se,He,De);return We===Be?{x:oe,y:ce.y}:We===Se?{x:Q,y:ce.y}:We===He?{x:ce.x,y:fe}:{x:ce.x,y:j}},"nodeBoundaryClamp");for(const ce of t.edges){const ye=ce.points;if(!ye||ye.length<2)continue;const ke=ce.start,le=ce.end,pe=ke?a.get(ke):void 0,U=le?a.get(le):void 0;pe&&(ye[0]=me(ye[0],pe)),U&&(ye[ye.length-1]=me(ye[ye.length-1],U))}return t}b(Wte,"routeEdgesOrthogonal");function qte(t){return t.direction??"TB"}b(qte,"getSwimlaneDirection");function Vte(t){var h,d,f,p,g;const e=wee(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=qte(t),{ordered:l,coordinates:u}=Gte(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});Cee(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;Wte(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return ite(t,o),nte(t),o}b(Vte,"runSwimlaneLayoutCore");async function Ute(t,e){const r=e.select("g");L7(r,t.markers,t.type,t.diagramId),jX(),JX(),yY(),SJ(),Tee(t);const n=See(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await aee(r,t);Vte(t),await yee(t,i)}b(Ute,"render");const Rqe=Object.freeze(Object.defineProperty({__proto__:null,render:Ute},Symbol.toStringTag,{value:"Module"}));function _I(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Hte(t,e,r){return(e=Yte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dqe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nqe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Oqe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $qe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hi(t,e){return Lqe(t)||Nqe(t,e)||RI(t,e)||Oqe()}function $k(t){return Iqe(t)||Dqe(t)||RI(t)||$qe()}function Pqe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Yte(t){var e=Pqe(t,"string");return typeof e=="symbol"?e:e+""}function ta(t){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ta(t)}function RI(t,e){if(t){if(typeof t=="string")return _I(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_I(t,e):void 0}}var ra=typeof window>"u"?null:window,Xte=ra?ra.navigator:null;ra&&ra.document;var Bqe=ta(""),jte=ta({}),Fqe=ta(function(){}),zqe=typeof HTMLElement>"u"?"undefined":ta(HTMLElement),Mx=function(e){return e&&e.instanceString&&mi(e.instanceString)?e.instanceString():null},vr=function(e){return e!=null&&ta(e)==Bqe},mi=function(e){return e!=null&&ta(e)===Fqe},Wn=function(e){return!yo(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},gn=function(e){return e!=null&&ta(e)===jte&&!Wn(e)&&e.constructor===Object},Gqe=function(e){return e!=null&&ta(e)===jte},Vt=function(e){return e!=null&&ta(e)===ta(1)&&!isNaN(e)},Wqe=function(e){return Vt(e)&&Math.floor(e)===e},Pk=function(e){if(zqe!=="undefined")return e!=null&&e instanceof HTMLElement},yo=function(e){return Dx(e)||Kte(e)},Dx=function(e){return Mx(e)==="collection"&&e._private.single},Kte=function(e){return Mx(e)==="collection"&&!e._private.single},LI=function(e){return Mx(e)==="core"},Zte=function(e){return Mx(e)==="stylesheet"},qqe=function(e){return Mx(e)==="event"},Ih=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Vqe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Uqe=function(e){return gn(e)&&Vt(e.x1)&&Vt(e.x2)&&Vt(e.y1)&&Vt(e.y2)},Hqe=function(e){return Gqe(e)&&mi(e.then)},Yqe=function(){return Xte&&Xte.userAgent.match(/msie|trident|edge/i)},gg=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},eVe=function(e,r){return-1*ere(e,r)},Sr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+Kqe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},nVe=function(e){var r,n=new RegExp("^"+Xqe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},iVe=function(e){return aVe[e.toLowerCase()]},tre=function(e){return(Wn(e)?e:null)||iVe(e)||tVe(e)||nVe(e)||rVe(e)},aVe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},rre=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||_<0||T&&R>=f}function E(){var $=e();if(S($))return L($);g=setTimeout(E,k($))}function L($){return g=void 0,x&&h?w($):(h=d=void 0,p)}function M(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function I(){return g===void 0?p:L(e())}function P(){var $=e(),_=S($);if(h=arguments,d=this,m=$,_){if(g===void 0)return C(m);if(T)return clearTimeout(g),g=setTimeout(E,l),w(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=I,P}return HI=s,HI}var gVe=pVe(),Px=Nx(gVe),YI=ra?ra.performance:null,bre=YI&&YI.now?function(){return YI.now()}:function(){return Date.now()},mVe=(function(){if(ra){if(ra.requestAnimationFrame)return function(t){ra.requestAnimationFrame(t)};if(ra.mozRequestAnimationFrame)return function(t){ra.mozRequestAnimationFrame(t)};if(ra.webkitRequestAnimationFrame)return function(t){ra.webkitRequestAnimationFrame(t)};if(ra.msRequestAnimationFrame)return function(t){ra.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(bre())},1e3/60)}})(),Gk=function(e){return mVe(e)},yu=bre,xf=9261,xre=65599,mg=5381,Tre=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xf,n=r,i;i=e.next(),!i.done;)n=n*xre+i.value|0;return n},Bx=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xf;return r*xre+e|0},Fx=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mg;return(r<<5)+r+e|0},yVe=function(e,r){return e*2097152+r},Dh=function(e){return e[0]*2097152+e[1]},Wk=function(e,r){return[Bx(e[0],r[0]),Fx(e[1],r[1])]},wre=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},KI=function(e){e.splice(0,e.length)},AVe=function(e,r){for(var n=0;n"u"?"undefined":ta(Set))!==RVe?Set:LVe,Vk=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!LI(e)){di("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){di("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new yg,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Wn(r.classes)?u=r.classes:vr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,x,w,C){var k;if(x==null&&(x=0),C==null&&(C=n),x<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);xM;0<=M?L++:L--)E.push(L);return E}).apply(this).reverse(),S=[],w=0,C=k.length;wI;0<=I?++E:--E)P.push(s(v,x));return P},m=function(v,T,x,w){var C,k,S;for(w==null&&(w=n),C=v[x];x>T;){if(S=x-1>>1,k=v[S],w(C,k)<0){v[x]=k,x=S;continue}break}return v[x]=C},y=function(v,T,x){var w,C,k,S,E;for(x==null&&(x=n),C=v.length,E=T,k=v[T],w=2*T+1;w0;){var k=T.pop(),S=y(k),E=k.id();if(f[E]=S,S!==1/0)for(var L=k.neighborhood().intersect(g),M=0;M0)for(N.unshift(D);d[F];){var G=d[F];N.unshift(G.edge),N.unshift(G.node),B=G.node,F=B.id()}return o.spawn(N)}}}},PVe={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var C=0;C0;){if(C(),S++,w===h){for(var E=[],L=a,M=h,I=v[M];E.unshift(L),I!=null&&E.unshift(I),L=y[M],L!=null;)M=L.id(),I=v[M];return{found:!0,distance:d[w],path:this.spawn(E),steps:S}}p[w]=!0;for(var P=x._private.edges,$=0;$I&&(g[M]=I,T[M]=L,x[M]=C),!a){var P=L*h+E;!a&&g[P]>I&&(g[P]=I,T[P]=E,x[P]=C)}}}for(var $=0;$1&&arguments[1]!==void 0?arguments[1]:s,Ce=x(ue),me=[],$e=Ce;;){if($e==null)return r.spawn();var we=T($e),Le=we.edge,Ye=we.pred;if(me.unshift($e[0]),$e.same(de)&&me.length>0)break;Le!=null&&me.unshift(Le),$e=Ye}return l.spawn(me)},k=0;k=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=UVe(a,e,r),n--}return r},HVe={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/VVe);if(a<2){di("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},QVe=function(e){return Math.PI*e/180},Yk=function(e,r){return Math.atan2(r,e)-Math.PI/2},eM=Math.log2||function(t){return Math.log(t)/Math.log(2)},tM=function(e){return e>0?1:e<0?-1:0},wf=function(e,r){return Math.sqrt(Cf(e,r))},Cf=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},JVe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},tUe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},rUe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},nUe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Nre=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Xk=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},jk=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Hi(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ore=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},rM=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Oh=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},$re=function(e,r){return Oh(e,r.x,r.y)},Pre=function(e,r){return Oh(e,r.x1,r.y1)&&Oh(e,r.x2,r.y2)},iUe=(JI=Math.hypot)!==null&&JI!==void 0?JI:function(t,e){return Math.sqrt(t*t+e*e)};function aUe(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,L){return{x:E.x+L.x,y:E.y+L.y}},n=function(E,L){return{x:E.x-L.x,y:E.y-L.y}},i=function(E,L){return{x:E.x*L,y:E.y*L}},a=function(E,L){return E.x*L.y-E.y*L.x},s=function(E){var L=iUe(E.x,E.y);return L===0?{x:0,y:0}:{x:E.x/L,y:E.y/L}},o=function(E){for(var L=0,M=0;M7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Ph(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=$h(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var x=n+h+o,w=i-d+u-o,C=x,k=i+d-u+o;if(g=$h(e,r,n,i,x,w,C,k,!1),g.length>0)return g}if(f){var S=n-h+u-o,E=i+d+o,L=n+h-u+o,M=E;if(g=$h(e,r,n,i,S,E,L,M,!1),g.length>0)return g}if(p){var I=n-h-o,P=i-d+u-o,$=I,_=i+d-u+o;if(g=$h(e,r,n,i,I,P,$,_,!1),g.length>0)return g}var R;{var O=n-h+u,D=i-d+u;if(R=qx(e,r,n,i,O,D,u+o),R.length>0&&R[0]<=O&&R[1]<=D)return[R[0],R[1]]}{var N=n+h-u,B=i-d+u;if(R=qx(e,r,n,i,N,B,u+o),R.length>0&&R[0]>=N&&R[1]<=B)return[R[0],R[1]]}{var F=n+h-u,G=i+d-u;if(R=qx(e,r,n,i,F,G,u+o),R.length>0&&R[0]>=F&&R[1]>=G)return[R[0],R[1]]}{var z=n-h+u,W=i+d-u;if(R=qx(e,r,n,i,z,W,u+o),R.length>0&&R[0]<=z&&R[1]>=W)return[R[0],R[1]]}return[]},oUe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},lUe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},cUe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},uUe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},hUe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];uUe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,x,w,C=0;C=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Hs=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},bu=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=Zk(h,-u);m=Kk(y)}else m=h;return Hs(e,r,m)},fUe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var x=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[x,w];var C=T[1]*l[0]+e,k=T[1]*l[1]+r;return[x,w,C,k]}else return[x,w]},nM=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},$h=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var x=y/T,w=v/T,C=.001,k=0-C,S=1+C;return k<=x&&x<=S&&k<=w&&w<=S?[e+x*d,r+x*g]:u?[e+x*d,r+x*g]:[]}else return y===0||v===0?nM(e,n,o)===o?[o,l]:nM(e,n,a)===a?[a,s]:nM(a,o,n)===n?[n,i]:[]:[]},gUe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=Zk(d,-l);p=Kk(m)}else p=d}else p=n;for(var y,v,T,x,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(x){return u[x]}},f=0;f0?R=_.edgesTo($)[0]:R=$.edgesTo(_)[0];var O=i(R);$=$.id(),S[$]>S[I]+O&&(S[$]=S[I]+O,E.nodes.indexOf($)<0?E.push($):E.updateItem($),k[$]=0,C[$]=[]),S[$]==S[I]+O&&(k[$]=k[$]+k[I],C[$].push(I))}else for(var D=0;D0;){for(var G=w.pop(),z=0;z0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},LUe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:DUe,o=i,l,u,h=0;h=2?Ux(e,r,n,0,Yre,NUe):Ux(e,r,n,0,Hre)},squaredEuclidean:function(e,r,n){return Ux(e,r,n,0,Yre)},manhattan:function(e,r,n){return Ux(e,r,n,0,Hre)},max:function(e,r,n){return Ux(e,r,n,-1/0,OUe)}};wg["squared-euclidean"]=wg.squaredEuclidean,wg.squaredeuclidean=wg.squaredEuclidean;function Jk(t,e,r,n,i,a){var s;return mi(t)?s=t:s=wg[t]||wg.euclidean,e===0&&mi(t)?s(i,a):s(e,r,n,i,a)}var $Ue=Ma({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),cM=function(e){return $Ue(e)},eE=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return Jk(e,i.length,o,l,u,h)},uM=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},FUe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},tne=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=tne(e,r,n),i},rne=function(e){for(var r=this.cy(),n=this.nodes(),i=ZUe(e),a={},s=0;s=I?(P=I,I=_,$=R):_>P&&(P=_);for(var O=0;O0?1:0;S[L%i.minIterations*o+z]=W,G+=W}if(G>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var V=0,H=0;H1||k>1)&&(o=!0),d[x]=[],T.outgoers().forEach(function(E){E.isEdge()&&d[x].push(E.id())})}else f[x]=[void 0,T.target().id()]}):s.forEach(function(T){var x=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=x:l=x),d[x]=[],T.connectedEdges().forEach(function(C){return d[x].push(C.id())})}else f[x]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(x){for(var w=x,C=[x],k,S,E;d[w].length;)k=d[w].shift(),S=f[k][0],E=f[k][1],w!=E?(d[E]=d[E].filter(function(L){return L!=k}),w=E):!a&&w!=S&&(d[S]=d[S].filter(function(L){return L!=k}),w=S),C.unshift(k),C.unshift(w);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},tE=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(x){var w=x.id(),C=x.connectedEdges().intersection(e);y.merge(x),r[w].cutVertex?y.merge(C.filter(function(k){return k.isLoop()})):y.merge(C)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,x;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(x=w.id(),o[x]||(o[x]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},aHe={hopcroftTarjanBiconnected:tE,htbc:tE,htb:tE,hopcroftTarjanBiconnectedComponents:tE},rE=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},sHe={tarjanStronglyConnected:rE,tsc:rE,tscc:rE,tarjanStronglyConnectedComponents:rE},nne={};[zx,$Ve,PVe,FVe,GVe,qVe,HVe,bUe,xg,Tg,lM,MUe,UUe,jUe,rHe,iHe,aHe,sHe].forEach(function(t){Sr(nne,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var pQ=0,gQ=1,mQ=2,Po=function(e){if(!(this instanceof Po))return new Po(e);this.id="Thenable/1.0.7",this.state=pQ,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Po.prototype={fulfill:function(e){return yQ(this,gQ,"fulfillValue",e)},reject:function(e){return yQ(this,mQ,"rejectReason",e)},then:function(e,r){var n=this,i=new Po;return n.onFulfilled.push(xQ(e,i,"fulfill")),n.onRejected.push(xQ(r,i,"reject")),vQ(n),i.proxy}};var yQ=function(e,r,n,i){return e.state===pQ&&(e.state=r,e[n]=i,vQ(e)),e},vQ=function(e){e.state===gQ?bQ(e,"onFulfilled",e.fulfillValue):e.state===mQ&&bQ(e,"onRejected",e.rejectReason)},bQ=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return aL=e,aL}var sL,UQ;function Sze(){if(UQ)return sL;UQ=1;var t=B5();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return sL=e,sL}var oL,HQ;function Aze(){if(HQ)return oL;HQ=1;var t=wze(),e=Cze(),r=kze(),n=Eze(),i=Sze();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Cn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};z5.className=z5.classNames=z5.classes;var Zr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Bi,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Zr.variable="(?:[\\w-.]|(?:\\\\"+Zr.metaChar+"))+",Zr.className="(?:[\\w-]|(?:\\\\"+Zr.metaChar+"))+",Zr.value=Zr.string+"|"+Zr.number,Zr.id=Zr.variable,(function(){var t,e,r;for(t=Zr.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Zr.comparatorOp+="|\\!"+e)})();var bn=function(){return{checks:[]}},Zt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},$L=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return tBe(t.selector,e.selector)}),iGe=(function(){for(var t={},e,r=0;r<$L.length;r++)e=$L[r],t[e.selector]=e.matches;return t})(),aGe=function(e,r){return iGe[e](r)},sGe="("+$L.map(function(t){return t.selector}).join("|")+")",N0=function(e){return e.replace(new RegExp("\\\\("+Zr.metaChar+")","g"),function(r,n){return n})},rh=function(e,r,n){e[e.length-1]=n},PL=[{name:"group",query:!0,regex:"("+Zr.group+")",populate:function(e,r,n){var i=Ei(n,1),a=i[0];r.checks.push({type:Zt.GROUP,value:a==="*"?a:a+"s"})}},{name:"state",query:!0,regex:sGe,populate:function(e,r,n){var i=Ei(n,1),a=i[0];r.checks.push({type:Zt.STATE,value:a})}},{name:"id",query:!0,regex:"\\#("+Zr.id+")",populate:function(e,r,n){var i=Ei(n,1),a=i[0];r.checks.push({type:Zt.ID,value:N0(a)})}},{name:"className",query:!0,regex:"\\.("+Zr.className+")",populate:function(e,r,n){var i=Ei(n,1),a=i[0];r.checks.push({type:Zt.CLASS,value:N0(a)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Zr.variable+")\\s*\\]",populate:function(e,r,n){var i=Ei(n,1),a=i[0];r.checks.push({type:Zt.DATA_EXIST,field:N0(a)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Zr.variable+")\\s*("+Zr.comparatorOp+")\\s*("+Zr.value+")\\s*\\]",populate:function(e,r,n){var i=Ei(n,3),a=i[0],s=i[1],o=i[2],l=new RegExp("^"+Zr.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:Zt.DATA_COMPARE,field:N0(a),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Zr.boolOp+")\\s*("+Zr.variable+")\\s*\\]",populate:function(e,r,n){var i=Ei(n,2),a=i[0],s=i[1];r.checks.push({type:Zt.DATA_BOOL,field:N0(s),operator:a})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Zr.meta+")\\s*("+Zr.comparatorOp+")\\s*("+Zr.number+")\\s*\\]\\]",populate:function(e,r,n){var i=Ei(n,3),a=i[0],s=i[1],o=i[2];r.checks.push({type:Zt.META_COMPARE,field:N0(a),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Zr.separator,populate:function(e,r){var n=e.currentSubject,i=e.edgeCount,a=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=i,s.compoundCount=a,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=bn();return o}},{name:"directedEdge",separator:!0,regex:Zr.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=bn(),i=r,a=bn();return n.checks.push({type:Zt.DIRECTED_EDGE,source:i,target:a}),rh(e,r,n),e.edgeCount++,a}else{var s=bn(),o=r,l=bn();return s.checks.push({type:Zt.NODE_SOURCE,source:o,target:l}),rh(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Zr.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=bn(),i=r,a=bn();return n.checks.push({type:Zt.UNDIRECTED_EDGE,nodes:[i,a]}),rh(e,r,n),e.edgeCount++,a}else{var s=bn(),o=r,l=bn();return s.checks.push({type:Zt.NODE_NEIGHBOR,node:o,neighbor:l}),rh(e,r,s),l}}},{name:"child",separator:!0,regex:Zr.child,populate:function(e,r){if(e.currentSubject==null){var n=bn(),i=bn(),a=e[e.length-1];return n.checks.push({type:Zt.CHILD,parent:a,child:i}),rh(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=bn(),o=e[e.length-1],l=bn(),u=bn(),h=bn(),d=bn();return s.checks.push({type:Zt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Zt.TRUE}],d.checks.push({type:Zt.TRUE}),l.checks.push({type:Zt.PARENT,parent:d,child:h}),rh(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=bn(),p=bn(),g=[{type:Zt.PARENT,parent:f,child:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"descendant",separator:!0,regex:Zr.descendant,populate:function(e,r){if(e.currentSubject==null){var n=bn(),i=bn(),a=e[e.length-1];return n.checks.push({type:Zt.DESCENDANT,ancestor:a,descendant:i}),rh(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=bn(),o=e[e.length-1],l=bn(),u=bn(),h=bn(),d=bn();return s.checks.push({type:Zt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Zt.TRUE}],d.checks.push({type:Zt.TRUE}),l.checks.push({type:Zt.ANCESTOR,ancestor:d,descendant:h}),rh(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=bn(),p=bn(),g=[{type:Zt.ANCESTOR,ancestor:f,descendant:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"subject",modifier:!0,regex:Zr.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return hn("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],i=n.checks[0],a=i==null?null:i.type;a===Zt.DIRECTED_EDGE?i.type=Zt.NODE_TARGET:a===Zt.UNDIRECTED_EDGE&&(i.type=Zt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];PL.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var oGe=function(e){for(var r,n,i,a=0;a0&&h.edgeCount>0)return hn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return hn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&hn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},uGe=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return hr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case Zt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case Zt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case Zt.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case Zt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case Zt.META_COMPARE:{var w=h.operator,k=h.field;return"[["+k+n(e(w))+r(p)+"]]"}case Zt.STATE:return p;case Zt.ID:return"#"+p;case Zt.CLASS:return"."+p;case Zt.PARENT:case Zt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case Zt.ANCESTOR:case Zt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case Zt.COMPOUND_SPLIT:{var S=a(h.left,d),C=a(h.subject,d),_=a(h.right,d);return S+(S.length>0?" ":"")+C+_}case Zt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function EJ(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return FL(this,t,e,EJ)};function SJ(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}O0.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return FL(this,t,e,SJ)};function vGe(t,e,r){SJ(t,e,r),EJ(t,e,r)}O0.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return FL(this,t,e,vGe)},O0.ancestors=O0.parents;var Kb,AJ;Kb=AJ={data:dn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:dn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:dn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:dn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:dn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:dn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Kb.attr=Kb.data,Kb.removeAttr=Kb.removeData;var bGe=AJ,G5={};function zL(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:$0("indegree",function(t,e){return te}),minOutdegree:$0("outdegree",function(t,e){return te})}),yr(G5,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var x=v?m.position():{x:0,y:0};return a={x:g.x-x.x,y:g.y-x.y},e===void 0?a:a[e]}else if(!s)return;return this}},Bo.modelPosition=Bo.point=Bo.position,Bo.modelPositions=Bo.points=Bo.positions,Bo.renderedPoint=Bo.renderedPosition,Bo.relativePoint=Bo.relativePosition;var xGe=_J,P0=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},B0=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},TGe=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},F0,sh;F0=sh={},sh.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},sh.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},sh.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,O,D){var z=0,F=0,A=O+D;return L>0&&A>0&&(z=O/A*L,F=D/A*L),{biasDiff:z,biasComplementDiff:F}}function g(L,O,D,z){if(D.units==="%")switch(z){case"width":return L>0?D.pfValue*L:0;case"height":return O>0?D.pfValue*O:0;case"average":return L>0&&O>0?D.pfValue*(L+O)/2:0;case"min":return L>0&&O>0?L>O?D.pfValue*O:D.pfValue*L:0;case"max":return L>0&&O>0?L>O?D.pfValue*L:D.pfValue*O:0;default:return 0}else return D.units==="px"?D.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,k=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),C=S.biasDiff,_=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+d.y1+d.y2+_)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},oh=function(e,r){return r==null?e:Fo(e,r.x1,r.y1,r.x2,r.y2)},jb=function(e,r,n){return ja(e,r,n)},q5=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,A5(d,1),Fo(e,d.x1,d.y1,d.x2,d.y2)}}},GL=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=jb(s,"labelWidth",n),d=jb(s,"labelHeight",n),f=jb(s,"labelX",n),p=jb(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,k=r.pstyle("text-background-padding").pfValue,S=2,C=d,_=h,L=_/2,O=C/2,D,z,F,A;if(y)D=f-L,z=f+L,F=p-O,A=p+O;else{switch(P0(l.value)){case"left":D=f-_,z=f;break;case"center":D=f-L,z=f+L;break;case"right":D=f,z=f+_;break}switch(B0(u.value)){case"top":F=p-C,A=p;break;case"center":F=p-O,A=p+O;break;case"bottom":F=p,A=p+C;break}}var R=g-Math.max(x,w)-k-S,N=g+Math.max(x,w)+k+S,M=m-Math.max(x,w)-k-S,I=m+Math.max(x,w)+k+S;D+=R,z+=N,F+=M,A+=I;var $=n||"main",P=a.labelBounds,B=P[$]=P[$]||{};B.x1=D,B.y1=F,B.x2=z,B.y2=A,B.w=z-D,B.h=A-F,B.leftPad=R,B.rightPad=N,B.topPad=M,B.botPad=I;var q=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(q||V){var X=q?jb(a.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(X),ie=Math.sin(X),K=(D+z)/2,se=(F+A)/2;if(!y){switch(P0(l.value)){case"left":K=z;break;case"right":K=D;break}switch(B0(u.value)){case"top":se=A;break;case"bottom":se=F;break}}var te=function(Ge,Ce){return Ge=Ge-K,Ce=Ce-se,{x:Ge*W-Ce*ie+K,y:Ge*ie+Ce*W+se}},Z=te(D,F),ee=te(D,A),ne=te(z,F),oe=te(z,A);D=Math.min(Z.x,ee.x,ne.x,oe.x),z=Math.max(Z.x,ee.x,ne.x,oe.x),F=Math.min(Z.y,ee.y,ne.y,oe.y),A=Math.max(Z.y,ee.y,ne.y,oe.y)}var fe=$+"Rot",Ae=P[fe]=P[fe]||{};Ae.x1=D,Ae.y1=F,Ae.x2=z,Ae.y2=A,Ae.w=z-D,Ae.h=A-F,Fo(e,D,F,z,A),Fo(a.labelBounds.all,D,F,z,A)}return e}},IJ=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;DJ(e,r,n,s,"outside",s/2)}},DJ=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);oh(e,m)}else s!=null&&s>0&&_5(e,[s,s,s,s])}}},wGe=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;DJ(e,r,n,i,a)}},CGe=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Za(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],x=function(Re){return Re.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var w=0,k=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(k=e.pstyle("overlay-padding").value));var S=0,C=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(C=e.pstyle("underlay-padding").value));var _=Math.max(k,C),L=0,O=0;if(i&&(L=e.pstyle("width").pfValue,O=L/2),l&&r.includeNodes){var D=e.position();g=D.x,m=D.y;var z=e.outerWidth(),F=z/2,A=e.outerHeight(),R=A/2;h=g-F,d=g+F,f=m-R,p=m+R,Fo(s,h,f,d,p),i&&IJ(s,e),i&&r.includeOutlines&&!a&&IJ(s,e),i&&wGe(s,e)}else if(u&&r.includeEdges)if(i&&!a){var N=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p),N==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(h=M[0].x,f=M[0].y,d=M[1].x,p=M[1].y,h>d){var I=h;h=d,d=I}if(f>p){var $=f;f=p,p=$}Fo(s,h-O,f-O,d+O,p+O)}}else if(N==="bezier"||N==="unbundled-bezier"||ju(N,"segments")||ju(N,"taxi")){var P;switch(N){case"bezier":case"unbundled-bezier":P=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":P=y.linePts;break}if(P!=null)for(var B=0;Bd){var K=h;h=d,d=K}if(f>p){var se=f;f=p,p=se}h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(q5(s,e,"mid-source"),q5(s,e,"mid-target"),q5(s,e,"source"),q5(s,e,"target")),i){var te=e.pstyle("ghost").value==="yes";if(te){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Fo(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var ne=o.bodyBounds=o.bodyBounds||{};UZ(ne,s),_5(ne,v),A5(ne,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Fo(s,h-_,f-_,d+_,p+_));var oe=o.overlayBounds=o.overlayBounds||{};UZ(oe,s),_5(oe,v),A5(oe,1);var fe=o.labelBounds=o.labelBounds||{};fe.all!=null?nFe(fe.all):fe.all=Za(),i&&r.includeLabels&&(r.includeMainLabels&&GL(s,e,null),u&&(r.includeSourceLabels&&GL(s,e,"source"),r.includeTargetLabels&&GL(s,e,"target")))}return s.x1=ho(s.x1),s.y1=ho(s.y1),s.x2=ho(s.x2),s.y2=ho(s.y2),s.w=ho(s.x2-s.x1),s.h=ho(s.y2-s.y1),s.w>0&&s.h>0&&b&&(_5(s,v),A5(s,1)),s},MJ=function(e){var r=0,n=function(s){return(s?1:0)<0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return $M=e,$M}var PM,One;function kHe(){if(One)return PM;One=1;var t=aE();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return PM=e,PM}var BM,$ne;function EHe(){if($ne)return BM;$ne=1;var t=THe(),e=wHe(),r=CHe(),n=SHe(),i=kHe();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Wn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};oE.className=oE.classNames=oE.classes;var mn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:na,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};mn.variable="(?:[\\w-.]|(?:\\\\"+mn.metaChar+"))+",mn.className="(?:[\\w-]|(?:\\\\"+mn.metaChar+"))+",mn.value=mn.string+"|"+mn.number,mn.id=mn.variable,(function(){var t,e,r;for(t=mn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(mn.comparatorOp+="|\\!"+e)})();var $n=function(){return{checks:[]}},nr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},fD=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return eVe(t.selector,e.selector)}),nYe=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return Rn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Rn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Rn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},cYe=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return vr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case nr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case nr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case nr.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case nr.DATA_EXIST:{var x=h.field;return"["+x+"]"}case nr.META_COMPARE:{var w=h.operator,C=h.field;return"[["+C+n(e(w))+r(p)+"]]"}case nr.STATE:return p;case nr.ID:return"#"+p;case nr.CLASS:return"."+p;case nr.PARENT:case nr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case nr.ANCESTOR:case nr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case nr.COMPOUND_SPLIT:{var k=a(h.left,d),S=a(h.subject,d),E=a(h.right,d);return k+(k.length>0?" ":"")+S+E}case nr.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function gie(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return mD(this,t,e,gie)};function mie(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Eg.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return mD(this,t,e,mie)};function yYe(t,e,r){mie(t,e,r),gie(t,e,r)}Eg.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return mD(this,t,e,yYe)},Eg.ancestors=Eg.parents;var Hx,yie;Hx=yie={data:Ln.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ln.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ln.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ln.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ln.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ln.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Hx.attr=Hx.data,Hx.removeAttr=Hx.removeData;var vYe=yie,lE={};function yD(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:Ag("indegree",function(t,e){return te}),minOutdegree:Ag("outdegree",function(t,e){return te})}),Sr(lE,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}},pl.modelPosition=pl.point=pl.position,pl.modelPositions=pl.points=pl.positions,pl.renderedPoint=pl.renderedPosition,pl.relativePoint=pl.relativePosition;var bYe=vie,_g=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Rg=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},xYe=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Lg,Wh;Lg=Wh={},Wh.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},Wh.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},Wh.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,M,I){var P=0,$=0,_=M+I;return L>0&&_>0&&(P=M/_*L,$=I/_*L),{biasDiff:P,biasComplementDiff:$}}function g(L,M,I,P){if(I.units==="%")switch(P){case"width":return L>0?I.pfValue*L:0;case"height":return M>0?I.pfValue*M:0;case"average":return L>0&&M>0?I.pfValue*(L+M)/2:0;case"min":return L>0&&M>0?L>M?I.pfValue*M:I.pfValue*L:0;case"max":return L>0&&M>0?L>M?I.pfValue*L:I.pfValue*M:0;default:return 0}else return I.units==="px"?I.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var x=p(h.width.val-d.w,m,y),w=x.biasDiff,C=x.biasComplementDiff,k=p(h.height.val-d.h,v,T),S=k.biasDiff,E=k.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-S+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},qh=function(e,r){return r==null?e:gl(e,r.x1,r.y1,r.x2,r.y2)},Yx=function(e,r,n){return vs(e,r,n)},cE=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,Xk(d,1),gl(e,d.x1,d.y1,d.x2,d.y2)}}},vD=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=Yx(s,"labelWidth",n),d=Yx(s,"labelHeight",n),f=Yx(s,"labelX",n),p=Yx(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,x=r.pstyle("text-border-width").pfValue,w=x/2,C=r.pstyle("text-background-padding").pfValue,k=2,S=d,E=h,L=E/2,M=S/2,I,P,$,_;if(y)I=f-L,P=f+L,$=p-M,_=p+M;else{switch(_g(l.value)){case"left":I=f-E,P=f;break;case"center":I=f-L,P=f+L;break;case"right":I=f,P=f+E;break}switch(Rg(u.value)){case"top":$=p-S,_=p;break;case"center":$=p-M,_=p+M;break;case"bottom":$=p,_=p+S;break}}var R=g-Math.max(T,w)-C-k,O=g+Math.max(T,w)+C+k,D=m-Math.max(T,w)-C-k,N=m+Math.max(T,w)+C+k;I+=R,P+=O,$+=D,_+=N;var B=n||"main",F=a.labelBounds,G=F[B]=F[B]||{};G.x1=I,G.y1=$,G.x2=P,G.y2=_,G.w=P-I,G.h=_-$,G.leftPad=R,G.rightPad=O,G.topPad=D,G.botPad=N;var z=y&&v.strValue==="autorotate",W=v.pfValue!=null&&v.pfValue!==0;if(z||W){var V=z?Yx(a.rstyle,"labelAngle",n):v.pfValue,H=Math.cos(V),te=Math.sin(V),Y=(I+P)/2,se=($+_)/2;if(!y){switch(_g(l.value)){case"left":Y=P;break;case"right":Y=I;break}switch(Rg(u.value)){case"top":se=_;break;case"bottom":se=$;break}}var J=function(qe,ue){return qe=qe-Y,ue=ue-se,{x:qe*H-ue*te+Y,y:qe*te+ue*H+se}},Z=J(I,$),ee=J(I,_),re=J(P,$),ge=J(P,_);I=Math.min(Z.x,ee.x,re.x,ge.x),P=Math.max(Z.x,ee.x,re.x,ge.x),$=Math.min(Z.y,ee.y,re.y,ge.y),_=Math.max(Z.y,ee.y,re.y,ge.y)}var ae=B+"Rot",_e=F[ae]=F[ae]||{};_e.x1=I,_e.y1=$,_e.x2=P,_e.y2=_,_e.w=P-I,_e.h=_-$,gl(e,I,$,P,_),gl(a.labelBounds.all,I,$,P,_)}return e}},Tie=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;wie(e,r,n,s,"outside",s/2)}},wie=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);qh(e,m)}else s!=null&&s>0&&jk(e,[s,s,s,s])}}},TYe=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;wie(e,r,n,i,a)}},wYe=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=bs(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Fe){return Fe.pstyle("display").value!=="none"},x=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(x){var w=0,C=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(C=e.pstyle("overlay-padding").value));var k=0,S=0;i&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(S=e.pstyle("underlay-padding").value));var E=Math.max(C,S),L=0,M=0;if(i&&(L=e.pstyle("width").pfValue,M=L/2),l&&r.includeNodes){var I=e.position();g=I.x,m=I.y;var P=e.outerWidth(),$=P/2,_=e.outerHeight(),R=_/2;h=g-$,d=g+$,f=m-R,p=m+R,gl(s,h,f,d,p),i&&Tie(s,e),i&&r.includeOutlines&&!a&&Tie(s,e),i&&TYe(s,e)}else if(u&&r.includeEdges)if(i&&!a){var O=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=M,d+=M,f-=M,p+=M,gl(s,h,f,d,p),O==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var N=h;h=d,d=N}if(f>p){var B=f;f=p,p=B}gl(s,h-M,f-M,d+M,p+M)}}else if(O==="bezier"||O==="unbundled-bezier"||Mh(O,"segments")||Mh(O,"taxi")){var F;switch(O){case"bezier":case"unbundled-bezier":F=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=y.linePts;break}if(F!=null)for(var G=0;Gd){var Y=h;h=d,d=Y}if(f>p){var se=f;f=p,p=se}h-=M,d+=M,f-=M,p+=M,gl(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(cE(s,e,"mid-source"),cE(s,e,"mid-target"),cE(s,e,"source"),cE(s,e,"target")),i){var J=e.pstyle("ghost").value==="yes";if(J){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;gl(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var re=o.bodyBounds=o.bodyBounds||{};Ore(re,s),jk(re,v),Xk(re,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,gl(s,h-E,f-E,d+E,p+E));var ge=o.overlayBounds=o.overlayBounds||{};Ore(ge,s),jk(ge,v),Xk(ge,1);var ae=o.labelBounds=o.labelBounds||{};ae.all!=null?rUe(ae.all):ae.all=bs(),i&&r.includeLabels&&(r.includeMainLabels&&vD(s,e,null),u&&(r.includeSourceLabels&&vD(s,e,"source"),r.includeTargetLabels&&vD(s,e,"target")))}return s.x1=Bo(s.x1),s.y1=Bo(s.y1),s.x2=Bo(s.x2),s.y2=Bo(s.y2),s.w=Bo(s.x2-s.x1),s.h=Bo(s.y2-s.y1),s.w>0&&s.h>0&&x&&(jk(s,v),Xk(s,1)),s},Cie=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:BGe,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},lh.removeAllListeners=function(){return this.removeListener("*")},lh.emit=lh.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Cn(e)||(e=[e]),FGe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===PGe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&_Be(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&hr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":$i(Symbol))!=e&&$i(Symbol.iterator)!=e;r&&(H5[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return rZ({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(jr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(hr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Da.neighbourhood=Da.neighborhood,Da.closedNeighbourhood=Da.closedNeighborhood,Da.openNeighbourhood=Da.openNeighborhood,yr(Da,{source:uo(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:uo(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:eee({attr:"source"}),targets:eee({attr:"target"})});function eee(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Da.componentsOf=Da.components;var da=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Xn("A collection must have a reference to the core");return}var a=new Bc,s=!1;if(!r)r=[];else if(r.length>0&&jr(r[0])&&!$b(r[0])){s=!0;for(var o=[],l=new S0,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var $=o.length===r.length?r:new da(n,o),P=0;P<$.length;P++){var B=$[P];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var q;i.hasCompoundNodes?q=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):q=$,q.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?$.emitAndNotify("add"):e&&$.emit("add")}return r},En.removed=function(){var t=this[0];return t&&t._private.removed},En.inside=function(){var t=this[0];return t&&!t._private.removed},En.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(A){for(var R=A._private.edges,N=0;N0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var z=0;z0?z=A:D=A;while(Math.abs(F)>s&&++R=a?x(O,R):N===0?R:w(O,D,D+u)}var S=!1;function C(){S=!0,(t!==e||r!==n)&&b()}var _=function(D){return S||C(),t===e&&r===n?D:D===0?0:D===1?1:y(k(D),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return L},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var jGe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Sn=function(e,r,n,i){var a=KGe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},j5={linear:function(e,r,n){return e+(r-e)*n},ease:Sn(.25,.1,.25,1),"ease-in":Sn(.42,0,1,1),"ease-out":Sn(0,0,.58,1),"ease-in-out":Sn(.42,0,.58,1),"ease-in-sine":Sn(.47,0,.745,.715),"ease-out-sine":Sn(.39,.575,.565,1),"ease-in-out-sine":Sn(.445,.05,.55,.95),"ease-in-quad":Sn(.55,.085,.68,.53),"ease-out-quad":Sn(.25,.46,.45,.94),"ease-in-out-quad":Sn(.455,.03,.515,.955),"ease-in-cubic":Sn(.55,.055,.675,.19),"ease-out-cubic":Sn(.215,.61,.355,1),"ease-in-out-cubic":Sn(.645,.045,.355,1),"ease-in-quart":Sn(.895,.03,.685,.22),"ease-out-quart":Sn(.165,.84,.44,1),"ease-in-out-quart":Sn(.77,0,.175,1),"ease-in-quint":Sn(.755,.05,.855,.06),"ease-out-quint":Sn(.23,1,.32,1),"ease-in-out-quint":Sn(.86,0,.07,1),"ease-in-expo":Sn(.95,.05,.795,.035),"ease-out-expo":Sn(.19,1,.22,1),"ease-in-out-expo":Sn(1,0,0,1),"ease-in-circ":Sn(.6,.04,.98,.335),"ease-out-circ":Sn(.075,.82,.165,1),"ease-in-out-circ":Sn(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return j5.linear;var i=jGe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Sn};function nee(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function iee(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function q0(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=iee(t,i),o=iee(e,i);if(Gt(s)&&Gt(o))return nee(a,s,o,r,n);if(Cn(s)&&Cn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=j5[p].apply(null,g)):s.easingImpl=j5[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,x=s.position;if(x&&i&&!t.locked()){var b={};tx(v.x,x.x)&&(b.x=q0(v.x,x.x,y,m)),tx(v.y,x.y)&&(b.y=q0(v.y,x.y,y,m)),t.position(b)}var w=s.startPan,k=s.pan,S=a.pan,C=k!=null&&n;C&&(tx(w.x,k.x)&&(S.x=q0(w.x,k.x,y,m)),tx(w.y,k.y)&&(S.y=q0(w.y,k.y,y,m)),t.emit("pan"));var _=s.startZoom,L=s.zoom,O=L!=null&&n;O&&(tx(_,L)&&(a.zoom=Ub(a.minZoom,q0(_,L,y,m),a.maxZoom)),t.emit("zoom")),(C||O)&&t.emit("viewport");var D=s.style;if(D&&D.length>0&&i){for(var z=0;z=0;C--){var _=S[C];_()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],w=b._private;if(w.stopped){p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||QGe(h,b,t),ZGe(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var JGe={animate:dn.animate(),animation:dn.animation(),animated:dn.animated(),clearQueue:dn.clearQueue(),delay:dn.delay(),delayAnimation:dn.delayAnimation(),stop:dn.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&x5(function(a){aee(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){aee(s,e)},n.beforeRenderPriorities.animations):r()}},eqe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&$b(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Z5=function(e){return hr(e)?new nh(e):e},see={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new W5(eqe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Z5(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Z5(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Z5(r),n),this},once:function(e,r,n){return this.emitter().one(e,Z5(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};dn.eventAliasesOn(see);var WL={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};WL.jpeg=WL.jpg;var Q5={layout:function(e){var r=this;if(e==null){Xn("Layout options must be specified to make a layout");return}if(e.name==null){Xn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Xn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;hr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(yr({},e,{cy:r,eles:a}));return s}};Q5.createLayout=Q5.makeLayout=Q5.layout;var tqe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};UL.invalidateDimensions=UL.resize;var J5={collection:function(e,r){return hr(e)?this.$(e):Us(e)?e.collection():Cn(e)?(r||(r={}),new da(this,e,r.unique,r.removed)):new da(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};J5.elements=J5.filter=J5.$;var Zi={},rx="t",nqe="f";Zi.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var S=n.valueMin[0],C=n.valueMax[0],_=n.valueMin[1],L=n.valueMax[1],O=n.valueMin[2],D=n.valueMax[2],z=n.valueMin[3]==null?1:n.valueMin[3],F=n.valueMax[3]==null?1:n.valueMax[3],A=[Math.round(S+(C-S)*w),Math.round(_+(L-_)*w),Math.round(O+(D-O)*w),Math.round(z+(F-z)*w)];a={bypass:n.bypass,name:n.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var N=n.field.split("."),M=d.data,I=0;I0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Zi.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Zi.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Zi.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Zi.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Zi.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Zi.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var nx={};nx.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){hn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new nh(d);if(f.invalid){hn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){hn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var x=v[1],b=v[2],w=e.properties[x];if(!w){hn("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(x,b);if(!k){hn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:x,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return hn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,x=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Cn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],k=[],S=[],C="",_=!1,L=0;L0?" ":"")+O.strValue}return u.validate&&!u.validate(w,k)?null:u.singleEnum&&_?w.length===1&&hr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:C,bypass:r,units:k}}var D=function(){for(var te=0;teu.max||u.strictMax&&e===u.max))return null;var N={name:t,value:e,strValue:""+e+(z||""),units:z,bypass:r};return u.unitless||z!=="px"&&z!=="em"?N.pfValue=e:N.pfValue=z==="px"||!z?e:this.getEmSizeInPixels()*e,(z==="ms"||z==="s")&&(N.pfValue=z==="ms"?e:1e3*e),(z==="deg"||z==="rad")&&(N.pfValue=z==="rad"?e:JBe(e)),z==="%"&&(N.pfValue=e/100),N}else if(u.propList){var M=[],I=""+e;if(I!=="none"){for(var $=I.split(/\s*,\s*|\s+/),P=0;P<$.length;P++){var B=$[P].trim();i.properties[B]?M.push(B):hn("`"+B+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:r}}else if(u.color){var q=hZ(e);return q?{name:t,value:q,pfValue:q,strValue:"rgb("+q[0]+","+q[1]+","+q[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var V=D();if(V)return V}for(var X=u.regexes?u.regexes:[u.regex],W=0;W0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Gt(e)?s=e:jr(e)&&(s=e.level,e.position!=null?a=E5(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Gt(u.x)&&(r.pan.x=u.x,o=!1),Gt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(hr(e)){var n=e;e=this.mutableElements().filter(n)}else Us(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Pd.centre=Pd.center,Pd.autolockNodes=Pd.autolock,Pd.autoungrabifyNodes=Pd.autoungrabify;var ix={data:dn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:dn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:dn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:dn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ix.attr=ix.data,ix.removeAttr=ix.removeData;var ax=function(e){var r=this;e=yr({},e);var n=e.container;n&&!m5(n)&&m5(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=Pi!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=yr({name:s?"grid":"null"},o.layout),o.renderer=yr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new da(this),listeners:[],aniEles:new da(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Gt(o.zoom)?o.zoom:1,pan:{x:jr(o.pan)&&Gt(o.pan.x)?o.pan.x:0,y:jr(o.pan)&&Gt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(YPe);if(y)return M0.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=yr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(jr(g)||Cn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var x=yr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Qn(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Za(o?t.boundingBox:structuredClone(e.extent())),u;if(Us(t.roots))u=t.roots;else if(Cn(t.roots)){for(var h=[],d=0;d0;){var A=F(),R=L(A,D);if(R)A.outgoers().filter(function(be){return be.isNode()&&r.has(be)}).forEach(z);else if(R===null){hn("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(t.avoidOverlap)for(var M=0;M0&&v[0].length<=3?Ve/2:0),nt=2*Math.PI/v[He].length*xe;return He===0&&v[0].length===1&&(Je=1),{x:ne.x+Je*Math.cos(nt),y:ne.y+Je*Math.sin(nt)}}else{var tt=v[He].length,Ze=Math.max(tt===1?0:o?(l.w-t.padding*2-oe.w)/((t.grid?Ae:tt)-1):(l.w-t.padding*2-oe.w)/((t.grid?Ae:tt)+1),N),Ee={x:ne.x+(xe+1-(tt+1)/2)*Ze,y:ne.y+(He+1-(W+1)/2)*fe};return Ee}},Ge={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ge).indexOf(t.direction)===-1&&Xn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ge).join(", ")));var Ce=function(Fe){return wBe(Re(Fe),l,Ge[t.direction])};return r.nodes().layoutPositions(this,t,Ce),this};var lqe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function cee(t){this.options=yr({},lqe,t)}cee.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Za(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var w=function(S,C){var _=e.startAngle+C*u*(i?1:-1),L=h*Math.cos(_),O=h*Math.sin(_),D={x:o.x+L,y:o.y+O};return D};return n.nodes().layoutPositions(this,e,w),this};var cqe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function uee(t){this.options=yr({},cqe,t)}uee.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Za(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var k=Math.abs(x[0].value-w.value);k>=y&&(x=[],v.push(x))}x.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,_=Math.min(s.w,s.h)/2-S,L=_/(v.length+C?1:0);S=Math.min(S,L)}for(var O=0,D=0;D1&&e.avoidOverlap){var R=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),M=Math.sqrt(S*S/(R*R+N*N));O=Math.max(M,O)}z.r=O,O+=S}if(e.equidistant){for(var I=0,$=0,P=0;P=t.numIter||(mqe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),x5(h)}};h()}else{for(;u;)u=s(l),l++;gee(n,t),o()}return this},n3.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},n3.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var hqe=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Za(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(_);for(var h=0;h<_.length;h++)v[++b]=_[h]}}for(var h=0;hi.count?0:i.graph},hee=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=i3(e,o,l),y=i3(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},bqe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},i3=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},xqe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},wqe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},pee=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},Eqe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function mee(t){this.options=yr({},Eqe,t)}mee.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Za(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(V){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(X){if(X==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=X:u=X},d=function(X){if(X==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=X:u=X},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var x=a.w/u,b=a.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,A++)},M={},I=0;I(R=fFe(t,e,N[M],N[M+1],N[M+2],N[M+3])))return y(C,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var N=L.allpts,M=0;M+5(R=dFe(t,e,N[M],N[M+1],N[M+2],N[M+3],N[M+4],N[M+5])))return y(C,R),!0}for(var I=I||_.source,$=$||_.target,P=i.getArrowWidth(O,D),B=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],M=0;M0&&(v(I),v($))}function b(C,_,L){return ja(C,_,L)}function w(C,_){var L=C._private,O=f,D;_?D=_+"-":D="",C.boundingBox();var z=L.labelBounds[_||"main"],F=C.pstyle(D+"label").value,A=C.pstyle("text-events").strValue==="yes";if(!(!A||!F)){var R=b(L.rscratch,"labelX",_),N=b(L.rscratch,"labelY",_),M=b(L.rscratch,"labelAngle",_),I=C.pstyle(D+"text-margin-x").pfValue,$=C.pstyle(D+"text-margin-y").pfValue,P=z.x1-O-I,B=z.x2+O-I,q=z.y1-O-$,V=z.y2+O-$;if(M){var X=Math.cos(M),W=Math.sin(M),ie=function(oe,fe){return oe=oe-R,fe=fe-N,{x:oe*X-fe*W+R,y:oe*W+fe*X+N}},K=ie(P,q),se=ie(P,V),te=ie(B,q),Z=ie(B,V),ee=[K.x+I,K.y+$,te.x+I,te.y+$,Z.x+I,Z.y+$,se.x+I,se.y+$];if(ws(t,e,ee))return y(C),!0}else if(Ju(z,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var S=s[k];S.isNode()?v(S)||w(S):x(S)||w(S)||w(S,"source")||w(S,"target")}return o},Bd.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Za({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(oe,fe,Ae){return ja(oe,fe,Ae)}function y(oe,fe){var Ae=oe._private,Re=s,Ge="";oe.boundingBox();var Ce=Ae.labelBounds.main;if(!Ce)return null;var be=m(Ae.rscratch,"labelX",fe),Fe=m(Ae.rscratch,"labelY",fe),ye=m(Ae.rscratch,"labelAngle",fe),He=oe.pstyle(Ge+"text-margin-x").pfValue,xe=oe.pstyle(Ge+"text-margin-y").pfValue,Ve=Ce.x1-Re-He,Je=Ce.x2+Re-He,nt=Ce.y1-Re-xe,tt=Ce.y2+Re-xe;if(ye){var Ze=Math.cos(ye),Ee=Math.sin(ye),Se=function(ce,j){return ce=ce-be,j=j-Fe,{x:ce*Ze-j*Ee+be,y:ce*Ee+j*Ze+Fe}};return[Se(Ve,nt),Se(Je,nt),Se(Je,tt),Se(Ve,tt)]}else return[{x:Ve,y:nt},{x:Je,y:nt},{x:Je,y:tt},{x:Ve,y:tt}]}function v(oe,fe,Ae,Re){function Ge(Ce,be,Fe){return(Fe.y-Ce.y)*(be.x-Ce.x)>(be.y-Ce.y)*(Fe.x-Ce.x)}return Ge(oe,Ae,Re)!==Ge(fe,Ae,Re)&&Ge(oe,fe,Ae)!==Ge(oe,fe,Re)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},Iqe=function(e,r,n,i,a){if(e!==See?Aee(r,e,Il):Lqe(fo,Il),Aee(r,n,fo),wee=Il.nx*fo.ny-Il.ny*fo.nx,Cee=Il.nx*fo.nx-Il.ny*-fo.ny,zc=Math.asin(Math.max(-1,Math.min(1,wee))),Math.abs(zc)<1e-6){ZL=r.x,QL=r.y,Gd=W0=0;return}Fd=1,s3=!1,Cee<0?zc<0?zc=Math.PI+zc:(zc=Math.PI-zc,Fd=-1,s3=!0):zc>0&&(Fd=-1,s3=!0),r.radius!==void 0?W0=r.radius:W0=i,zd=zc/2,o3=Math.min(Il.len/2,fo.len/2),a?(Dl=Math.abs(Math.cos(zd)*W0/Math.sin(zd)),Dl>o3?(Dl=o3,Gd=Math.abs(Dl*Math.sin(zd)/Math.cos(zd))):Gd=W0):(Dl=Math.min(o3,W0),Gd=Math.abs(Dl*Math.sin(zd)/Math.cos(zd))),JL=r.x+fo.nx*Dl,eI=r.y+fo.ny*Dl,ZL=JL-fo.ny*Gd*Fd,QL=eI+fo.nx*Gd*Fd,kee=r.x+Il.nx*Dl,Eee=r.y+Il.ny*Dl,See=r};function _ee(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function tI(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Iqe(t,e,r,n,i),{cx:ZL,cy:QL,radius:Gd,startX:kee,startY:Eee,stopX:JL,stopY:eI,startAngle:Il.ang+Math.PI/2*Fd,endAngle:fo.ang-Math.PI/2*Fd,counterClockwise:s3})}var sx=.01,Dqe=Math.sqrt(2*sx),Na={};Na.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(k,S,C,_){var L=_-S,O=C-k,D=Math.sqrt(O*O+L*L);return{x:-L/D,y:O/D}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ei(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ei(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),a=b}else hn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},Na.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-pe,0):Math.min(j+pe,0)},F=z(O,_),A=z(D,L),R=!1;x===u?v=Math.abs(F)>Math.abs(A)?i:n:x===l||x===o?(v=n,R=!0):(x===a||x===s)&&(v=i,R=!0);var N=v===n,M=N?A:F,I=N?D:O,$=k8(I),P=!1;!(R&&(w||S))&&(x===o&&I<0||x===l&&I>0||x===a&&I>0||x===s&&I<0)&&($*=-1,M=$*Math.abs(M),P=!0);var B;if(w){var q=k<0?1+k:k;B=q*M}else{var V=k<0?M:0;B=V+k*$}var X=function(j){return Math.abs(j)=Math.abs(M)},W=X(B),ie=X(Math.abs(M)-Math.abs(B)),K=W||ie;if(K&&!P)if(N){var se=Math.abs(I)<=f/2,te=Math.abs(O)<=p/2;if(se){var Z=(h.x1+h.x2)/2,ee=h.y1,ne=h.y2;r.segpts=[Z,ee,Z,ne]}else if(te){var oe=(h.y1+h.y2)/2,fe=h.x1,Ae=h.x2;r.segpts=[fe,oe,Ae,oe]}else r.segpts=[h.x1,h.y2]}else{var Re=Math.abs(I)<=d/2,Ge=Math.abs(D)<=g/2;if(Re){var Ce=(h.y1+h.y2)/2,be=h.x1,Fe=h.x2;r.segpts=[be,Ce,Fe,Ce]}else if(Ge){var ye=(h.x1+h.x2)/2,He=h.y1,xe=h.y2;r.segpts=[ye,He,ye,xe]}else r.segpts=[h.x2,h.y1]}else if(N){var Ve=h.y1+B+(y?f/2*$:0),Je=h.x1,nt=h.x2;r.segpts=[Je,Ve,nt,Ve]}else{var tt=h.x1+B+(y?d/2*$:0),Ze=h.y1,Ee=h.y2;r.segpts=[tt,Ze,tt,Ee]}if(r.isRound){var Se=t.pstyle("taxi-radius").value,Y=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Se),r.isArcRadius=new Array(r.segpts.length/2).fill(Y)}},Na.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Gt(r.startX)||!Gt(r.startY),y=!Gt(r.arrowStartX)||!Gt(r.arrowStartY),v=!Gt(r.endX)||!Gt(r.endY),x=!Gt(r.arrowEndX)||!Gt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*w,S=Md({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=SI.poolIndex()){var $=M;M=I,I=$}var P=F.srcPos=M.position(),B=F.tgtPos=I.position(),q=F.srcW=M.outerWidth(),V=F.srcH=M.outerHeight(),X=F.tgtW=I.outerWidth(),W=F.tgtH=I.outerHeight(),ie=F.srcShape=r.nodeShapes[e.getNodeShape(M)],K=F.tgtShape=r.nodeShapes[e.getNodeShape(I)],se=F.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,te=F.tgtCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Z=F.tgtRs=I._private.rscratch,ee=F.srcRs=M._private.rscratch;F.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ne=0;ne=Dqe||(nt=Math.sqrt(Math.max(Je*Je,sx)+Math.max(Ve*Ve,sx)));var tt=F.vector={x:Je,y:Ve},Ze=F.vectorNorm={x:tt.x/nt,y:tt.y/nt},Ee={x:-Ze.y,y:Ze.x};F.nodesOverlap=!Gt(nt)||K.checkPoint(Ce[0],Ce[1],0,X,W,B.x,B.y,te,Z)||ie.checkPoint(Fe[0],Fe[1],0,q,V,P.x,P.y,se,ee),F.vectorNormInverse=Ee,A={nodesOverlap:F.nodesOverlap,dirCounts:F.dirCounts,calculatedIntersection:!0,hasBezier:F.hasBezier,hasUnbundled:F.hasUnbundled,eles:F.eles,srcPos:B,srcRs:Z,tgtPos:P,tgtRs:ee,srcW:X,srcH:W,tgtW:q,tgtH:V,srcIntn:ye,tgtIntn:be,srcShape:K,tgtShape:ie,posPts:{x1:xe.x2,y1:xe.y2,x2:xe.x1,y2:xe.y1},intersectionPts:{x1:He.x2,y1:He.y2,x2:He.x1,y2:He.y1},vector:{x:-tt.x,y:-tt.y},vectorNorm:{x:-Ze.x,y:-Ze.y},vectorNormInverse:{x:-Ee.x,y:-Ee.y}}}var Se=Ge?A:F;fe.nodesOverlap=Se.nodesOverlap,fe.srcIntn=Se.srcIntn,fe.tgtIntn=Se.tgtIntn,fe.isRound=Ae.startsWith("round"),i&&(M.isParent()||M.isChild()||I.isParent()||I.isChild())&&(M.parents().anySame(I)||I.parents().anySame(M)||M.same(I)&&M.isParent())?e.findCompoundLoopPoints(oe,Se,ne,Re):M===I?e.findLoopPoints(oe,Se,ne,Re):Ae.endsWith("segments")?e.findSegmentsPoints(oe,Se):Ae.endsWith("taxi")?e.findTaxiPoints(oe,Se):Ae==="straight"||!Re&&F.eles.length%2===1&&ne===Math.floor(F.eles.length/2)?e.findStraightEdgePoints(oe):e.findBezierPoints(oe,Se,ne,Re,Ge),e.findEndpoints(oe),e.tryToCorrectInvalidPoints(oe,Se),e.checkForInvalidEdgeWarning(oe),e.storeAllpts(oe),e.storeEdgeProjections(oe),e.calculateArrowAngles(oe),e.recalculateEdgeLabelProjections(oe),e.calculateLabelAngles(oe)}},C=0;C0){var Ce=u,be=Nd(Ce,A0(s)),Fe=Nd(Ce,A0(Ge)),ye=be;if(Fe2){var He=Nd(Ce,{x:Ge[2],y:Ge[3]});He0){var re=h,Pe=Nd(re,A0(s)),ve=Nd(re,A0(pe)),Ue=Pe;if(ve2){var Me=Nd(re,{x:pe[2],y:pe[3]});Me=g||C){y={cp:w,segment:S};break}}if(y)break}var _=y.cp,L=y.segment,O=(g-v)/L.length,D=L.t1-L.t0,z=p?L.t0+D*O:L.t1-D*O;z=Ub(0,z,1),e=_0(_.p0,_.p1,_.p2,z),f=Nqe(_.p0,_.p1,_.p2,z);break}case"straight":case"segments":case"haystack":{for(var F=0,A,R,N,M,I=n.allpts.length,$=0;$+3=g));$+=2);var P=g-R,B=P/A;B=Ub(0,B,1),e=tFe(N,M,B),f=Iee(N,M);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Ml.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Ml.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Dd(n,t._private.labelDimsKey);if(ja(r.rscratch,"prefixedLabelDimsKey",e)!==i){Rl(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=ja(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Rl(r.rstyle,"labelWidth",e,f),Rl(r.rscratch,"labelWidth",e,f),Rl(r.rstyle,"labelHeight",e,p),Rl(r.rscratch,"labelHeight",e,p),Rl(r.rscratch,"labelLineHeight",e,d),Rl(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},Ml.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(V,X){return X?(Rl(r.rscratch,V,e,X),X):ja(r.rscratch,V,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var k=v.matchAll(m),S="",C=0,_=Ts(k),L;try{for(_.s();!(L=_.n()).done;){var O=L.value,D=O[0],z=v.substring(C,O.index);C=O.index+D.length;var F=S.length===0?z:S+z+D,A=this.calculateLabelDimensions(t,F),R=A.width;R<=d?S+=z+D:(S&&g.push(S),S=z+D)}}catch(q){_.e(q)}finally{_.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` -`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var N=t.pstyle("text-max-width").pfValue,M="",I="…",$=!1;if(this.calculateLabelDimensions(t,i).widthN)break;M+=i[P],P===i.length-1&&($=!0)}return $||(M+=I),M}return i},Ml.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?TGe(r):"center":e},Ml.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,x=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var vt=a(Y);ct&&(t.hoverData.tapholdCancelled=!0);var ut=function(){var Ft=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ft.length===0?(Ft.push(it[0]),Ft.push(it[1])):(Ft[0]+=it[0],Ft[1]+=it[1])};j=!0,i(Le,["mousemove","vmousemove","tapdrag"],Y,{x:ve[0],y:ve[1]});var le=function(Ft){return{originalEvent:Y,type:Ft,position:{x:ve[0],y:ve[1]}}},At=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||pe.emit(le("boxstart")),qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(ct){var dt=le("cxtdrag");De?De.emit(dt):pe.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Le!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(le("cxtdragout")),t.hoverData.cxtOver=Le,Le&&Le.emit(le("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,pe.panningEnabled()&&pe.userPanningEnabled()){var ht;if(t.hoverData.justStartedPan){var St=t.hoverData.mdownPos;ht={x:(ve[0]-St[0])*re,y:(ve[1]-St[1])*re},t.hoverData.justStartedPan=!1}else ht={x:it[0]*re,y:it[1]*re};pe.panBy(ht),pe.emit(le("dragpan")),t.hoverData.dragged=!0}ve=t.projectIntoViewport(Y.clientX,Y.clientY)}else if(qe[4]==1&&(De==null||De.pannable())){if(ct){if(!t.hoverData.dragging&&pe.boxSelectionEnabled()&&(vt||!pe.panningEnabled()||!pe.userPanningEnabled()))At();else if(!t.hoverData.selecting&&pe.panningEnabled()&&pe.userPanningEnabled()){var Nr=s(De,t.hoverData.downs);Nr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,qe[4]=0,t.data.bgActivePosistion=A0(Ue),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&Le!=Ke&&(Ke&&i(Ke,["mouseout","tapdragout"],Y,{x:ve[0],y:ve[1]}),Le&&i(Le,["mouseover","tapdragover"],Y,{x:ve[0],y:ve[1]}),t.hoverData.last=Le),De)if(ct){if(pe.boxSelectionEnabled()&&vt)De&&De.grabbed()&&(m(Te),De.emit(le("freeon")),Te.emit(le("free")),t.dragData.didDrag&&(De.emit(le("dragfreeon")),Te.emit(le("dragfree")))),At();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var me=!t.dragData.didDrag;me&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Te,{inDragLayer:!0});var et={x:0,y:0};if(Gt(it[0])&&Gt(it[1])&&(et.x+=it[0],et.y+=it[1],me)){var lt=t.hoverData.dragDelta;lt&&Gt(lt[0])&&Gt(lt[1])&&(et.x+=lt[0],et.y+=lt[1])}t.hoverData.draggingEles=!0,Te.silentShift(et).emit(le("position")).emit(le("drag")),t.redrawHint("drag",!0),t.redraw()}}else ut();j=!0}if(qe[2]=ve[0],qe[3]=ve[1],j)return Y.stopPropagation&&Y.stopPropagation(),Y.preventDefault&&Y.preventDefault(),!1}},!1);var O,D,z;t.registerBinding(e,"mouseup",function(Y){if(!(t.hoverData.which===1&&Y.which!==1&&t.hoverData.capture)){var ce=t.hoverData.capture;if(ce){t.hoverData.capture=!1;var j=t.cy,pe=t.projectIntoViewport(Y.clientX,Y.clientY),re=t.selection,Pe=t.findNearestElement(pe[0],pe[1],!0,!1),ve=t.dragData.possibleDragElements,Ue=t.hoverData.down,Me=a(Y);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ue&&Ue.unactivate();var qe=function(we){return{originalEvent:Y,type:we,position:{x:pe[0],y:pe[1]}}};if(t.hoverData.which===3){var Le=qe("cxttapend");if(Ue?Ue.emit(Le):j.emit(Le),!t.hoverData.cxtDragged){var Ke=qe("cxttap");Ue?Ue.emit(Ke):j.emit(Ke)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Pe,["mouseup","tapend","vmouseup"],Y,{x:pe[0],y:pe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ue,["click","tap","vclick"],Y,{x:pe[0],y:pe[1]}),D=!1,Y.timeStamp-z<=j.multiClickDebounceTime()?(O&&clearTimeout(O),D=!0,z=null,i(Ue,["dblclick","dbltap","vdblclick"],Y,{x:pe[0],y:pe[1]})):(O=setTimeout(function(){D||i(Ue,["oneclick","onetap","voneclick"],Y,{x:pe[0],y:pe[1]})},j.multiClickDebounceTime()),z=Y.timeStamp)),Ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(Y)&&(j.$(r).unselect(["tapunselect"]),ve.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ve=j.collection()),Pe==Ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Pe!=null&&Pe._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||Me?Pe.selected()?Pe.unselect(["tapunselect"]):Pe.select(["tapselect"]):Me||(j.$(r).unmerge(Pe).unselect(["tapunselect"]),Pe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=j.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),j.emit(qe("boxend"));var it=function(we){return we.selectable()&&!we.selected()};j.selectionType()==="additive"||Me||j.$(r).unmerge(De).unselect(),De.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!re[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Te=Ue&&Ue.grabbed();m(ve),Te&&(Ue.emit(qe("freeon")),ve.emit(qe("free")),t.dragData.didDrag&&(Ue.emit(qe("dragfreeon")),ve.emit(qe("dragfree"))))}}re[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var F=[],A=4,R,N=1e5,M=function(Y,ce){for(var j=0;j=A){var pe=F;if(R=M(pe,5),!R){var re=Math.abs(pe[0]);R=I(pe)&&re>5}if(R)for(var Pe=0;Pe5&&(j=k8(j)*5),Ke=j/-250,R&&(Ke/=N,Ke*=3),Ke=Ke*t.wheelSensitivity;var De=Y.deltaMode===1;De&&(Ke*=33);var it=ve.zoom()*Math.pow(10,Ke);Y.type==="gesturechange"&&(it=t.gestureStartZoom*Y.scale),ve.zoom({level:it,renderedPosition:{x:Le[0],y:Le[1]}}),ve.emit({type:Y.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Y,position:{x:qe[0],y:qe[1]}})}}}};t.registerBinding(t.container,"wheel",$,!0),t.registerBinding(e,"scroll",function(Y){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(Y){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||Y.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Se){t.hasTouchStarted||$(Se)},!0),t.registerBinding(t.container,"mouseout",function(Y){var ce=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseout",position:{x:ce[0],y:ce[1]}})},!1),t.registerBinding(t.container,"mouseover",function(Y){var ce=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseover",position:{x:ce[0],y:ce[1]}})},!1);var P,B,q,V,X,W,ie,K,se,te,Z,ee,ne,oe=function(Y,ce,j,pe){return Math.sqrt((j-Y)*(j-Y)+(pe-ce)*(pe-ce))},fe=function(Y,ce,j,pe){return(j-Y)*(j-Y)+(pe-ce)*(pe-ce)},Ae;t.registerBinding(t.container,"touchstart",Ae=function(Y){if(t.hasTouchStarted=!0,!!_(Y)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ce=t.cy,j=t.touchData.now,pe=t.touchData.earlier;if(Y.touches[0]){var re=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);j[0]=re[0],j[1]=re[1]}if(Y.touches[1]){var re=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);j[2]=re[0],j[3]=re[1]}if(Y.touches[2]){var re=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);j[4]=re[0],j[5]=re[1]}var Pe=function(vt){return{originalEvent:Y,type:vt,position:{x:j[0],y:j[1]}}};if(Y.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var ve=t.findContainerClientCoords();se=ve[0],te=ve[1],Z=ve[2],ee=ve[3],P=Y.touches[0].clientX-se,B=Y.touches[0].clientY-te,q=Y.touches[1].clientX-se,V=Y.touches[1].clientY-te,ne=0<=P&&P<=Z&&0<=q&&q<=Z&&0<=B&&B<=ee&&0<=V&&V<=ee;var Ue=ce.pan(),Me=ce.zoom();X=oe(P,B,q,V),W=fe(P,B,q,V),ie=[(P+q)/2,(B+V)/2],K=[(ie[0]-Ue.x)/Me,(ie[1]-Ue.y)/Me];var qe=200,Le=qe*qe;if(W=1){for(var Et=t.touchData.startPosition=[null,null,null,null,null,null],yt=0;yt=t.touchTapThreshold2}if(ce&&t.touchData.cxt){Y.preventDefault();var yt=Y.touches[0].clientX-se,ot=Y.touches[0].clientY-te,Dt=Y.touches[1].clientX-se,vt=Y.touches[1].clientY-te,ut=fe(yt,ot,Dt,vt),le=ut/W,At=150,dt=At*At,ht=1.5,St=ht*ht;if(le>=St||ut>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Nr=Me("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Nr),t.touchData.start=null):pe.emit(Nr)}}if(ce&&t.touchData.cxt){var Nr=Me("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Nr):pe.emit(Nr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var me=t.findNearestElement(re[0],re[1],!0,!0);(!t.touchData.cxtOver||me!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Me("cxtdragout")),t.touchData.cxtOver=me,me&&me.emit(Me("cxtdragover")))}else if(ce&&Y.touches[2]&&pe.boxSelectionEnabled())Y.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||pe.emit(Me("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(re[0]+re[2]+re[4])/3,j[1]=(re[1]+re[3]+re[5])/3,j[2]=(re[0]+re[2]+re[4])/3+1,j[3]=(re[1]+re[3]+re[5])/3+1):(j[2]=(re[0]+re[2]+re[4])/3,j[3]=(re[1]+re[3]+re[5])/3),t.redrawHint("select",!0),t.redraw();else if(ce&&Y.touches[1]&&!t.touchData.didSelect&&pe.zoomingEnabled()&&pe.panningEnabled()&&pe.userZoomingEnabled()&&pe.userPanningEnabled()){Y.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var lt=0;lt0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ge;t.registerBinding(e,"touchcancel",Ge=function(Y){var ce=t.touchData.start;t.touchData.capture=!1,ce&&ce.unactivate()});var Ce,be,Fe,ye;if(t.registerBinding(e,"touchend",Ce=function(Y){var ce=t.touchData.start,j=t.touchData.capture;if(j)Y.touches.length===0&&(t.touchData.capture=!1),Y.preventDefault();else return;var pe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var re=t.cy,Pe=re.zoom(),ve=t.touchData.now,Ue=t.touchData.earlier;if(Y.touches[0]){var Me=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);ve[0]=Me[0],ve[1]=Me[1]}if(Y.touches[1]){var Me=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);ve[2]=Me[0],ve[3]=Me[1]}if(Y.touches[2]){var Me=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);ve[4]=Me[0],ve[5]=Me[1]}var qe=function(dt){return{originalEvent:Y,type:dt,position:{x:ve[0],y:ve[1]}}};ce&&ce.unactivate();var Le;if(t.touchData.cxt){if(Le=qe("cxttapend"),ce?ce.emit(Le):re.emit(Le),!t.touchData.cxtDragged){var Ke=qe("cxttap");ce?ce.emit(Ke):re.emit(Ke)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!Y.touches[2]&&re.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=re.collection(t.getAllInBox(pe[0],pe[1],pe[2],pe[3]));pe[0]=void 0,pe[1]=void 0,pe[2]=void 0,pe[3]=void 0,pe[4]=0,t.redrawHint("select",!0),re.emit(qe("boxend"));var it=function(dt){return dt.selectable()&&!dt.selected()};De.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ce!=null&&ce.unactivate(),Y.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!Y.touches[1]){if(!Y.touches[0]){if(!Y.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Te=t.dragData.touchDragEles;if(ce!=null){var ct=ce._private.grabbed;m(Te),t.redrawHint("drag",!0),t.redrawHint("eles",!0),ct&&(ce.emit(qe("freeon")),Te.emit(qe("free")),t.dragData.didDrag&&(ce.emit(qe("dragfreeon")),Te.emit(qe("dragfree")))),i(ce,["touchend","tapend","vmouseup","tapdragout"],Y,{x:ve[0],y:ve[1]}),ce.unactivate(),t.touchData.start=null}else{var we=t.findNearestElement(ve[0],ve[1],!0,!0);i(we,["touchend","tapend","vmouseup","tapdragout"],Y,{x:ve[0],y:ve[1]})}var Et=t.touchData.startPosition[0]-ve[0],yt=Et*Et,ot=t.touchData.startPosition[1]-ve[1],Dt=ot*ot,vt=yt+Dt,ut=vt*Pe*Pe;t.touchData.singleTouchMoved||(ce||re.$(":selected").unselect(["tapunselect"]),i(ce,["tap","vclick"],Y,{x:ve[0],y:ve[1]}),be=!1,Y.timeStamp-ye<=re.multiClickDebounceTime()?(Fe&&clearTimeout(Fe),be=!0,ye=null,i(ce,["dbltap","vdblclick"],Y,{x:ve[0],y:ve[1]})):(Fe=setTimeout(function(){be||i(ce,["onetap","voneclick"],Y,{x:ve[0],y:ve[1]})},re.multiClickDebounceTime()),ye=Y.timeStamp)),ce!=null&&!t.dragData.didDrag&&ce._private.selectable&&ut"u"){var He=[],xe=function(Y){return{clientX:Y.clientX,clientY:Y.clientY,force:1,identifier:Y.pointerId,pageX:Y.pageX,pageY:Y.pageY,radiusX:Y.width/2,radiusY:Y.height/2,screenX:Y.screenX,screenY:Y.screenY,target:Y.target}},Ve=function(Y){return{event:Y,touch:xe(Y)}},Je=function(Y){He.push(Ve(Y))},nt=function(Y){for(var ce=0;ce0)return q[0]}return null},g=Object.keys(f),m=0;m0?p:XZ(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?th(i,a):l;var u=2*l;if(Fc(e,r,this.points,s,o,i,a-u,[0,-1],n)||Fc(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(ws(e,r,f)||Od(e,r,u,u,s+i/2-l,o+a/2-l,n)||Od(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},Gc.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Qa(3,0)),this.generateRoundPolygon("round-triangle",Qa(3,0)),this.generatePolygon("rectangle",Qa(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Qa(5,0)),this.generateRoundPolygon("round-pentagon",Qa(5,0)),this.generatePolygon("hexagon",Qa(6,0)),this.generateRoundPolygon("round-hexagon",Qa(6,0)),this.generatePolygon("heptagon",Qa(7,0)),this.generateRoundPolygon("round-heptagon",Qa(7,0)),this.generatePolygon("octagon",Qa(8,0)),this.generateRoundPolygon("round-octagon",Qa(8,0));var n=new Array(20);{var i=A8(5,0),a=A8(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*nI)break;var k=e.deq(n,y,m);if(k.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||v8;i.beforeRender(s,o(n))}}}},Bqe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w5;Yu(this,t),this.idsByKey=new Bc,this.keyForId=new Bc,this.cachesByLvl=new Bc,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Xu(t,[{key:"getIdsFor",value:function(r){r==null&&Xn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new S0,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Bc,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),Gee=25,u3=50,h3=-4,iI=3,qee=7.99,Fqe=8,zqe=1024,Gqe=1024,qqe=1024,Vqe=.2,Wqe=.8,Uqe=10,Hqe=.15,Yqe=.1,Xqe=.9,Kqe=.9,jqe=100,Zqe=1,Y0={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Qqe=ua({getKey:null,doesEleInvalidateKey:w5,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:OZ,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),cx=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=Qqe(r);yr(n,i),n.lookup=new Bqe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Fi=cx.prototype;Fi.reasons=Y0,Fi.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},Fi.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},Fi.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Wb(function(r,n){return n.reqs-r.reqs});return e},Fi.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},Fi.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(C8(o*r))),n=qee||n>iI)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Gee?g=Gee:h<=u3?g=u3:g=Math.ceil(h/u3)*u3,h>qqe||d>Gqe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;D--)L=a.getElement(t,e,r,D,Y0.downscale);O()}else return a.queueElement(t,S.level-1),S;else{var z;if(!b&&!w&&!k)for(var F=n-1;F>=h3;F--){var A=l.get(t,F);if(A){z=A;break}}if(x(z))return a.queueElement(t,n),z;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+Fqe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},Fi.invalidateElements=function(t){for(var e=0;e=Vqe*t.width&&this.retireTexture(t)},Fi.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Wqe&&t.fullnessChecks>=Uqe?Qu(r,t):t.fullnessChecks++},Fi.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Qu(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,b8(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Qu(i,s),n.push(s),s}},Fi.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},Fi.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Y0.dequeue)}return i},Fi.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=y8,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},Fi.onDequeue=function(t){this.onDequeues.push(t)},Fi.offDequeue=function(t){Qu(this.onDequeues,t)},Fi.setupDequeueing=zee.setupDequeueing({deqRedrawThreshold:jqe,deqCost:Hqe,deqAvgCost:Yqe,deqNoDrawCost:Xqe,deqFastCost:Kqe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=eVe||r>d3)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var O=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},D=function(R){if(!p)for(var N=r+R;ux<=N&&N<=d3&&!O(N);N+=R);};D(1),D(-1);for(var z=h.length-1;z>=0;z--){var F=h[z];F.invalid&&Qu(h,F)}};if(!f)g();else return h;var m=function(){if(!d){d=Za();for(var O=0;OWee||F>Wee)return null;var A=z*F;if(A>lVe)return null;var R=n.makeLayer(d,r);if(D!=null){var N=h.indexOf(D)+1;h.splice(N,0,R)}else(O.insert===void 0||O.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,x=t.length/Jqe,b=!o,w=0;w=x||!YZ(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)},fa.getEleLevelForLayerLevel=function(t,e){return t},fa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,cVe),a.setImgSmoothing(s,!0))},fa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},fa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},fa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Pc(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},fa.invalidateLayer=function(t){if(this.lastInvalidationTime=Pc(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Qu(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,x=u*h,b=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},k=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,R)},_=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var O=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,z=e.pstyle("ghost-opacity").value,F=v*z;t.translate(O,D),b(F),C(F),t.translate(-O,-D)}else w();S(),b(),C(),k(),_(),r&&t.translate(l.x1,l.y1)}};var jee=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};qc.drawEdgeOverlay=jee("overlay"),qc.drawEdgeUnderlay=jee("underlay"),qc.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},qd.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function xVe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Zee(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}qd.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=ja(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},qd.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=ja(s,"labelX",r),u=ja(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=ja(s,"labelWidth",r),m=ja(s,"labelHeight",r),y=ja(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(w="center",k="center"),l+=v,u+=x;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var C=P0(w),_=B0(k);switch(_){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,O=e.pstyle("text-border-opacity").value,D=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,F=e.pstyle("text-background-shape").strValue,A=F==="round-rectangle"||F==="roundrectangle",R=F==="circle",N=2;if(L>0||D>0&&O>0){var M=t.fillStyle,I=t.strokeStyle,$=t.lineWidth,P=e.pstyle("text-background-color").value,B=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value,V=L>0,X=D>0&&O>0,W=l-z;switch(C){case"left":W-=g;break;case"center":W-=g/2;break}var ie=u-m-z,K=g+2*z,se=m+2*z;if(V&&(t.fillStyle="rgba(".concat(P[0],",").concat(P[1],",").concat(P[2],",").concat(L*o,")")),X&&(t.strokeStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(O*o,")"),t.lineWidth=D,t.setLineDash))switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=D/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(A?(t.beginPath(),Zee(t,W,ie,K,se,N)):R?(t.beginPath(),xVe(t,W,ie,K,se)):(t.beginPath(),t.rect(W,ie,K,se)),V&&t.fill(),X&&t.stroke(),X&&q==="double"){var te=D/2;t.beginPath(),A?Zee(t,W+te,ie+te,K-2*te,se-2*te,N):t.rect(W+te,ie+te,K-2*te,se-2*te),t.stroke()}t.fillStyle=M,t.strokeStyle=I,t.lineWidth=$,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var ee=ja(s,"labelWrapCachedLines",r),ne=ja(s,"labelLineHeight",r),oe=g/2,fe=this.getLabelJustification(e);switch(fe==="auto"||(C==="left"?fe==="left"?l+=-g:fe==="center"&&(l+=-oe):C==="center"?fe==="left"?l+=-oe:fe==="right"&&(l+=oe):C==="right"&&(fe==="center"?l+=oe:fe==="right"&&(l+=g))),_){case"top":u-=(ee.length-1)*ne;break;case"center":case"bottom":u-=(ee.length-1)*ne;break}for(var Ae=0;Ae0&&t.strokeText(ee[Ae],l,u),t.fillText(ee[Ae],l,u),u+=ne}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var uh={};uh.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Gt(d.x)||!Gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),k=new Array(b.length),S=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(t,e,Y)},te=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;s.colorStrokeStyle(t,A[0],A[1],A[2],Y)},Z=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;s.colorStrokeStyle(t,V[0],V[1],V[2],Y)},ee=function(Y,ce,j,pe){var re=s.nodePathCache=s.nodePathCache||[],Pe=MZ(j==="polygon"?j+","+pe.join(","):j,""+ce,""+Y,""+K),ve=re[Pe],Ue,Me=!1;return ve!=null?(Ue=ve,Me=!0,h.pathCache=Ue):(Ue=new Path2D,re[Pe]=h.pathCache=Ue),{path:Ue,cacheHit:Me}},ne=e.pstyle("shape").strValue,oe=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var fe=ee(o,l,ne,oe);g=fe.path,m=fe.cacheHit}var Ae=function(){if(!m){var Y=d;p&&(Y={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,Y.x,Y.y,o,l,K,h)}p?t.fill(g):t.fill()},Re=function(){for(var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,pe=0,re=0;re0&&arguments[0]!==void 0?arguments[0]:!1,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ce),Y&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},Ce=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h),t.clip()),s.drawStripe(t,e,ce),t.restore(),Y&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},be=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ce=(D>0?D:-D)*Y,j=D>0?0:255;D!==0&&(s.colorFillStyle(t,j,j,j,ce),p?t.fill(g):t.fill())},Fe=function(){if(z>0){if(t.lineWidth=z,t.lineCap=M,t.lineJoin=N,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash($),t.lineDashOffset=P;break;case"solid":case"double":t.setLineDash([]);break}if(I!=="center"){if(t.save(),t.lineWidth*=2,I==="inside")p?t.clip(g):t.clip();else{var Y=new Path2D;Y.rect(-o/2-z,-l/2-z,o+2*z,l+2*z),Y.addPath(g),t.clip(Y,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=z/3;var ce=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ce}t.setLineDash&&t.setLineDash([])}},ye=function(){if(q>0){if(t.lineWidth=q,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Y=d;p&&(Y={x:0,y:0});var ce=s.getNodeShape(e),j=z;I==="inside"&&(j=0),I==="outside"&&(j*=2);var pe=(o+j+(q+ie))/o,re=(l+j+(q+ie))/l,Pe=o*pe,ve=l*re,Ue=s.nodeShapes[ce].points,Me;if(p){var qe=ee(Pe,ve,ce,Ue);Me=qe.path}if(ce==="ellipse")s.drawEllipsePath(Me||t,Y.x,Y.y,Pe,ve);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ce)){var Le=0,Ke=0,De=0;ce==="round-diamond"?Le=(j+ie+q)*1.4:ce==="round-heptagon"?(Le=(j+ie+q)*1.075,De=-(j/2+ie+q)/35):ce==="round-hexagon"?Le=(j+ie+q)*1.12:ce==="round-pentagon"?(Le=(j+ie+q)*1.13,De=-(j/2+ie+q)/15):ce==="round-tag"?(Le=(j+ie+q)*1.12,Ke=(j/2+q+ie)*.07):ce==="round-triangle"&&(Le=(j+ie+q)*(Math.PI/2),De=-(j+ie/2+q)/Math.PI),Le!==0&&(pe=(o+Le)/o,Pe=o*pe,["round-hexagon","round-tag"].includes(ce)||(re=(l+Le)/l,ve=l*re)),K=K==="auto"?jZ(Pe,ve):K;for(var it=Pe/2,Te=ve/2,ct=K+(j+q+ie)/2,we=new Array(Ue.length/2),Et=new Array(Ue.length/2),yt=0;yt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};uh.drawNodeOverlay=Qee("overlay"),uh.drawNodeUnderlay=Qee("underlay"),uh.hasPie=function(t){return t=t[0],t._private.hasPie},uh.hasStripe=function(t){return t=t[0],t._private.hasStripe},uh.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var S=2*Math.PI*w,C=k+S;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=w)}},uh.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,x=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],x),t.fill(),u+=b)}t.restore()};var Ja={},TVe=100;Ja.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Ja.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=s!==void 0?s:b,k=r.pan(),S={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},_=e.prevViewport,L=_===void 0||C.zoom!==_.zoom||C.pan.x!==_.pan.x||C.pan.y!==_.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var O=e.getCachedZSortedEles();function D(te,Z,ee,ne,oe){var fe=te.globalCompositeOperation;te.globalCompositeOperation="destination-out",e.colorFillStyle(te,255,255,255,e.motionBlurTransparency),te.fillRect(Z,ee,ne,oe),te.globalCompositeOperation=fe}function z(te,Z){var ee,ne,oe,fe;!e.clearingMotionBlur&&(te===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||te===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:k.x*p,y:k.y*p},ne=b*p,oe=e.canvasWidth*p,fe=e.canvasHeight*p):(ee=S,ne=w,oe=e.canvasWidth,fe=e.canvasHeight),te.setTransform(1,0,0,1,0,0),Z==="motionBlur"?D(te,0,0,oe,fe):!n&&(Z===void 0||Z)&&te.clearRect(0,0,oe,fe),i||(te.translate(ee.x,ee.y),te.scale(ne,ne)),o&&te.translate(o.x,o.y),s&&te.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var F=e.data.bufferContexts[e.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var A=u.contexts[e.NODE],R=e.textureCache.texture,C=e.textureCache.viewport;A.setTransform(1,0,0,1,0,0),f?D(A,0,0,C.width,C.height):A.clearRect(0,0,C.width,C.height);var N=x.core("outside-texture-bg-color").value,M=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(A,N[0],N[1],N[2],M),A.fillRect(0,0,C.width,C.height);var b=r.zoom();z(A,!1),A.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),A.drawImage(R,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var I=r.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),P=e.hideEdgesOnViewport&&$,B=[];if(B[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||B[e.NODE]){var q=f&&!B[e.NODE]&&p!==1,A=n||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!q?"motionBlur":void 0;z(A,V),P?e.drawCachedNodes(A,O.nondrag,l,I):e.drawLayeredElements(A,O.nondrag,l,I),e.debug&&e.drawDebugPoints(A,O.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||B[e.DRAG])){var q=f&&!B[e.DRAG]&&p!==1,A=n||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);z(A,f&&!q?"motionBlur":void 0),P?e.drawCachedNodes(A,O.drag,l,I):e.drawCachedElements(A,O.drag,l,I),e.debug&&e.drawDebugPoints(A,O.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,z),f&&p!==1){var X=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ie=u.contexts[e.DRAG],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],se=function(Z,ee,ne){Z.setTransform(1,0,0,1,0,0),ne||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(Z,0,0,e.canvasWidth,e.canvasHeight);var oe=p;Z.drawImage(ee,0,0,e.canvasWidth*oe,e.canvasHeight*oe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||B[e.NODE])&&(se(X,W,B[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||B[e.DRAG])&&(se(ie,K,B[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},TVe)),n||r.emit("render")};var hx;Ja.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!hx){var v=h.measureText(y);hx=v.actualBoundingBoxAscent}h.fillText(y,0,hx);var x=60;h.strokeRect(0,hx+10,250,20),h.fillRect(0,hx+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Jee(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function wVe(t,e,r){var n=Jee(t,t.VERTEX_SHADER,e),i=Jee(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function CVe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function oI(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function kVe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function EVe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function SVe(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function AVe(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function _Ve(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function RVe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function ete(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function tte(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function LVe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function IVe(t,e,r,n){var i=ete(t,e),a=Ei(i,2),s=a[0],o=a[1],l=tte(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Ol(t,e,r,n){var i=ete(t,r),a=Ei(i,3),s=a[0],o=a[1],l=a[2],u=tte(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var k=w.context,S=b.x,C=b.row,_=S,L=l*C;k.save(),k.translate(_,L),k.scale(h,h),i(k,n),k.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,S=d-k,C=l;{var _=a.freePointer.x,L=a.freePointer.row*l,O=k;w.context.drawImage(b,0,0,O,C,_,L,O,C),g[0]={x:_,y:L,w:O,h:f}}{var D=k,z=(a.freePointer.row+1)*l,F=S;w&&w.context.drawImage(b,D,0,F,C,0,z,F,C),g[1]={x:0,y:z,w:F,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=Ts(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=Ts(this.renderTypes.values()),v;try{var x=function(){var w=v.value,k=w.type;if(h(k)){var S=n.collections.get(w.collection),C=w.getKey(m),_=Array.isArray(C)?C:[C];if(s)_.forEach(function(z){return S.markKeyForGC(z)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),O=n._key(k,L),D=n.typeAndIdToKey.get(O);D!==void 0&&!AVe(_,D)&&(d=!0,n.typeAndIdToKey.delete(O),D.forEach(function(z){return S.markKeyForGC(z)}))}}};for(y.s();!(v=y.n()).done;)x()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Ts(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ei(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Ts(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ei(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),zVe=(function(){function t(e){Yu(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Xu(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),GVe=` + */var Lie=function(e,r){this.recycle(e,r)};function Zx(){return!1}function uE(){return!0}Lie.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Zx,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?uE:Zx):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=uE;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=uE;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=uE,this.stopPropagation()},isDefaultPrevented:Zx,isPropagationStopped:Zx,isImmediatePropagationStopped:Zx};var Iie=/^([^.]+)(\.(?:[^.]+))?$/,$Ye=".*",Mie={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Die=Object.keys(Mie),PYe={};function hE(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PYe,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},Vh.removeAllListeners=function(){return this.removeListener("*")},Vh.emit=Vh.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Wn(e)||(e=[e]),BYe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===$Ye)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&AVe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&vr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":ta(Symbol))!=e&&ta(Symbol.iterator)!=e;r&&(fE[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Hte({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(gn(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(vr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),rs.neighbourhood=rs.neighborhood,rs.closedNeighbourhood=rs.closedNeighborhood,rs.openNeighbourhood=rs.openNeighborhood,Sr(rs,{source:Po(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Po(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Vie({attr:"source"}),targets:Vie({attr:"target"})});function Vie(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),rs.componentsOf=rs.components;var Na=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){di("A collection must have a reference to the core");return}var a=new vu,s=!1;if(!r)r=[];else if(r.length>0&&gn(r[0])&&!Dx(r[0])){s=!0;for(var o=[],l=new yg,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var B=o.length===r.length?r:new Na(n,o),F=0;F0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(_){for(var R=_._private.edges,O=0;O0&&(t?I.emitAndNotify("remove"):e&&I.emit("remove"));for(var P=0;P0?P=_:I=_;while(Math.abs($)>s&&++R=a?T(M,R):O===0?R:w(M,I,I+u)}var k=!1;function S(){k=!0,(t!==e||r!==n)&&x()}var E=function(I){return k||S(),t===e&&r===n?I:I===0?0:I===1?1:y(C(I),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return L},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var jYe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Yn=function(e,r,n,i){var a=XYe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},yE={linear:function(e,r,n){return e+(r-e)*n},ease:Yn(.25,.1,.25,1),"ease-in":Yn(.42,0,1,1),"ease-out":Yn(0,0,.58,1),"ease-in-out":Yn(.42,0,.58,1),"ease-in-sine":Yn(.47,0,.745,.715),"ease-out-sine":Yn(.39,.575,.565,1),"ease-in-out-sine":Yn(.445,.05,.55,.95),"ease-in-quad":Yn(.55,.085,.68,.53),"ease-out-quad":Yn(.25,.46,.45,.94),"ease-in-out-quad":Yn(.455,.03,.515,.955),"ease-in-cubic":Yn(.55,.055,.675,.19),"ease-out-cubic":Yn(.215,.61,.355,1),"ease-in-out-cubic":Yn(.645,.045,.355,1),"ease-in-quart":Yn(.895,.03,.685,.22),"ease-out-quart":Yn(.165,.84,.44,1),"ease-in-out-quart":Yn(.77,0,.175,1),"ease-in-quint":Yn(.755,.05,.855,.06),"ease-out-quint":Yn(.23,1,.32,1),"ease-in-out-quint":Yn(.86,0,.07,1),"ease-in-expo":Yn(.95,.05,.795,.035),"ease-out-expo":Yn(.19,1,.22,1),"ease-in-out-expo":Yn(1,0,0,1),"ease-in-circ":Yn(.6,.04,.98,.335),"ease-out-circ":Yn(.075,.82,.165,1),"ease-in-out-circ":Yn(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return yE.linear;var i=jYe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Yn};function Yie(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function Xie(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Dg(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Xie(t,i),o=Xie(e,i);if(Vt(s)&&Vt(o))return Yie(a,s,o,r,n);if(Wn(s)&&Wn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=yE[p].apply(null,g)):s.easingImpl=yE[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var x={};Qx(v.x,T.x)&&(x.x=Dg(v.x,T.x,y,m)),Qx(v.y,T.y)&&(x.y=Dg(v.y,T.y,y,m)),t.position(x)}var w=s.startPan,C=s.pan,k=a.pan,S=C!=null&&n;S&&(Qx(w.x,C.x)&&(k.x=Dg(w.x,C.x,y,m)),Qx(w.y,C.y)&&(k.y=Dg(w.y,C.y,y,m)),t.emit("pan"));var E=s.startZoom,L=s.zoom,M=L!=null&&n;M&&(Qx(E,L)&&(a.zoom=Wx(a.minZoom,Dg(E,L,y,m),a.maxZoom)),t.emit("zoom")),(S||M)&&t.emit("viewport");var I=s.style;if(I&&I.length>0&&i){for(var P=0;P=0;S--){var E=k[S];E()}k.splice(0,k.length)},T=p.length-1;T>=0;T--){var x=p[T],w=x._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||ZYe(h,x,t),KYe(h,x,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),x.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var QYe={animate:Ln.animate(),animation:Ln.animation(),animated:Ln.animated(),clearQueue:Ln.clearQueue(),delay:Ln.delay(),delayAnimation:Ln.delayAnimation(),stop:Ln.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Gk(function(a){jie(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){jie(s,e)},n.beforeRenderPriorities.animations):r()}},JYe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Dx(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},vE=function(e){return vr(e)?new Fh(e):e},Kie={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new hE(JYe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,vE(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,vE(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,vE(r),n),this},once:function(e,r,n){return this.emitter().one(e,vE(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ln.eventAliasesOn(Kie);var TD={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};TD.jpeg=TD.jpg;var bE={layout:function(e){var r=this;if(e==null){di("Layout options must be specified to make a layout");return}if(e.name==null){di("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){di("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;vr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Sr({},e,{cy:r,eles:a}));return s}};bE.createLayout=bE.makeLayout=bE.layout;var eXe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};wD.invalidateDimensions=wD.resize;var xE={collection:function(e,r){return vr(e)?this.$(e):yo(e)?e.collection():Wn(e)?(r||(r={}),new Na(this,e,r.unique,r.removed)):new Na(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};xE.elements=xE.filter=xE.$;var va={},Jx="t",rXe="f";va.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var k=n.valueMin[0],S=n.valueMax[0],E=n.valueMin[1],L=n.valueMax[1],M=n.valueMin[2],I=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],$=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(k+(S-k)*w),Math.round(E+(L-E)*w),Math.round(M+(I-M)*w),Math.round(P+($-P)*w)];a={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var O=n.field.split("."),D=d.data,N=0;N0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(x):x()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},va.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},va.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},va.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},va.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},va.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},va.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var eT={};eT.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Rn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Fh(d);if(f.invalid){Rn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){Rn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],x=v[2],w=e.properties[T];if(!w){Rn("Skipping property: Invalid property name in: "+s),l();continue}var C=r.parse(T,x);if(!C){Rn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:x}),l()}if(g){o();break}r.selector(d);for(var k=0;k=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Rn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=e.split(/\s+/):Wn(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var w=[],C=[],k=[],S="",E=!1,L=0;L0?" ":"")+M.strValue}return u.validate&&!u.validate(w,C)?null:u.singleEnum&&E?w.length===1&&vr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:k,strValue:S,bypass:r,units:C}}var I=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?O.pfValue=e:O.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(O.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(O.pfValue=P==="rad"?e:QVe(e)),P==="%"&&(O.pfValue=e/100),O}else if(u.propList){var D=[],N=""+e;if(N!=="none"){for(var B=N.split(/\s*,\s*|\s+/),F=0;F0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Vt(e)?s=e:gn(e)&&(s=e.level,e.position!=null?a=Hk(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Vt(u.x)&&(r.pan.x=u.x,o=!1),Vt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(vr(e)){var n=e;e=this.mutableElements().filter(n)}else yo(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Ef.centre=Ef.center,Ef.autolockNodes=Ef.autolock,Ef.autoungrabifyNodes=Ef.autoungrabify;var tT={data:Ln.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ln.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ln.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ln.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};tT.attr=tT.data,tT.removeAttr=tT.removeData;var rT=function(e){var r=this;e=Sr({},e);var n=e.container;n&&!Pk(n)&&Pk(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=ra!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Sr({name:s?"grid":"null"},o.layout),o.renderer=Sr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Na(this),listeners:[],aniEles:new Na(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Vt(o.zoom)?o.zoom:1,pan:{x:gn(o.pan)&&Vt(o.pan.x)?o.pan.x:0,y:gn(o.pan)&&Vt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(Hqe);if(y)return Sg.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Sr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(gn(g)||Wn(g))&&r.add(g),r.one("layoutready",function(x){r.notifications(!0),r.emit(x),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=Sr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,mi(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=bs(o?t.boundingBox:structuredClone(e.extent())),u;if(yo(t.roots))u=t.roots;else if(Wn(t.roots)){for(var h=[],d=0;d0;){var _=$(),R=L(_,I);if(R)_.outgoers().filter(function(de){return de.isNode()&&r.has(de)}).forEach(P);else if(R===null){Rn("Detected double maximal shift for node `"+_.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Le/2:0),ce=2*Math.PI/v[$e].length*we;return $e===0&&v[0].length===1&&(Ye=1),{x:re.x+Ye*Math.cos(ce),y:re.y+Ye*Math.sin(ce)}}else{var ye=v[$e].length,ke=Math.max(ye===1?0:o?(l.w-t.padding*2-ge.w)/((t.grid?_e:ye)-1):(l.w-t.padding*2-ge.w)/((t.grid?_e:ye)+1),O),le={x:re.x+(we+1-(ye+1)/2)*ke,y:re.y+($e+1-(H+1)/2)*ae};return le}},qe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(qe).indexOf(t.direction)===-1&&di("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(qe).join(", ")));var ue=function(Ce){return TVe(Fe(Ce),l,qe[t.direction])};return r.nodes().layoutPositions(this,t,ue),this};var oXe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Jie(t){this.options=Sr({},oXe,t)}Jie.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=bs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(v*v+T*T));h=Math.max(x,h)}var w=function(k,S){var E=e.startAngle+S*u*(i?1:-1),L=h*Math.cos(E),M=h*Math.sin(E),I={x:o.x+L,y:o.y+M};return I};return n.nodes().layoutPositions(this,e,w),this};var lXe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function eae(t){this.options=Sr({},lXe,t)}eae.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=bs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var C=Math.abs(T[0].value-w.value);C>=y&&(T=[],v.push(T))}T.push(w)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-k,L=E/(v.length+S?1:0);k=Math.min(k,L)}for(var M=0,I=0;I1&&e.avoidOverlap){var R=Math.cos(_)-Math.cos(0),O=Math.sin(_)-Math.sin(0),D=Math.sqrt(k*k/(R*R+O*O));M=Math.max(D,M)}P.r=M,M+=k}if(e.equidistant){for(var N=0,B=0,F=0;F=t.numIter||(gXe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),Gk(h)}};h()}else{for(;u;)u=s(l),l++;aae(n,t),o()}return this},SE.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},SE.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var uXe=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=bs(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},tae=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=kE(e,o,l),y=kE(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,x=v*v+T*T,f=Math.sqrt(x),d=(e.nodeRepulsion+r.nodeRepulsion)/x,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},vXe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},kE=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},bXe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},TXe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},iae=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},SXe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function sae(t){this.options=Sr({},SXe,t)}sae.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=bs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(W){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(V){if(V==null)return Math.min(l,u);var H=Math.min(l,u);H==l?l=V:u=V},d=function(V){if(V==null)return Math.max(l,u);var H=Math.max(l,u);H==l?l=V:u=V},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,x=a.h/l;if(e.condense&&(T=0,x=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,_++)},D={},N=0;N(R=dUe(t,e,O[D],O[D+1],O[D+2],O[D+3])))return y(S,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var O=L.allpts,D=0;D+5(R=hUe(t,e,O[D],O[D+1],O[D+2],O[D+3],O[D+4],O[D+5])))return y(S,R),!0}for(var N=N||E.source,B=B||E.target,F=i.getArrowWidth(M,I),G=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],D=0;D0&&(v(N),v(B))}function x(S,E,L){return vs(S,E,L)}function w(S,E){var L=S._private,M=f,I;E?I=E+"-":I="",S.boundingBox();var P=L.labelBounds[E||"main"],$=S.pstyle(I+"label").value,_=S.pstyle("text-events").strValue==="yes";if(!(!_||!$)){var R=x(L.rscratch,"labelX",E),O=x(L.rscratch,"labelY",E),D=x(L.rscratch,"labelAngle",E),N=S.pstyle(I+"text-margin-x").pfValue,B=S.pstyle(I+"text-margin-y").pfValue,F=P.x1-M-N,G=P.x2+M-N,z=P.y1-M-B,W=P.y2+M-B;if(D){var V=Math.cos(D),H=Math.sin(D),te=function(ge,ae){return ge=ge-R,ae=ae-O,{x:ge*V-ae*H+R,y:ge*H+ae*V+O}},Y=te(F,z),se=te(F,W),J=te(G,z),Z=te(G,W),ee=[Y.x+N,Y.y+B,J.x+N,J.y+B,Z.x+N,Z.y+B,se.x+N,se.y+B];if(Hs(t,e,ee))return y(S),!0}else if(Oh(P,t,e))return y(S),!0}}for(var C=s.length-1;C>=0;C--){var k=s[C];k.isNode()?v(k)||w(k):T(k)||w(k)||w(k,"source")||w(k,"target")}return o},Af.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=bs({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ge,ae,_e){return vs(ge,ae,_e)}function y(ge,ae){var _e=ge._private,Fe=s,qe="";ge.boundingBox();var ue=_e.labelBounds.main;if(!ue)return null;var de=m(_e.rscratch,"labelX",ae),Ce=m(_e.rscratch,"labelY",ae),me=m(_e.rscratch,"labelAngle",ae),$e=ge.pstyle(qe+"text-margin-x").pfValue,we=ge.pstyle(qe+"text-margin-y").pfValue,Le=ue.x1-Fe-$e,Ye=ue.x2+Fe-$e,ce=ue.y1-Fe-we,ye=ue.y2+Fe-we;if(me){var ke=Math.cos(me),le=Math.sin(me),pe=function(oe,Q){return oe=oe-de,Q=Q-Ce,{x:oe*ke-Q*le+de,y:oe*le+Q*ke+Ce}};return[pe(Le,ce),pe(Ye,ce),pe(Ye,ye),pe(Le,ye)]}else return[{x:Le,y:ce},{x:Ye,y:ce},{x:Ye,y:ye},{x:Le,y:ye}]}function v(ge,ae,_e,Fe){function qe(ue,de,Ce){return(Ce.y-ue.y)*(de.x-ue.x)>(de.y-ue.y)*(Ce.x-ue.x)}return qe(ge,_e,Fe)!==qe(ae,_e,Fe)&&qe(ge,ae,_e)!==qe(ge,ae,Fe)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},LXe=function(e,r,n,i,a){if(e!==mae?yae(r,e,oc):RXe(Fo,oc),yae(r,n,Fo),dae=oc.nx*Fo.ny-oc.ny*Fo.nx,fae=oc.nx*Fo.nx-oc.ny*-Fo.ny,xu=Math.asin(Math.max(-1,Math.min(1,dae))),Math.abs(xu)<1e-6){_D=r.x,RD=r.y,Lf=Og=0;return}_f=1,AE=!1,fae<0?xu<0?xu=Math.PI+xu:(xu=Math.PI-xu,_f=-1,AE=!0):xu>0&&(_f=-1,AE=!0),r.radius!==void 0?Og=r.radius:Og=i,Rf=xu/2,_E=Math.min(oc.len/2,Fo.len/2),a?(lc=Math.abs(Math.cos(Rf)*Og/Math.sin(Rf)),lc>_E?(lc=_E,Lf=Math.abs(lc*Math.sin(Rf)/Math.cos(Rf))):Lf=Og):(lc=Math.min(_E,Og),Lf=Math.abs(lc*Math.sin(Rf)/Math.cos(Rf))),LD=r.x+Fo.nx*lc,ID=r.y+Fo.ny*lc,_D=LD-Fo.ny*Lf*_f,RD=ID+Fo.nx*Lf*_f,pae=r.x+oc.nx*lc,gae=r.y+oc.ny*lc,mae=r};function vae(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function MD(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(LXe(t,e,r,n,i),{cx:_D,cy:RD,radius:Lf,startX:pae,startY:gae,stopX:LD,stopY:ID,startAngle:oc.ang+Math.PI/2*_f,endAngle:Fo.ang-Math.PI/2*_f,counterClockwise:AE})}var nT=.01,IXe=Math.sqrt(2*nT),is={};is.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(C,k,S,E){var L=E-k,M=S-C,I=Math.sqrt(M*M+L*L);return{x:-L/I,y:M/I}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Hi(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Hi(m,2),v=y[0],T=y[1],x={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=x}else Rn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},is.findHaystackPoints=function(t){for(var e=0;e0?Math.max(Q-fe,0):Math.min(Q+fe,0)},$=P(M,E),_=P(I,L),R=!1;T===u?v=Math.abs($)>Math.abs(_)?i:n:T===l||T===o?(v=n,R=!0):(T===a||T===s)&&(v=i,R=!0);var O=v===n,D=O?_:$,N=O?I:M,B=tM(N),F=!1;!(R&&(w||k))&&(T===o&&N<0||T===l&&N>0||T===a&&N>0||T===s&&N<0)&&(B*=-1,D=B*Math.abs(D),F=!0);var G;if(w){var z=C<0?1+C:C;G=z*D}else{var W=C<0?D:0;G=W+C*B}var V=function(Q){return Math.abs(Q)=Math.abs(D)},H=V(G),te=V(Math.abs(D)-Math.abs(G)),Y=H||te;if(Y&&!F)if(O){var se=Math.abs(N)<=f/2,J=Math.abs(M)<=p/2;if(se){var Z=(h.x1+h.x2)/2,ee=h.y1,re=h.y2;r.segpts=[Z,ee,Z,re]}else if(J){var ge=(h.y1+h.y2)/2,ae=h.x1,_e=h.x2;r.segpts=[ae,ge,_e,ge]}else r.segpts=[h.x1,h.y2]}else{var Fe=Math.abs(N)<=d/2,qe=Math.abs(I)<=g/2;if(Fe){var ue=(h.y1+h.y2)/2,de=h.x1,Ce=h.x2;r.segpts=[de,ue,Ce,ue]}else if(qe){var me=(h.x1+h.x2)/2,$e=h.y1,we=h.y2;r.segpts=[me,$e,me,we]}else r.segpts=[h.x2,h.y1]}else if(O){var Le=h.y1+G+(y?f/2*B:0),Ye=h.x1,ce=h.x2;r.segpts=[Ye,Le,ce,Le]}else{var ye=h.x1+G+(y?d/2*B:0),ke=h.y1,le=h.y2;r.segpts=[ye,ke,ye,le]}if(r.isRound){var pe=t.pstyle("taxi-radius").value,U=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(pe),r.isArcRadius=new Array(r.segpts.length/2).fill(U)}},is.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Vt(r.startX)||!Vt(r.startY),y=!Vt(r.arrowStartX)||!Vt(r.arrowStartY),v=!Vt(r.endX)||!Vt(r.endY),T=!Vt(r.arrowEndX)||!Vt(r.arrowEndY),x=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=x*w,k=wf({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=kN.poolIndex()){var B=D;D=N,N=B}var F=$.srcPos=D.position(),G=$.tgtPos=N.position(),z=$.srcW=D.outerWidth(),W=$.srcH=D.outerHeight(),V=$.tgtW=N.outerWidth(),H=$.tgtH=N.outerHeight(),te=$.srcShape=r.nodeShapes[e.getNodeShape(D)],Y=$.tgtShape=r.nodeShapes[e.getNodeShape(N)],se=$.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,J=$.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Z=$.tgtRs=N._private.rscratch,ee=$.srcRs=D._private.rscratch;$.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re<$.eles.length;re++){var ge=$.eles[re],ae=ge[0]._private.rscratch,_e=ge.pstyle("curve-style").value,Fe=_e==="unbundled-bezier"||Mh(_e,"segments")||Mh(_e,"taxi"),qe=!D.same(ge.source());if(!$.calculatedIntersection&&D!==N&&($.hasBezier||$.hasUnbundled)){$.calculatedIntersection=!0;var ue=te.intersectLine(F.x,F.y,z,W,G.x,G.y,0,se,ee),de=$.srcIntn=ue,Ce=Y.intersectLine(G.x,G.y,V,H,F.x,F.y,0,J,Z),me=$.tgtIntn=Ce,$e=$.intersectionPts={x1:ue[0],x2:Ce[0],y1:ue[1],y2:Ce[1]},we=$.posPts={x1:F.x,x2:G.x,y1:F.y,y2:G.y},Le=Ce[1]-ue[1],Ye=Ce[0]-ue[0],ce=Math.sqrt(Ye*Ye+Le*Le);Vt(ce)&&ce>=IXe||(ce=Math.sqrt(Math.max(Ye*Ye,nT)+Math.max(Le*Le,nT)));var ye=$.vector={x:Ye,y:Le},ke=$.vectorNorm={x:ye.x/ce,y:ye.y/ce},le={x:-ke.y,y:ke.x};$.nodesOverlap=!Vt(ce)||Y.checkPoint(ue[0],ue[1],0,V,H,G.x,G.y,J,Z)||te.checkPoint(Ce[0],Ce[1],0,z,W,F.x,F.y,se,ee),$.vectorNormInverse=le,_={nodesOverlap:$.nodesOverlap,dirCounts:$.dirCounts,calculatedIntersection:!0,hasBezier:$.hasBezier,hasUnbundled:$.hasUnbundled,eles:$.eles,srcPos:G,srcRs:Z,tgtPos:F,tgtRs:ee,srcW:V,srcH:H,tgtW:z,tgtH:W,srcIntn:me,tgtIntn:de,srcShape:Y,tgtShape:te,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:$e.x2,y1:$e.y2,x2:$e.x1,y2:$e.y1},vector:{x:-ye.x,y:-ye.y},vectorNorm:{x:-ke.x,y:-ke.y},vectorNormInverse:{x:-le.x,y:-le.y}}}var pe=qe?_:$;ae.nodesOverlap=pe.nodesOverlap,ae.srcIntn=pe.srcIntn,ae.tgtIntn=pe.tgtIntn,ae.isRound=_e.startsWith("round"),i&&(D.isParent()||D.isChild()||N.isParent()||N.isChild())&&(D.parents().anySame(N)||N.parents().anySame(D)||D.same(N)&&D.isParent())?e.findCompoundLoopPoints(ge,pe,re,Fe):D===N?e.findLoopPoints(ge,pe,re,Fe):_e.endsWith("segments")?e.findSegmentsPoints(ge,pe):_e.endsWith("taxi")?e.findTaxiPoints(ge,pe):_e==="straight"||!Fe&&$.eles.length%2===1&&re===Math.floor($.eles.length/2)?e.findStraightEdgePoints(ge):e.findBezierPoints(ge,pe,re,Fe,qe),e.findEndpoints(ge),e.tryToCorrectInvalidPoints(ge,pe),e.checkForInvalidEdgeWarning(ge),e.storeAllpts(ge),e.storeEdgeProjections(ge),e.calculateArrowAngles(ge),e.recalculateEdgeLabelProjections(ge),e.calculateLabelAngles(ge)}},S=0;S0){var ue=u,de=Cf(ue,vg(s)),Ce=Cf(ue,vg(qe)),me=de;if(Ce2){var $e=Cf(ue,{x:qe[2],y:qe[3]});$e0){var j=h,Be=Cf(j,vg(s)),Se=Cf(j,vg(fe)),He=Be;if(Se2){var De=Cf(j,{x:fe[2],y:fe[3]});De=g||S){y={cp:w,segment:k};break}}if(y)break}var E=y.cp,L=y.segment,M=(g-v)/L.length,I=L.t1-L.t0,P=p?L.t0+I*M:L.t1-I*M;P=Wx(0,P,1),e=bg(E.p0,E.p1,E.p2,P),f=DXe(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var $=0,_,R,O,D,N=n.allpts.length,B=0;B+3=g));B+=2);var F=g-R,G=F/_;G=Wx(0,G,1),e=eUe(O,D,G),f=Tae(O,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},cc.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},cc.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Tf(n,t._private.labelDimsKey);if(vs(r.rscratch,"prefixedLabelDimsKey",e)!==i){ac(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=vs(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;ac(r.rstyle,"labelWidth",e,f),ac(r.rscratch,"labelWidth",e,f),ac(r.rstyle,"labelHeight",e,p),ac(r.rscratch,"labelHeight",e,p),ac(r.rscratch,"labelLineHeight",e,d),ac(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},cc.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(W,V){return V?(ac(r.rscratch,W,e,V),V):vs(r.rscratch,W,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` +`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),k="",S=0,E=Us(C),L;try{for(E.s();!(L=E.n()).done;){var M=L.value,I=M[0],P=v.substring(S,M.index);S=M.index+I.length;var $=k.length===0?P:k+P+I,_=this.calculateLabelDimensions(t,$),R=_.width;R<=d?k+=P+I:(k&&g.push(k),k=P+I)}}catch(z){E.e(z)}finally{E.f()}k.match(/^[\s\u200b]+$/)||g.push(k)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,D="",N="…",B=!1;if(this.calculateLabelDimensions(t,i).widthO)break;D+=i[F],F===i.length-1&&(B=!0)}return B||(D+=N),D}return i},cc.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?xYe(r):"center":e},cc.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` +`),v=y.length,T=0,x=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Ct=a(U);pt&&(t.hoverData.tapholdCancelled=!0);var dt=function(){var Wt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Wt.length===0?(Wt.push(nt[0]),Wt.push(nt[1])):(Wt[0]+=nt[0],Wt[1]+=nt[1])};Q=!0,i(Ne,["mousemove","vmousemove","tapdrag"],U,{x:Se[0],y:Se[1]});var ve=function(Wt){return{originalEvent:U,type:Wt,position:{x:Se[0],y:Se[1]}}},_t=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||fe.emit(ve("boxstart")),We[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(pt){var gt=ve("cxtdrag");Pe?Pe.emit(gt):fe.emit(gt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ne!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ve("cxtdragout")),t.hoverData.cxtOver=Ne,Ne&&Ne.emit(ve("cxtdragover")))}}else if(t.hoverData.dragging){if(Q=!0,fe.panningEnabled()&&fe.userPanningEnabled()){var ft;if(t.hoverData.justStartedPan){var Et=t.hoverData.mdownPos;ft={x:(Se[0]-Et[0])*j,y:(Se[1]-Et[1])*j},t.hoverData.justStartedPan=!1}else ft={x:nt[0]*j,y:nt[1]*j};fe.panBy(ft),fe.emit(ve("dragpan")),t.hoverData.dragged=!0}Se=t.projectIntoViewport(U.clientX,U.clientY)}else if(We[4]==1&&(Pe==null||Pe.pannable())){if(pt){if(!t.hoverData.dragging&&fe.boxSelectionEnabled()&&(Ct||!fe.panningEnabled()||!fe.userPanningEnabled()))_t();else if(!t.hoverData.selecting&&fe.panningEnabled()&&fe.userPanningEnabled()){var Nr=s(Pe,t.hoverData.downs);Nr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,We[4]=0,t.data.bgActivePosistion=vg(He),t.redrawHint("select",!0),t.redraw())}Pe&&Pe.pannable()&&Pe.active()&&Pe.unactivate()}}else{if(Pe&&Pe.pannable()&&Pe.active()&&Pe.unactivate(),(!Pe||!Pe.grabbed())&&Ne!=Ze&&(Ze&&i(Ze,["mouseout","tapdragout"],U,{x:Se[0],y:Se[1]}),Ne&&i(Ne,["mouseover","tapdragover"],U,{x:Se[0],y:Se[1]}),t.hoverData.last=Ne),Pe)if(pt){if(fe.boxSelectionEnabled()&&Ct)Pe&&Pe.grabbed()&&(m(Ie),Pe.emit(ve("freeon")),Ie.emit(ve("free")),t.dragData.didDrag&&(Pe.emit(ve("dragfreeon")),Ie.emit(ve("dragfree")))),_t();else if(Pe&&Pe.grabbed()&&t.nodeIsDraggable(Pe)){var Ae=!t.dragData.didDrag;Ae&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ie,{inDragLayer:!0});var tt={x:0,y:0};if(Vt(nt[0])&&Vt(nt[1])&&(tt.x+=nt[0],tt.y+=nt[1],Ae)){var ct=t.hoverData.dragDelta;ct&&Vt(ct[0])&&Vt(ct[1])&&(tt.x+=ct[0],tt.y+=ct[1])}t.hoverData.draggingEles=!0,Ie.silentShift(tt).emit(ve("position")).emit(ve("drag")),t.redrawHint("drag",!0),t.redraw()}}else dt();Q=!0}if(We[2]=Se[0],We[3]=Se[1],Q)return U.stopPropagation&&U.stopPropagation(),U.preventDefault&&U.preventDefault(),!1}},!1);var M,I,P;t.registerBinding(e,"mouseup",function(U){if(!(t.hoverData.which===1&&U.which!==1&&t.hoverData.capture)){var oe=t.hoverData.capture;if(oe){t.hoverData.capture=!1;var Q=t.cy,fe=t.projectIntoViewport(U.clientX,U.clientY),j=t.selection,Be=t.findNearestElement(fe[0],fe[1],!0,!1),Se=t.dragData.possibleDragElements,He=t.hoverData.down,De=a(U);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,He&&He.unactivate();var We=function(Re){return{originalEvent:U,type:Re,position:{x:fe[0],y:fe[1]}}};if(t.hoverData.which===3){var Ne=We("cxttapend");if(He?He.emit(Ne):Q.emit(Ne),!t.hoverData.cxtDragged){var Ze=We("cxttap");He?He.emit(Ze):Q.emit(Ze)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Be,["mouseup","tapend","vmouseup"],U,{x:fe[0],y:fe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(He,["click","tap","vclick"],U,{x:fe[0],y:fe[1]}),I=!1,U.timeStamp-P<=Q.multiClickDebounceTime()?(M&&clearTimeout(M),I=!0,P=null,i(He,["dblclick","dbltap","vdblclick"],U,{x:fe[0],y:fe[1]})):(M=setTimeout(function(){I||i(He,["oneclick","onetap","voneclick"],U,{x:fe[0],y:fe[1]})},Q.multiClickDebounceTime()),P=U.timeStamp)),He==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(U)&&(Q.$(r).unselect(["tapunselect"]),Se.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Se=Q.collection()),Be==He&&!t.dragData.didDrag&&!t.hoverData.selecting&&Be!=null&&Be._private.selectable&&(t.hoverData.dragging||(Q.selectionType()==="additive"||De?Be.selected()?Be.unselect(["tapunselect"]):Be.select(["tapselect"]):De||(Q.$(r).unmerge(Be).unselect(["tapunselect"]),Be.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Pe=Q.collection(t.getAllInBox(j[0],j[1],j[2],j[3]));t.redrawHint("select",!0),Pe.length>0&&t.redrawHint("eles",!0),Q.emit(We("boxend"));var nt=function(Re){return Re.selectable()&&!Re.selected()};Q.selectionType()==="additive"||De||Q.$(r).unmerge(Pe).unselect(),Pe.emit(We("box")).stdFilter(nt).select().emit(We("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!j[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ie=He&&He.grabbed();m(Se),Ie&&(He.emit(We("freeon")),Se.emit(We("free")),t.dragData.didDrag&&(He.emit(We("dragfreeon")),Se.emit(We("dragfree"))))}}j[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var $=[],_=4,R,O=1e5,D=function(U,oe){for(var Q=0;Q=_){var fe=$;if(R=D(fe,5),!R){var j=Math.abs(fe[0]);R=N(fe)&&j>5}if(R)for(var Be=0;Be5&&(Q=tM(Q)*5),Ze=Q/-250,R&&(Ze/=O,Ze*=3),Ze=Ze*t.wheelSensitivity;var Pe=U.deltaMode===1;Pe&&(Ze*=33);var nt=Se.zoom()*Math.pow(10,Ze);U.type==="gesturechange"&&(nt=t.gestureStartZoom*U.scale),Se.zoom({level:nt,renderedPosition:{x:Ne[0],y:Ne[1]}}),Se.emit({type:U.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:U,position:{x:We[0],y:We[1]}})}}}};t.registerBinding(t.container,"wheel",B,!0),t.registerBinding(e,"scroll",function(U){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(U){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||U.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(pe){t.hasTouchStarted||B(pe)},!0),t.registerBinding(t.container,"mouseout",function(U){var oe=t.projectIntoViewport(U.clientX,U.clientY);t.cy.emit({originalEvent:U,type:"mouseout",position:{x:oe[0],y:oe[1]}})},!1),t.registerBinding(t.container,"mouseover",function(U){var oe=t.projectIntoViewport(U.clientX,U.clientY);t.cy.emit({originalEvent:U,type:"mouseover",position:{x:oe[0],y:oe[1]}})},!1);var F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge=function(U,oe,Q,fe){return Math.sqrt((Q-U)*(Q-U)+(fe-oe)*(fe-oe))},ae=function(U,oe,Q,fe){return(Q-U)*(Q-U)+(fe-oe)*(fe-oe)},_e;t.registerBinding(t.container,"touchstart",_e=function(U){if(t.hasTouchStarted=!0,!!E(U)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var oe=t.cy,Q=t.touchData.now,fe=t.touchData.earlier;if(U.touches[0]){var j=t.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Q[0]=j[0],Q[1]=j[1]}if(U.touches[1]){var j=t.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Q[2]=j[0],Q[3]=j[1]}if(U.touches[2]){var j=t.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Q[4]=j[0],Q[5]=j[1]}var Be=function(Ct){return{originalEvent:U,type:Ct,position:{x:Q[0],y:Q[1]}}};if(U.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Se=t.findContainerClientCoords();se=Se[0],J=Se[1],Z=Se[2],ee=Se[3],F=U.touches[0].clientX-se,G=U.touches[0].clientY-J,z=U.touches[1].clientX-se,W=U.touches[1].clientY-J,re=0<=F&&F<=Z&&0<=z&&z<=Z&&0<=G&&G<=ee&&0<=W&&W<=ee;var He=oe.pan(),De=oe.zoom();V=ge(F,G,z,W),H=ae(F,G,z,W),te=[(F+z)/2,(G+W)/2],Y=[(te[0]-He.x)/De,(te[1]-He.y)/De];var We=200,Ne=We*We;if(H=1){for(var kt=t.touchData.startPosition=[null,null,null,null,null,null],bt=0;bt=t.touchTapThreshold2}if(oe&&t.touchData.cxt){U.preventDefault();var bt=U.touches[0].clientX-se,lt=U.touches[0].clientY-J,Nt=U.touches[1].clientX-se,Ct=U.touches[1].clientY-J,dt=ae(bt,lt,Nt,Ct),ve=dt/H,_t=150,gt=_t*_t,ft=1.5,Et=ft*ft;if(ve>=Et||dt>=gt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Nr=De("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Nr),t.touchData.start=null):fe.emit(Nr)}}if(oe&&t.touchData.cxt){var Nr=De("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Nr):fe.emit(Nr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Ae=t.findNearestElement(j[0],j[1],!0,!0);(!t.touchData.cxtOver||Ae!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(De("cxtdragout")),t.touchData.cxtOver=Ae,Ae&&Ae.emit(De("cxtdragover")))}else if(oe&&U.touches[2]&&fe.boxSelectionEnabled())U.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||fe.emit(De("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(j[0]+j[2]+j[4])/3,Q[1]=(j[1]+j[3]+j[5])/3,Q[2]=(j[0]+j[2]+j[4])/3+1,Q[3]=(j[1]+j[3]+j[5])/3+1):(Q[2]=(j[0]+j[2]+j[4])/3,Q[3]=(j[1]+j[3]+j[5])/3),t.redrawHint("select",!0),t.redraw();else if(oe&&U.touches[1]&&!t.touchData.didSelect&&fe.zoomingEnabled()&&fe.panningEnabled()&&fe.userZoomingEnabled()&&fe.userPanningEnabled()){U.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var tt=t.dragData.touchDragEles;if(tt){t.redrawHint("drag",!0);for(var ct=0;ct0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var qe;t.registerBinding(e,"touchcancel",qe=function(U){var oe=t.touchData.start;t.touchData.capture=!1,oe&&oe.unactivate()});var ue,de,Ce,me;if(t.registerBinding(e,"touchend",ue=function(U){var oe=t.touchData.start,Q=t.touchData.capture;if(Q)U.touches.length===0&&(t.touchData.capture=!1),U.preventDefault();else return;var fe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var j=t.cy,Be=j.zoom(),Se=t.touchData.now,He=t.touchData.earlier;if(U.touches[0]){var De=t.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Se[0]=De[0],Se[1]=De[1]}if(U.touches[1]){var De=t.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Se[2]=De[0],Se[3]=De[1]}if(U.touches[2]){var De=t.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Se[4]=De[0],Se[5]=De[1]}var We=function(gt){return{originalEvent:U,type:gt,position:{x:Se[0],y:Se[1]}}};oe&&oe.unactivate();var Ne;if(t.touchData.cxt){if(Ne=We("cxttapend"),oe?oe.emit(Ne):j.emit(Ne),!t.touchData.cxtDragged){var Ze=We("cxttap");oe?oe.emit(Ze):j.emit(Ze)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!U.touches[2]&&j.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Pe=j.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));fe[0]=void 0,fe[1]=void 0,fe[2]=void 0,fe[3]=void 0,fe[4]=0,t.redrawHint("select",!0),j.emit(We("boxend"));var nt=function(gt){return gt.selectable()&&!gt.selected()};Pe.emit(We("box")).stdFilter(nt).select().emit(We("boxselect")),Pe.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(oe!=null&&oe.unactivate(),U.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!U.touches[1]){if(!U.touches[0]){if(!U.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ie=t.dragData.touchDragEles;if(oe!=null){var pt=oe._private.grabbed;m(Ie),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt&&(oe.emit(We("freeon")),Ie.emit(We("free")),t.dragData.didDrag&&(oe.emit(We("dragfreeon")),Ie.emit(We("dragfree")))),i(oe,["touchend","tapend","vmouseup","tapdragout"],U,{x:Se[0],y:Se[1]}),oe.unactivate(),t.touchData.start=null}else{var Re=t.findNearestElement(Se[0],Se[1],!0,!0);i(Re,["touchend","tapend","vmouseup","tapdragout"],U,{x:Se[0],y:Se[1]})}var kt=t.touchData.startPosition[0]-Se[0],bt=kt*kt,lt=t.touchData.startPosition[1]-Se[1],Nt=lt*lt,Ct=bt+Nt,dt=Ct*Be*Be;t.touchData.singleTouchMoved||(oe||j.$(":selected").unselect(["tapunselect"]),i(oe,["tap","vclick"],U,{x:Se[0],y:Se[1]}),de=!1,U.timeStamp-me<=j.multiClickDebounceTime()?(Ce&&clearTimeout(Ce),de=!0,me=null,i(oe,["dbltap","vdblclick"],U,{x:Se[0],y:Se[1]})):(Ce=setTimeout(function(){de||i(oe,["onetap","voneclick"],U,{x:Se[0],y:Se[1]})},j.multiClickDebounceTime()),me=U.timeStamp)),oe!=null&&!t.dragData.didDrag&&oe._private.selectable&&dt"u"){var $e=[],we=function(U){return{clientX:U.clientX,clientY:U.clientY,force:1,identifier:U.pointerId,pageX:U.pageX,pageY:U.pageY,radiusX:U.width/2,radiusY:U.height/2,screenX:U.screenX,screenY:U.screenY,target:U.target}},Le=function(U){return{event:U,touch:we(U)}},Ye=function(U){$e.push(Le(U))},ce=function(U){for(var oe=0;oe<$e.length;oe++){var Q=$e[oe];if(Q.event.pointerId===U.pointerId){$e.splice(oe,1);return}}},ye=function(U){var oe=$e.filter(function(Q){return Q.event.pointerId===U.pointerId})[0];oe.event=U,oe.touch=we(U)},ke=function(U){U.touches=$e.map(function(oe){return oe.touch})},le=function(U){return U.pointerType==="mouse"||U.pointerType===4};t.registerBinding(t.container,"pointerdown",function(pe){le(pe)||(pe.preventDefault(),Ye(pe),ke(pe),_e(pe))}),t.registerBinding(t.container,"pointerup",function(pe){le(pe)||(ce(pe),ke(pe),ue(pe))}),t.registerBinding(t.container,"pointercancel",function(pe){le(pe)||(ce(pe),ke(pe),qe(pe))}),t.registerBinding(t.container,"pointermove",function(pe){le(pe)||(pe.preventDefault(),ye(pe),ke(pe),Fe(pe))})}};var Tu={};Tu.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,u,h){return Vx(o,l,this.points,n,i,a/2,s/2,u)},checkPoint:function(n,i,a,s,o,l,u,h){return bu(n,i,this.points,l,u,s,o,[0,-1],a)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,i,a,s,o,l){return sUe(this.points,n,i,a,s,o)}}},Tu.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){return pUe(a,s,e,r,n/2+o,i/2+o)},checkPoint:function(e,r,n,i,a,s,o,l){return Sf(e,r,i,a,s,o,n)}}},Tu.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,i,a,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?zre(a,s):o;for(var f=new Array(e.length/2),p=0;p0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:Bre(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?Ph(i,a):l;var u=2*l;if(bu(e,r,this.points,s,o,i,a-u,[0,-1],n)||bu(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Hs(e,r,f)||Sf(e,r,u,u,s+i/2-l,o+a/2-l,n)||Sf(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},Tu.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",xs(3,0)),this.generateRoundPolygon("round-triangle",xs(3,0)),this.generatePolygon("rectangle",xs(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",xs(5,0)),this.generateRoundPolygon("round-pentagon",xs(5,0)),this.generatePolygon("hexagon",xs(6,0)),this.generateRoundPolygon("round-hexagon",xs(6,0)),this.generatePolygon("heptagon",xs(7,0)),this.generateRoundPolygon("round-heptagon",xs(7,0)),this.generatePolygon("octagon",xs(8,0)),this.generateRoundPolygon("round-octagon",xs(8,0));var n=new Array(20);{var i=iM(5,0),a=iM(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*ND)break;var C=e.deq(n,y,m);if(C.length>0)for(var k=0;k0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||jI;i.beforeRender(s,o(n))}}}},PXe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qk;Rh(this,t),this.idsByKey=new vu,this.keyForId=new vu,this.cachesByLvl=new vu,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Lh(t,[{key:"getIdsFor",value:function(r){r==null&&di("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new yg,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new vu,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),Iae=25,IE=50,ME=-4,OD=3,Mae=7.99,BXe=8,FXe=1024,zXe=1024,GXe=1024,WXe=.2,qXe=.8,VXe=10,UXe=.15,HXe=.1,YXe=.9,XXe=.9,jXe=100,KXe=1,Bg={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ZXe=Ma({getKey:null,doesEleInvalidateKey:qk,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:kre,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),sT=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=ZXe(r);Sr(n,i),n.lookup=new PXe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ia=sT.prototype;ia.reasons=Bg,ia.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ia.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ia.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Gx(function(r,n){return n.reqs-r.reqs});return e},ia.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ia.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(eM(o*r))),n=Mae||n>OD)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Iae?g=Iae:h<=IE?g=IE:g=Math.ceil(h/IE)*IE,h>GXe||d>zXe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;I--)L=a.getElement(t,e,r,I,Bg.downscale);M()}else return a.queueElement(t,k.level-1),k;else{var P;if(!x&&!w&&!C)for(var $=n-1;$>=ME;$--){var _=l.get(t,$);if(_){P=_;break}}if(T(P))return a.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+BXe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},ia.invalidateElements=function(t){for(var e=0;e=WXe*t.width&&this.retireTexture(t)},ia.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>qXe&&t.fullnessChecks>=VXe?Nh(r,t):t.fullnessChecks++},ia.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Nh(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,KI(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Nh(i,s),n.push(s),s}},ia.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},ia.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Bg.dequeue)}return i},ia.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=XI,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},ia.onDequeue=function(t){this.onDequeues.push(t)},ia.offDequeue=function(t){Nh(this.onDequeues,t)},ia.setupDequeueing=Lae.setupDequeueing({deqRedrawThreshold:jXe,deqCost:UXe,deqAvgCost:HXe,deqNoDrawCost:YXe,deqFastCost:XXe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=JXe||r>DE)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var M=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},I=function(R){if(!p)for(var O=r+R;oT<=O&&O<=DE&&!M(O);O+=R);};I(1),I(-1);for(var P=h.length-1;P>=0;P--){var $=h[P];$.invalid&&Nh(h,$)}};if(!f)g();else return h;var m=function(){if(!d){d=bs();for(var M=0;MNae||$>Nae)return null;var _=P*$;if(_>oje)return null;var R=n.makeLayer(d,r);if(I!=null){var O=h.indexOf(I)+1;h.splice(O,0,R)}else(M.insert===void 0||M.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,T=t.length/QXe,x=!o,w=0;w=T||!Pre(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||x?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),S[r]=v}return p||(x?null:h)},Oa.getEleLevelForLayerLevel=function(t,e){return t},Oa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,lje),a.setImgSmoothing(s,!0))},Oa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},Oa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},Oa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=yu(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},Oa.invalidateLayer=function(t){if(this.lastInvalidationTime=yu(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Nh(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,x=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(t,e)},k=function(){i&&s.drawEdgeUnderlay(t,e)},S=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,R)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var M=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,$=v*P;t.translate(M,I),x($),S($),t.translate(-M,-I)}else w();k(),x(),S(),C(),E(),r&&t.translate(l.x1,l.y1)}};var zae=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};wu.drawEdgeOverlay=zae("overlay"),wu.drawEdgeUnderlay=zae("underlay"),wu.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},If.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function bje(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Gae(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}If.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=vs(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},If.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=vs(s,"labelX",r),u=vs(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=vs(s,"labelWidth",r),m=vs(s,"labelHeight",r),y=vs(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,x=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;x&&(w="center",C="center"),l+=v,u+=T;var k;n?k=this.getTextAngle(e,r):k=0,k!==0&&(h=l,d=u,t.translate(h,d),t.rotate(k),l=0,u=0);var S=_g(w),E=Rg(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,M=e.pstyle("text-border-opacity").value,I=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,$=e.pstyle("text-background-shape").strValue,_=$==="round-rectangle"||$==="roundrectangle",R=$==="circle",O=2;if(L>0||I>0&&M>0){var D=t.fillStyle,N=t.strokeStyle,B=t.lineWidth,F=e.pstyle("text-background-color").value,G=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value,W=L>0,V=I>0&&M>0,H=l-P;switch(S){case"left":H-=g;break;case"center":H-=g/2;break}var te=u-m-P,Y=g+2*P,se=m+2*P;if(W&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(L*o,")")),V&&(t.strokeStyle="rgba(".concat(G[0],",").concat(G[1],",").concat(G[2],",").concat(M*o,")"),t.lineWidth=I,t.setLineDash))switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=I/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(_?(t.beginPath(),Gae(t,H,te,Y,se,O)):R?(t.beginPath(),bje(t,H,te,Y,se)):(t.beginPath(),t.rect(H,te,Y,se)),W&&t.fill(),V&&t.stroke(),V&&z==="double"){var J=I/2;t.beginPath(),_?Gae(t,H+J,te+J,Y-2*J,se-2*J,O):t.rect(H+J,te+J,Y-2*J,se-2*J),t.stroke()}t.fillStyle=D,t.strokeStyle=N,t.lineWidth=B,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var ee=vs(s,"labelWrapCachedLines",r),re=vs(s,"labelLineHeight",r),ge=g/2,ae=this.getLabelJustification(e);switch(ae==="auto"||(S==="left"?ae==="left"?l+=-g:ae==="center"&&(l+=-ge):S==="center"?ae==="left"?l+=-ge:ae==="right"&&(l+=ge):S==="right"&&(ae==="center"?l+=ge:ae==="right"&&(l+=g))),E){case"top":u-=(ee.length-1)*re;break;case"center":case"bottom":u-=(ee.length-1)*re;break}for(var _e=0;_e0&&t.strokeText(ee[_e],l,u),t.fillText(ee[_e],l,u),u+=re}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);k!==0&&(t.rotate(-k),t.translate(-h,-d))}}};var Hh={};Hh.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Vt(d.x)||!Vt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),x=T.value,w=new Array(x.length),C=new Array(x.length),k=0,S=0;S0&&arguments[0]!==void 0?arguments[0]:$;s.eleFillStyle(t,e,U)},J=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,_[0],_[1],_[2],U)},Z=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;s.colorStrokeStyle(t,W[0],W[1],W[2],U)},ee=function(U,oe,Q,fe){var j=s.nodePathCache=s.nodePathCache||[],Be=Cre(Q==="polygon"?Q+","+fe.join(","):Q,""+oe,""+U,""+Y),Se=j[Be],He,De=!1;return Se!=null?(He=Se,De=!0,h.pathCache=He):(He=new Path2D,j[Be]=h.pathCache=He),{path:He,cacheHit:De}},re=e.pstyle("shape").strValue,ge=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ae=ee(o,l,re,ge);g=ae.path,m=ae.cacheHit}var _e=function(){if(!m){var U=d;p&&(U={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,U.x,U.y,o,l,Y,h)}p?t.fill(g):t.fill()},Fe=function(){for(var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Q=u.backgrounding,fe=0,j=0;j0&&arguments[0]!==void 0?arguments[0]:!1,oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,oe),U&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},ue=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,oe),t.restore(),U&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},de=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,oe=(I>0?I:-I)*U,Q=I>0?0:255;I!==0&&(s.colorFillStyle(t,Q,Q,Q,oe),p?t.fill(g):t.fill())},Ce=function(){if(P>0){if(t.lineWidth=P,t.lineCap=D,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var U=new Path2D;U.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),U.addPath(g),t.clip(U,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=P/3;var oe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=oe}t.setLineDash&&t.setLineDash([])}},me=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(V){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var U=d;p&&(U={x:0,y:0});var oe=s.getNodeShape(e),Q=P;N==="inside"&&(Q=0),N==="outside"&&(Q*=2);var fe=(o+Q+(z+te))/o,j=(l+Q+(z+te))/l,Be=o*fe,Se=l*j,He=s.nodeShapes[oe].points,De;if(p){var We=ee(Be,Se,oe,He);De=We.path}if(oe==="ellipse")s.drawEllipsePath(De||t,U.x,U.y,Be,Se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(oe)){var Ne=0,Ze=0,Pe=0;oe==="round-diamond"?Ne=(Q+te+z)*1.4:oe==="round-heptagon"?(Ne=(Q+te+z)*1.075,Pe=-(Q/2+te+z)/35):oe==="round-hexagon"?Ne=(Q+te+z)*1.12:oe==="round-pentagon"?(Ne=(Q+te+z)*1.13,Pe=-(Q/2+te+z)/15):oe==="round-tag"?(Ne=(Q+te+z)*1.12,Ze=(Q/2+z+te)*.07):oe==="round-triangle"&&(Ne=(Q+te+z)*(Math.PI/2),Pe=-(Q+te/2+z)/Math.PI),Ne!==0&&(fe=(o+Ne)/o,Be=o*fe,["round-hexagon","round-tag"].includes(oe)||(j=(l+Ne)/l,Se=l*j)),Y=Y==="auto"?zre(Be,Se):Y;for(var nt=Be/2,Ie=Se/2,pt=Y+(Q+z+te)/2,Re=new Array(He.length/2),kt=new Array(He.length/2),bt=0;bt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};Hh.drawNodeOverlay=Wae("overlay"),Hh.drawNodeUnderlay=Wae("underlay"),Hh.hasPie=function(t){return t=t[0],t._private.hasPie},Hh.hasStripe=function(t){return t=t[0],t._private.hasStripe},Hh.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,x=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var k=2*Math.PI*w,S=C+k;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,S),t.arc(l,u,p,S,C,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],x),t.fill(),g+=w)}},Hh.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,x=y/100;x+u>1&&(x=1-u),!(y===0||u>=1||u+x>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=x)}t.restore()};var Ts={},xje=100;Ts.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Ts.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),x=r.zoom(),w=s!==void 0?s:x,C=r.pan(),k={x:C.x,y:C.y},S={zoom:x,pan:{x:C.x,y:C.y}},E=e.prevViewport,L=E===void 0||S.zoom!==E.zoom||S.pan.x!==E.pan.x||S.pan.y!==E.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(k=o),w*=l,k.x*=l,k.y*=l;var M=e.getCachedZSortedEles();function I(J,Z,ee,re,ge){var ae=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(Z,ee,re,ge),J.globalCompositeOperation=ae}function P(J,Z){var ee,re,ge,ae;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:C.x*p,y:C.y*p},re=x*p,ge=e.canvasWidth*p,ae=e.canvasHeight*p):(ee=k,re=w,ge=e.canvasWidth,ae=e.canvasHeight),J.setTransform(1,0,0,1,0,0),Z==="motionBlur"?I(J,0,0,ge,ae):!n&&(Z===void 0||Z)&&J.clearRect(0,0,ge,ae),i||(J.translate(ee.x,ee.y),J.scale(re,re)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var $=e.data.bufferContexts[e.TEXTURE_BUFFER];$.setTransform(1,0,0,1,0,0),$.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:$,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var _=u.contexts[e.NODE],R=e.textureCache.texture,S=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),f?I(_,0,0,S.width,S.height):_.clearRect(0,0,S.width,S.height);var O=T.core("outside-texture-bg-color").value,D=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,O[0],O[1],O[2],D),_.fillRect(0,0,S.width,S.height);var x=r.zoom();P(_,!1),_.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),_.drawImage(R,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&B,G=[];if(G[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,G[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),G[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,G[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||G[e.NODE]){var z=f&&!G[e.NODE]&&p!==1,_=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),W=f&&!z?"motionBlur":void 0;P(_,W),F?e.drawCachedNodes(_,M.nondrag,l,N):e.drawLayeredElements(_,M.nondrag,l,N),e.debug&&e.drawDebugPoints(_,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||G[e.DRAG])){var z=f&&!G[e.DRAG]&&p!==1,_=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(_,f&&!z?"motionBlur":void 0),F?e.drawCachedNodes(_,M.drag,l,N):e.drawCachedElements(_,M.drag,l,N),e.debug&&e.drawDebugPoints(_,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var V=u.contexts[e.NODE],H=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],te=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],se=function(Z,ee,re){Z.setTransform(1,0,0,1,0,0),re||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):I(Z,0,0,e.canvasWidth,e.canvasHeight);var ge=p;Z.drawImage(ee,0,0,e.canvasWidth*ge,e.canvasHeight*ge,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||G[e.NODE])&&(se(V,H,G[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||G[e.DRAG])&&(se(te,Y,G[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},xje)),n||r.emit("render")};var lT;Ts.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!lT){var v=h.measureText(y);lT=v.actualBoundingBoxAscent}h.fillText(y,0,lT);var T=60;h.strokeRect(0,lT+10,250,20),h.fillRect(0,lT+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function qae(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function Tje(t,e,r){var n=qae(t,t.VERTEX_SHADER,e),i=qae(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function wje(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function BD(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function Cje(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function Sje(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function kje(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function Eje(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function Aje(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function _je(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Vae(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function Uae(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Rje(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function Lje(t,e,r,n){var i=Vae(t,e),a=Hi(i,2),s=a[0],o=a[1],l=Uae(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function hc(t,e,r,n){var i=Vae(t,r),a=Hi(i,3),s=a[0],o=a[1],l=a[2],u=Uae(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(x,w){if(i&&w){var C=w.context,k=x.x,S=x.row,E=k,L=l*S;C.save(),C.translate(E,L),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var x=a.scratch,w=a.canvas;x.clear(),p({x:0,row:0},x);var C=s-a.freePointer.x,k=d-C,S=l;{var E=a.freePointer.x,L=a.freePointer.row*l,M=C;w.context.drawImage(x,0,0,M,S,E,L,M,S),g[0]={x:E,y:L,w:M,h:f}}{var I=C,P=(a.freePointer.row+1)*l,$=k;w&&w.context.drawImage(x,I,0,$,S,0,P,$,S),g[1]={x:0,y:P,w:$,h:f}}a.freePointer.x=k,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=Us(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=Us(this.renderTypes.values()),v;try{var T=function(){var w=v.value,C=w.type;if(h(C)){var k=n.collections.get(w.collection),S=w.getKey(m),E=Array.isArray(S)?S:[S];if(s)E.forEach(function(P){return k.markKeyForGC(P)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),M=n._key(C,L),I=n.typeAndIdToKey.get(M);I!==void 0&&!Eje(E,I)&&(d=!0,n.typeAndIdToKey.delete(M),I.forEach(function(P){return k.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(x){y.e(x)}finally{y.f()}}}}catch(x){p.e(x)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Us(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Hi(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Us(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Hi(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),Fje=(function(){function t(e){Rh(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Lh(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),zje=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,qVe=` +`,Gje=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } -`,VVe=` +`,Wje=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } -`,WVe=` +`,qje=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -616,7 +621,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,dx={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},p3={IGNORE:1,USE_BB:2},uI=0,ate=1,ste=2,hI=3,K0=4,g3=5,fx=6,px=7,UVe=(function(){function t(e,r,n){Yu(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=CVe,this.atlasManager=new FVe(e,n),this.batchManager=new zVe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(dx.SCREEN),this.pickingProgram=this._createShaderProgram(dx.PICKING),this.vao=this._createVAO()}return Xu(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,cT={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},OE={IGNORE:1,USE_BB:2},GD=0,jae=1,Kae=2,WD=3,zg=4,$E=5,uT=6,hT=7,Vje=(function(){function t(e,r,n){Rh(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=wje,this.atlasManager=new Bje(e,n),this.batchManager=new Fje(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(cT.SCREEN),this.pickingProgram=this._createShaderProgram(cT.PICKING),this.vao=this._createVAO()}return Lh(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; @@ -663,7 +668,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - if(aVertType == `.concat(uI,`) { + if(aVertType == `.concat(GD,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -681,8 +686,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(K0," || aVertType == ").concat(px,` - || aVertType == `).concat(g3," || aVertType == ").concat(fx,`) { // simple shapes + else if(aVertType == `).concat(zg," || aVertType == ").concat(hT,` + || aVertType == `).concat($E," || aVertType == ").concat(uT,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -697,7 +702,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(ate,`) { + else if(aVertType == `).concat(jae,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -712,7 +717,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } - else if(aVertType == `).concat(ste,`) { + else if(aVertType == `).concat(Kae,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -761,7 +766,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vColor = aColor; } - else if(aVertType == `).concat(hI,` && vid < 3) { + else if(aVertType == `).concat(WD,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -806,10 +811,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 outColor; - `).concat(GVe,` - `).concat(qVe,` - `).concat(VVe,` - `).concat(WVe,` + `).concat(zje,` + `).concat(Gje,` + `).concat(Wje,` + `).concat(qje,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -825,21 +830,21 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) } void main(void) { - if(vVertType == `).concat(uI,`) { + if(vVertType == `).concat(GD,`) { // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` } - else if(vVertType == `).concat(hI,`) { + else if(vVertType == `).concat(WD,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } - else if(vVertType == `).concat(K0,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + else if(vVertType == `).concat(zg,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat(K0," || vVertType == ").concat(px,` - || vVertType == `).concat(g3," || vVertType == ").concat(fx,`) { // use SDF + else if(vVertType == `).concat(zg," || vVertType == ").concat(hT,` + || vVertType == `).concat($E," || vVertType == ").concat(uT,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -850,11 +855,11 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance - if(vVertType == `).concat(K0,`) { + if(vVertType == `).concat(zg,`) { d = rectangleSD(p, b); - } else if(vVertType == `).concat(px,` && w == h) { + } else if(vVertType == `).concat(hT,` && w == h) { d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(px,`) { + } else if(vVertType == `).concat(hT,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); @@ -894,16 +899,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=wVe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:dx.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===p3.IGNORE)return;if(l==p3.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Ts(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,x=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(D){h.e(D)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;nte(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;f3(r,r,[h,d]),ite(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;f3(r,r,[s,o]),cI(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=K0;var o=this.indexBuffer.getView(s);X0(n,o);var l=this.colorBuffer.getView(s);Vd([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===g3||o===fx){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===fx&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);X0(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Vd(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);Vd(b,w,k);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var C=x/2;v[0]=C,v[1]=-C}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,_,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return K0;case"ellipse":return px;case"roundrectangle":case"round-rectangle":return g3;case"bottom-round-rectangle":return fx;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return th(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,x=this.transformBuffer.getMatrixView(v);nte(x),f3(x,x,[s,o]),cI(x,x,[y,y]),ite(x,x,l),this.vertTypeBuffer.getView(v)[0]=hI;var b=this.indexBuffer.getView(v);X0(n,b);var w=this.colorBuffer.getView(v);Vd(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=ate;var d=this.indexBuffer.getView(h);X0(n,d);var f=this.colorBuffer.getView(h);Vd(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?p3.USE_BB:p3.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:SVe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:dI(e.getLabelKey,null),getBoundingBox:fI(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:dI(e.getSourceLabelKey,"source"),getBoundingBox:fI(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:dI(e.getTargetLabelKey,"target"),getBoundingBox:fI(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=zb(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),YVe(r)};function HVe(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return hZ(r)}function lte(t,e){var r=t._private.rscratch;return ja(r,"labelWrapCachedLines",e)||[]}var dI=function(e,r){return function(n){var i=e(n),a=lte(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},fI=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=lte(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function YVe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>qee?(XVe(t),e.call(t,a)):(KVe(t),ute(t,a,dx.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return tWe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function XVe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function KVe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function jVe(t){var e=t.canvasWidth,r=t.canvasHeight,n=oI(t),i=n.pan,a=n.zoom,s=lI();f3(s,s,[i.x,i.y]),cI(s,s,[a,a]);var o=lI();OVe(o,e,r);var l=lI();return NVe(l,o,s),l}function cte(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=oI(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function ZVe(t,e){t.drawSelectionRectangle(e,function(r){return cte(t,r)})}function QVe(t){var e=t.data.contexts[t.NODE];e.save(),cte(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function JVe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(C)}return w}function tWe(t,e,r){var n=eWe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Ts(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function pI(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function ute(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&ZVe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=jVe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function rWe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":$i(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[Yee,Nl,qc,sI,qd,uh,Ja,ote,hh,gx,mte].forEach(function(t){yr(Br,t)});var aWe=[{name:"null",impl:bee},{name:"base",impl:Fee},{name:"canvas",impl:nWe}],sWe=[{type:"layout",extensions:Rqe},{type:"renderer",extensions:aWe}],vte={},bte={};function xte(t,e,r){var n=r,i=function(_){hn("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ax.prototype[e])return i(e);ax.prototype[e]=r}else if(t==="collection"){if(da.prototype[e])return i(e);da.prototype[e]=r}else if(t==="layout"){for(var a=function(_){this.options=_,r.call(this,_),jr(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){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 x=v.edges.slice(),b,w=x.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L,O=this.nodes,D=O.length,z=0;zk&&(v=k),xC&&(b=C),w<_&&(w=_)}var A=new d(v,b,x-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=A.x-L,this.right=A.x+A.width+L,this.top=A.y-L,this.bottom=A.y+A.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L=y.length,O=0;Ok&&(v=k),xC&&(b=C),w<_&&(w=_)}var z=new d(v,b,x-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,x=v.length,b=0;b=this.nodes.length){var D=0;x.forEach(function(z){z.owner==y&&D++}),D==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===I&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-M===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):M===I&&(f>h?(u[2]=S,u[3]=C,R=!0):(u[2]=D,u[3]=O,R=!0)),A&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),P=this.getCardinalDirection(M,I,2)):($=this.getCardinalDirection(-N,I,3),P=this.getCardinalDirection(-M,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),P=this.getCardinalDirection(-M,I,3)):($=this.getCardinalDirection(N,I,2),P=this.getCardinalDirection(M,I,4)),!A)switch($){case 1:q=m,B=h+-k/I,u[0]=B,u[1]=q;break;case 2:B=b,q=d+w*I,u[0]=B,u[1]=q;break;case 3:q=x,B=h+k/I,u[0]=B,u[1]=q;break;case 4:B=v,q=d+-w*I,u[0]=B,u[1]=q;break}if(!R)switch(P){case 1:X=C,V=f+-F/I,u[2]=V,u[3]=X;break;case 2:V=D,X=p+z*I,u[2]=V,u[3]=X;break;case 3:X=O,V=f+F/I,u[2]=V,u[3]=X;break;case 4:V=L,X=p+-z*I,u[2]=V,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,k=void 0,S=void 0,C=void 0,_=void 0,L=void 0,O=void 0,D=void 0;return k=g-f,C=d-p,L=p*f-d*g,S=x-y,_=m-v,O=v*y-m*x,D=k*_-S*C,D===0?null:(b=(C*O-_*L)/D,w=(S*L-k*O)/D,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var D=S.getNeighborsList();D.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&_.push(A),x.set(A,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.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),h.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},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(O){return _.has(O)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.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%f.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 C=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(D){return C.has(D)});this.graphManager.setAllNodesToApplyGravitation(_),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.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=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),_={},L=0;L1){var A;for(A=0;AO&&(O=Math.floor(F.y)),z=Math.floor(F.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-F.x/2,p.WORLD_CENTER_Y-F.y/2))},k.radialLayout=function(C,_,L){var O=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(_,null,0,359,0,O);var D=b.calculateBounds(C),z=new w;z.setDeviceOrgX(D.getMinX()),z.setDeviceOrgY(D.getMinY()),z.setWorldOrgX(L.x),z.setWorldOrgY(L.y);for(var F=0;F1;){var X=V[0];V.splice(0,1);var W=I.indexOf(X);W>=0&&I.splice(W,1),B--,$--}_!=null?q=(I.indexOf(V[0])+1)%B:q=0;for(var ie=Math.abs(O-L)/$,K=q;P!=$;K=++K%B){var se=I[K].getOtherEnd(C);if(se!=_){var te=(L+P*ie)%360,Z=(te+ie)%360;k.branchRadialLayout(se,C,te,Z,D+z,z),P++}}},k.maxDiagonalInTree=function(C){for(var _=v.MIN_VALUE,L=0;L_&&(_=D)}return _},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,_={};this.memberGroups={},this.idToDummyNode={};for(var L=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(_[A]=[]),_[A]=_[A].concat(z)}Object.keys(_).forEach(function(R){if(_[R].length>1){var N="DummyCompound_"+R;C.memberGroups[N]=_[R];var M=_[R][0].getParent(),I=new u(C.graphManager);I.id=N,I.paddingLeft=M.paddingLeft||0,I.paddingRight=M.paddingRight||0,I.paddingBottom=M.paddingBottom||0,I.paddingTop=M.paddingTop||0,C.idToDummyNode[N]=I;var $=C.getGraphManager().add(C.newGraph(),I),P=M.getChild();P.add(I);for(var B=0;B<_[R].length;B++){var q=_[R][B];P.remove(q),$.add(q)}}})},k.prototype.clearCompounds=function(){var C={},_={};this.performDFSOnCompounds();for(var L=0;L=0;C--){var _=this.compoundOrder[C],L=_.id,O=_.paddingLeft,D=_.paddingTop;this.adjustLocations(this.tiledMemberPack[L],_.rect.x,_.rect.y,O,D)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,_=this.tiledZeroDegreePack;Object.keys(_).forEach(function(L){var O=C.idToDummyNode[L],D=O.paddingLeft,z=O.paddingTop;C.adjustLocations(_[L],O.rect.x,O.rect.y,D,z)})},k.prototype.getToBeTiled=function(C){var _=C.id;if(this.toBeTiled[_]!=null)return this.toBeTiled[_];var L=C.getChild();if(L==null)return this.toBeTiled[_]=!1,!1;for(var O=L.getNodes(),D=0;D0)return this.toBeTiled[_]=!1,!1;if(z.getChild()==null){this.toBeTiled[z.id]=!1;continue}if(!this.getToBeTiled(z))return this.toBeTiled[_]=!1,!1}return this.toBeTiled[_]=!0,!0},k.prototype.getNodeDegree=function(C){C.id;for(var _=C.getEdges(),L=0,O=0;O<_.length;O++){var D=_[O];D.getSource().id!==D.getTarget().id&&(L=L+1)}return L},k.prototype.getNodeDegreeWithChildren=function(C){var _=this.getNodeDegree(C);if(C.getChild()==null)return _;for(var L=C.getChild().getNodes(),O=0;OR&&(R=M.rect.height)}L+=R+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,_){var L=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(O){var D=_[O];L.tiledMemberPack[O]=L.tileNodes(C[O],D.paddingLeft+D.paddingRight),D.rect.width=L.tiledMemberPack[O].width,D.rect.height=L.tiledMemberPack[O].height})},k.prototype.tileNodes=function(C,_){var L=d.TILING_PADDING_VERTICAL,O=d.TILING_PADDING_HORIZONTAL,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:_,verticalPadding:L,horizontalPadding:O};C.sort(function(A,R){return A.rect.width*A.rect.height>R.rect.width*R.rect.height?-1:A.rect.width*A.rect.height0&&(F+=C.horizontalPadding),C.rowWidth[L]=F,C.width0&&(A+=C.verticalPadding);var R=0;A>C.rowHeight[L]&&(R=C.rowHeight[L],C.rowHeight[L]=A,R=C.rowHeight[L]-R),C.height+=R,C.rows[L].push(_)},k.prototype.getShortestRowIndex=function(C){for(var _=-1,L=Number.MAX_VALUE,O=0;OL&&(_=O,L=C.rowWidth[O]);return _},k.prototype.canAddHorizontal=function(C,_,L){var O=this.getShortestRowIndex(C);if(O<0)return!0;var D=C.rowWidth[O];if(D+C.horizontalPadding+_<=C.width)return!0;var z=0;C.rowHeight[O]0&&(z=L+C.verticalPadding-C.rowHeight[O]);var F;C.width-D>=_+C.horizontalPadding?F=(C.height+z)/(D+_+C.horizontalPadding):F=(C.height+z)/C.width,z=L+C.verticalPadding;var A;return C.width<_?A=(C.height+z)/_:A=(C.height+z)/C.width,A<1&&(A=1/A),F<1&&(F=1/F),Fz&&_!=L){O.splice(-1,1),C.rows[L].push(D),C.rowWidth[_]=C.rowWidth[_]-z,C.rowWidth[L]=C.rowWidth[L]+z,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var F=Number.MIN_VALUE,A=0;AF&&(F=O[A].height);_>0&&(F+=C.verticalPadding);var R=C.rowHeight[_]+C.rowHeight[L];C.rowHeight[_]=F,C.rowHeight[L]0)for(var P=D;P<=z;P++)$[0]+=this.grid[P][F-1].length+this.grid[P][F].length-1;if(z0)for(var P=F;P<=A;P++)$[3]+=this.grid[D-1][P].length+this.grid[D][P].length-1;for(var B=v.MAX_VALUE,q,V,X=0;X<$.length;X++)$[X]0){var A;A=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(A,_,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(y3)),y3.exports}var mWe=gWe();const yWe=Ns(mWe);$l.use(yWe);function Ete(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}T(Ete,"addNodes");function Ste(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}T(Ste,"addEdges");function Ate(t){return new Promise(e=>{const r=pt("body").append("div").attr("id","cy").attr("style","display:none"),n=$l({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),Ete(t.nodes,n),Ste(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ae.info("Cytoscape ready",a),e(n)})})}T(Ate,"createCytoscapeInstance");function _te(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}T(_te,"extractPositionedNodes");function Rte(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}T(Rte,"extractPositionedEdges");async function Lte(t,e){ae.debug("Starting cose-bilkent layout algorithm");try{Ite(t);const r=await Ate(t),n=_te(r),i=Rte(r);return ae.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ae.error("Error in cose-bilkent layout algorithm:",r),r}}T(Lte,"executeCoseBilkentLayout");function Ite(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}T(Ite,"validateLayoutData");var vWe=T(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=k.node().getBBox();w.width=S.width,w.height=S.height,w.domId=k,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},x=await Lte(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const w=t.edges.find(k=>k.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],k=h[b.end??""];if(w&&k){const S=x.edges.find(C=>C.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const C={...b},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}else{const C={...b,points:[{x:w.x||0,y:w.y||0},{x:k.x||0,y:k.y||0}]},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}}})),o.debug("Cose-bilkent rendering completed")},"render"),bWe=vWe;const xWe=Object.freeze(Object.defineProperty({__proto__:null,render:bWe},Symbol.toStringTag,{value:"Module"}));var x3=T((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),Dte=T((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};x3(t,r).lower()},"drawBackgroundRect"),TWe=T((t,e)=>{const r=e.text.replace(Sp," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),vI=T((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ud.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),bI=T((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ud.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Hs=T(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),xI=T(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Mte=T(()=>{let t=pt(".mermaidTooltip");return t.empty()&&(t=pt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),T3=(function(){var t=T(function(xe,Ve,Je,nt){for(Je=Je||{},nt=xe.length;nt--;Je[xe[nt]]=Ve);return Je},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],x=[1,34],b=[1,35],w=[1,36],k=[1,37],S=[1,38],C=[1,39],_=[1,40],L=[1,41],O=[1,42],D=[1,43],z=[1,44],F=[1,45],A=[1,46],R=[1,47],N=[1,48],M=[1,50],I=[1,51],$=[1,52],P=[1,53],B=[1,54],q=[1,55],V=[1,56],X=[1,57],W=[1,58],ie=[1,59],K=[1,60],se=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],ne=[1,83],oe=[1,84],fe=[1,85],Ae=[12,14,42],Re=[12,14,33,42],Ge=[12,14,33,42,76,77,79,80],Ce=[12,33],be=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Fe={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:T(function(Ve,Je,nt,tt,Ze,Ee,Se){var Y=Ee.length-1;switch(Ze){case 3:tt.setDirection("TB");break;case 4:tt.setDirection("BT");break;case 5:tt.setDirection("RL");break;case 6:tt.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:tt.setC4Type(Ee[Y-3]);break;case 19:tt.setTitle(Ee[Y].substring(6)),this.$=Ee[Y].substring(6);break;case 20:tt.setAccDescription(Ee[Y].substring(15)),this.$=Ee[Y].substring(15);break;case 21:this.$=Ee[Y].trim(),tt.setTitle(this.$);break;case 22:case 23:this.$=Ee[Y].trim(),tt.setAccDescription(this.$);break;case 28:Ee[Y].splice(2,0,"ENTERPRISE"),tt.addPersonOrSystemBoundary(...Ee[Y]),this.$=Ee[Y];break;case 29:Ee[Y].splice(2,0,"SYSTEM"),tt.addPersonOrSystemBoundary(...Ee[Y]),this.$=Ee[Y];break;case 30:tt.addPersonOrSystemBoundary(...Ee[Y]),this.$=Ee[Y];break;case 31:Ee[Y].splice(2,0,"CONTAINER"),tt.addContainerBoundary(...Ee[Y]),this.$=Ee[Y];break;case 32:tt.addDeploymentNode("node",...Ee[Y]),this.$=Ee[Y];break;case 33:tt.addDeploymentNode("nodeL",...Ee[Y]),this.$=Ee[Y];break;case 34:tt.addDeploymentNode("nodeR",...Ee[Y]),this.$=Ee[Y];break;case 35:tt.popBoundaryParseStack();break;case 39:tt.addPersonOrSystem("person",...Ee[Y]),this.$=Ee[Y];break;case 40:tt.addPersonOrSystem("external_person",...Ee[Y]),this.$=Ee[Y];break;case 41:tt.addPersonOrSystem("system",...Ee[Y]),this.$=Ee[Y];break;case 42:tt.addPersonOrSystem("system_db",...Ee[Y]),this.$=Ee[Y];break;case 43:tt.addPersonOrSystem("system_queue",...Ee[Y]),this.$=Ee[Y];break;case 44:tt.addPersonOrSystem("external_system",...Ee[Y]),this.$=Ee[Y];break;case 45:tt.addPersonOrSystem("external_system_db",...Ee[Y]),this.$=Ee[Y];break;case 46:tt.addPersonOrSystem("external_system_queue",...Ee[Y]),this.$=Ee[Y];break;case 47:tt.addContainer("container",...Ee[Y]),this.$=Ee[Y];break;case 48:tt.addContainer("container_db",...Ee[Y]),this.$=Ee[Y];break;case 49:tt.addContainer("container_queue",...Ee[Y]),this.$=Ee[Y];break;case 50:tt.addContainer("external_container",...Ee[Y]),this.$=Ee[Y];break;case 51:tt.addContainer("external_container_db",...Ee[Y]),this.$=Ee[Y];break;case 52:tt.addContainer("external_container_queue",...Ee[Y]),this.$=Ee[Y];break;case 53:tt.addComponent("component",...Ee[Y]),this.$=Ee[Y];break;case 54:tt.addComponent("component_db",...Ee[Y]),this.$=Ee[Y];break;case 55:tt.addComponent("component_queue",...Ee[Y]),this.$=Ee[Y];break;case 56:tt.addComponent("external_component",...Ee[Y]),this.$=Ee[Y];break;case 57:tt.addComponent("external_component_db",...Ee[Y]),this.$=Ee[Y];break;case 58:tt.addComponent("external_component_queue",...Ee[Y]),this.$=Ee[Y];break;case 60:tt.addRel("rel",...Ee[Y]),this.$=Ee[Y];break;case 61:tt.addRel("birel",...Ee[Y]),this.$=Ee[Y];break;case 62:tt.addRel("rel_u",...Ee[Y]),this.$=Ee[Y];break;case 63:tt.addRel("rel_d",...Ee[Y]),this.$=Ee[Y];break;case 64:tt.addRel("rel_l",...Ee[Y]),this.$=Ee[Y];break;case 65:tt.addRel("rel_r",...Ee[Y]),this.$=Ee[Y];break;case 66:tt.addRel("rel_b",...Ee[Y]),this.$=Ee[Y];break;case 67:Ee[Y].splice(0,1),tt.addRel("rel",...Ee[Y]),this.$=Ee[Y];break;case 68:tt.updateElStyle("update_el_style",...Ee[Y]),this.$=Ee[Y];break;case 69:tt.updateRelStyle("update_rel_style",...Ee[Y]),this.$=Ee[Y];break;case 70:tt.updateLayoutConfig("update_layout_config",...Ee[Y]),this.$=Ee[Y];break;case 71:this.$=[Ee[Y]];break;case 72:Ee[Y].unshift(Ee[Y-1]),this.$=Ee[Y];break;case 73:case 75:this.$=Ee[Y].trim();break;case 74:let ce={};ce[Ee[Y-1].trim()]=Ee[Y].trim(),this.$=ce;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{14:[1,74]},t(se,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K}),t(se,[2,14]),t(te,[2,16],{12:[1,76]}),t(se,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:ne,79:oe,80:fe},{35:86,75:81,76:ee,77:ne,79:oe,80:fe},{35:87,75:81,76:ee,77:ne,79:oe,80:fe},{35:88,75:81,76:ee,77:ne,79:oe,80:fe},{35:89,75:81,76:ee,77:ne,79:oe,80:fe},{35:90,75:81,76:ee,77:ne,79:oe,80:fe},{35:91,75:81,76:ee,77:ne,79:oe,80:fe},{35:92,75:81,76:ee,77:ne,79:oe,80:fe},{35:93,75:81,76:ee,77:ne,79:oe,80:fe},{35:94,75:81,76:ee,77:ne,79:oe,80:fe},{35:95,75:81,76:ee,77:ne,79:oe,80:fe},{35:96,75:81,76:ee,77:ne,79:oe,80:fe},{35:97,75:81,76:ee,77:ne,79:oe,80:fe},{35:98,75:81,76:ee,77:ne,79:oe,80:fe},{35:99,75:81,76:ee,77:ne,79:oe,80:fe},{35:100,75:81,76:ee,77:ne,79:oe,80:fe},{35:101,75:81,76:ee,77:ne,79:oe,80:fe},{35:102,75:81,76:ee,77:ne,79:oe,80:fe},{35:103,75:81,76:ee,77:ne,79:oe,80:fe},{35:104,75:81,76:ee,77:ne,79:oe,80:fe},t(Ae,[2,59]),{35:105,75:81,76:ee,77:ne,79:oe,80:fe},{35:106,75:81,76:ee,77:ne,79:oe,80:fe},{35:107,75:81,76:ee,77:ne,79:oe,80:fe},{35:108,75:81,76:ee,77:ne,79:oe,80:fe},{35:109,75:81,76:ee,77:ne,79:oe,80:fe},{35:110,75:81,76:ee,77:ne,79:oe,80:fe},{35:111,75:81,76:ee,77:ne,79:oe,80:fe},{35:112,75:81,76:ee,77:ne,79:oe,80:fe},{35:113,75:81,76:ee,77:ne,79:oe,80:fe},{35:114,75:81,76:ee,77:ne,79:oe,80:fe},{35:115,75:81,76:ee,77:ne,79:oe,80:fe},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:ne,79:oe,80:fe},{35:120,75:81,76:ee,77:ne,79:oe,80:fe},{35:121,75:81,76:ee,77:ne,79:oe,80:fe},{35:122,75:81,76:ee,77:ne,79:oe,80:fe},{35:123,75:81,76:ee,77:ne,79:oe,80:fe},{35:124,75:81,76:ee,77:ne,79:oe,80:fe},{35:125,75:81,76:ee,77:ne,79:oe,80:fe},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(se,[2,15]),t(te,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(se,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:D,59:z,60:F,61:A,62:R,63:N,64:M,65:I,66:$,67:P,68:B,69:q,70:V,71:X,72:W,73:ie,74:K}),t(Z,[2,21]),t(Z,[2,22]),t(Ae,[2,39]),t(Re,[2,71],{75:81,35:132,76:ee,77:ne,79:oe,80:fe}),t(Ge,[2,73]),{78:[1,133]},t(Ge,[2,75]),t(Ge,[2,76]),t(Ae,[2,40]),t(Ae,[2,41]),t(Ae,[2,42]),t(Ae,[2,43]),t(Ae,[2,44]),t(Ae,[2,45]),t(Ae,[2,46]),t(Ae,[2,47]),t(Ae,[2,48]),t(Ae,[2,49]),t(Ae,[2,50]),t(Ae,[2,51]),t(Ae,[2,52]),t(Ae,[2,53]),t(Ae,[2,54]),t(Ae,[2,55]),t(Ae,[2,56]),t(Ae,[2,57]),t(Ae,[2,58]),t(Ae,[2,60]),t(Ae,[2,61]),t(Ae,[2,62]),t(Ae,[2,63]),t(Ae,[2,64]),t(Ae,[2,65]),t(Ae,[2,66]),t(Ae,[2,67]),t(Ae,[2,68]),t(Ae,[2,69]),t(Ae,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Ce,[2,28]),t(Ce,[2,29]),t(Ce,[2,30]),t(Ce,[2,31]),t(Ce,[2,32]),t(Ce,[2,33]),t(Ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(se,[2,38]),t(Re,[2,72]),t(Ge,[2,74]),t(Ae,[2,24]),t(Ae,[2,35]),t(be,[2,25]),t(be,[2,26],{12:[1,138]}),t(be,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:T(function(Ve,Je){if(Je.recoverable)this.trace(Ve);else{var nt=new Error(Ve);throw nt.hash=Je,nt}},"parseError"),parse:T(function(Ve){var Je=this,nt=[0],tt=[],Ze=[null],Ee=[],Se=this.table,Y="",ce=0,j=0,pe=2,re=1,Pe=Ee.slice.call(arguments,1),ve=Object.create(this.lexer),Ue={yy:{}};for(var Me in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Me)&&(Ue.yy[Me]=this.yy[Me]);ve.setInput(Ve,Ue.yy),Ue.yy.lexer=ve,Ue.yy.parser=this,typeof ve.yylloc>"u"&&(ve.yylloc={});var qe=ve.yylloc;Ee.push(qe);var Le=ve.options&&ve.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(le){nt.length=nt.length-2*le,Ze.length=Ze.length-le,Ee.length=Ee.length-le}T(Ke,"popStack");function De(){var le;return le=tt.pop()||ve.lex()||re,typeof le!="number"&&(le instanceof Array&&(tt=le,le=tt.pop()),le=Je.symbols_[le]||le),le}T(De,"lex");for(var it,Te,ct,we,Et={},yt,ot,Dt,vt;;){if(Te=nt[nt.length-1],this.defaultActions[Te]?ct=this.defaultActions[Te]:((it===null||typeof it>"u")&&(it=De()),ct=Se[Te]&&Se[Te][it]),typeof ct>"u"||!ct.length||!ct[0]){var ut="";vt=[];for(yt in Se[Te])this.terminals_[yt]&&yt>pe&&vt.push("'"+this.terminals_[yt]+"'");ve.showPosition?ut="Parse error on line "+(ce+1)+`: -`+ve.showPosition()+` -Expecting `+vt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ut="Parse error on line "+(ce+1)+": Unexpected "+(it==re?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(ut,{text:ve.match,token:this.terminals_[it]||it,line:ve.yylineno,loc:qe,expected:vt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+it);switch(ct[0]){case 1:nt.push(it),Ze.push(ve.yytext),Ee.push(ve.yylloc),nt.push(ct[1]),it=null,j=ve.yyleng,Y=ve.yytext,ce=ve.yylineno,qe=ve.yylloc;break;case 2:if(ot=this.productions_[ct[1]][1],Et.$=Ze[Ze.length-ot],Et._$={first_line:Ee[Ee.length-(ot||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(ot||1)].first_column,last_column:Ee[Ee.length-1].last_column},Le&&(Et._$.range=[Ee[Ee.length-(ot||1)].range[0],Ee[Ee.length-1].range[1]]),we=this.performAction.apply(Et,[Y,j,ce,Ue.yy,ct[1],Ze,Ee].concat(Pe)),typeof we<"u")return we;ot&&(nt=nt.slice(0,-1*ot*2),Ze=Ze.slice(0,-1*ot),Ee=Ee.slice(0,-1*ot)),nt.push(this.productions_[ct[1]][0]),Ze.push(Et.$),Ee.push(Et._$),Dt=Se[nt[nt.length-2]][nt[nt.length-1]],nt.push(Dt);break;case 3:return!0}}return!0},"parse")},ye=(function(){var xe={EOF:1,parseError:T(function(Je,nt){if(this.yy.parser)this.yy.parser.parseError(Je,nt);else throw new Error(Je)},"parseError"),setInput:T(function(Ve,Je){return this.yy=Je||this.yy||{},this._input=Ve,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Ve=this._input[0];this.yytext+=Ve,this.yyleng++,this.offset++,this.match+=Ve,this.matched+=Ve;var Je=Ve.match(/(?:\r\n?|\n).*/g);return Je?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ve},"input"),unput:T(function(Ve){var Je=Ve.length,nt=Ve.split(/(?:\r\n?|\n)/g);this._input=Ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Je),this.offset-=Je;var tt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),nt.length-1&&(this.yylineno-=nt.length-1);var Ze=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:nt?(nt.length===tt.length?this.yylloc.first_column:0)+tt[tt.length-nt.length].length-nt[0].length:this.yylloc.first_column-Je},this.options.ranges&&(this.yylloc.range=[Ze[0],Ze[0]+this.yyleng-Je]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ve){this.unput(this.match.slice(Ve))},"less"),pastInput:T(function(){var Ve=this.matched.substr(0,this.matched.length-this.match.length);return(Ve.length>20?"...":"")+Ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ve=this.match;return Ve.length<20&&(Ve+=this._input.substr(0,20-Ve.length)),(Ve.substr(0,20)+(Ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ve=this.pastInput(),Je=new Array(Ve.length+1).join("-");return Ve+this.upcomingInput()+` -`+Je+"^"},"showPosition"),test_match:T(function(Ve,Je){var nt,tt,Ze;if(this.options.backtrack_lexer&&(Ze={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ze.yylloc.range=this.yylloc.range.slice(0))),tt=Ve[0].match(/(?:\r\n?|\n).*/g),tt&&(this.yylineno+=tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:tt?tt[tt.length-1].length-tt[tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ve[0].length},this.yytext+=Ve[0],this.match+=Ve[0],this.matches=Ve,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ve[0].length),this.matched+=Ve[0],nt=this.performAction.call(this,this.yy,this,Je,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),nt)return nt;if(this._backtrack){for(var Ee in Ze)this[Ee]=Ze[Ee];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ve,Je,nt,tt;this._more||(this.yytext="",this.match="");for(var Ze=this._currentRules(),Ee=0;EeJe[0].length)){if(Je=nt,tt=Ee,this.options.backtrack_lexer){if(Ve=this.test_match(nt,Ze[Ee]),Ve!==!1)return Ve;if(this._backtrack){Je=!1;continue}else return!1}else if(!this.options.flex)break}return Je?(Ve=this.test_match(Je,Ze[tt]),Ve!==!1?Ve:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Je=this.next();return Je||this.lex()},"lex"),begin:T(function(Je){this.conditionStack.push(Je)},"begin"),popState:T(function(){var Je=this.conditionStack.length-1;return Je>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Je){return Je=this.conditionStack.length-1-Math.abs(Je||0),Je>=0?this.conditionStack[Je]:"INITIAL"},"topState"),pushState:T(function(Je){this.begin(Je)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(Je,nt,tt,Ze){switch(tt){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return xe})();Fe.lexer=ye;function He(){this.yy={}}return T(He,"Parser"),He.prototype=Fe,Fe.Parser=He,new He})();T3.parser=T3;var wWe=T3,zo=[],dh=[""],es="global",Go="",Pl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],mx=[],TI="",wI=!1,w3=4,C3=2,Nte,CWe=T(function(){return Nte},"getC4Type"),kWe=T(function(t){Nte=qr(t,$e())},"setC4Type"),EWe=T(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=mx.find(d=>d.from===e&&d.to===r);if(h?u=h:mx.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=fh()},"addRel"),SWe=T(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=zo.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,zo.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=es,o.wrap=fh()},"addPersonOrSystem"),AWe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=fh(),l.typeC4Shape={text:t},l.parentBoundary=es},"addContainer"),_We=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=fh(),l.typeC4Shape={text:t},l.parentBoundary=es},"addComponent"),RWe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Pl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Pl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=es,a.wrap=fh(),Go=es,es=t,dh.push(Go)},"addPersonOrSystemBoundary"),LWe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Pl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Pl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=es,a.wrap=fh(),Go=es,es=t,dh.push(Go)},"addContainerBoundary"),IWe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Pl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Pl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=es,l.wrap=fh(),Go=es,es=e,dh.push(Go)},"addDeploymentNode"),DWe=T(function(){es=Go,dh.pop(),Go=dh.pop(),dh.push(Go)},"popBoundaryParseStack"),MWe=T(function(t,e,r,n,i,a,s,o,l,u,h){let d=zo.find(f=>f.alias===e);if(!(d===void 0&&(d=Pl.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),NWe=T(function(t,e,r,n,i,a,s){const o=mx.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),OWe=T(function(t,e,r){let n=w3,i=C3;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(w3=n),i>=1&&(C3=i)},"updateLayoutConfig"),$We=T(function(){return w3},"getC4ShapeInRow"),PWe=T(function(){return C3},"getC4BoundaryInRow"),BWe=T(function(){return es},"getCurrentBoundaryParse"),FWe=T(function(){return Go},"getParentBoundaryParse"),Ote=T(function(t){return t==null?zo:zo.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),zWe=T(function(t){return zo.find(e=>e.alias===t)},"getC4Shape"),GWe=T(function(t){return Object.keys(Ote(t))},"getC4ShapeKeys"),$te=T(function(t){return t==null?Pl:Pl.filter(e=>e.parentBoundary===t)},"getBoundaries"),qWe=$te,VWe=T(function(){return mx},"getRels"),WWe=T(function(){return TI},"getTitle"),UWe=T(function(t){wI=t},"setWrap"),fh=T(function(){return wI},"autoWrap"),HWe=T(function(){zo=[],Pl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Go="",es="global",dh=[""],mx=[],dh=[""],TI="",wI=!1,w3=4,C3=2},"clear"),YWe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},XWe={FILLED:0,OPEN:1},KWe={LEFTOF:0,RIGHTOF:1,OVER:2},jWe=T(function(t){TI=qr(t,$e())},"setTitle"),CI={addPersonOrSystem:SWe,addPersonOrSystemBoundary:RWe,addContainer:AWe,addContainerBoundary:LWe,addComponent:_We,addDeploymentNode:IWe,popBoundaryParseStack:DWe,addRel:EWe,updateElStyle:MWe,updateRelStyle:NWe,updateLayoutConfig:OWe,autoWrap:fh,setWrap:UWe,getC4ShapeArray:Ote,getC4Shape:zWe,getC4ShapeKeys:GWe,getBoundaries:$te,getBoundarys:qWe,getCurrentBoundaryParse:BWe,getParentBoundaryParse:FWe,getRels:VWe,getTitle:WWe,getC4Type:CWe,getC4ShapeInRow:$We,getC4BoundaryInRow:PWe,setAccTitle:Mn,getAccTitle:Gn,getAccDescription:Vn,setAccDescription:qn,getConfig:T(()=>$e().c4,"getConfig"),clear:HWe,LINETYPE:YWe,ARROWTYPE:XWe,PLACEMENT:KWe,setTitle:jWe,setC4Type:kWe},kI=T(function(t,e){return x3(t,e)},"drawRect"),Pte=T(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:ud.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),ZWe=T((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();Vc(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),Vc(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),QWe=T(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};kI(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,Vc(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,Vc(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,Vc(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),JWe=T(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Hs();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},kI(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=oUe(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":Pte(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,Vc(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?Vc(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&Vc(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,Vc(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),eUe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),tUe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),rUe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),nUe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),iUe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),aUe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),sUe=T(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),oUe=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Vc=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(It.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Bte)&&(r=this.nextData.startx+e.margin+ar.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},SI(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},T(Dm,"Bounds"),Dm),SI=T(function(t){li(ar,t),t.fontFamily&&(ar.personFontFamily=ar.systemFontFamily=ar.messageFontFamily=t.fontFamily),t.fontSize&&(ar.personFontSize=ar.systemFontSize=ar.messageFontSize=t.fontSize),t.fontWeight&&(ar.personFontWeight=ar.systemFontWeight=ar.messageFontWeight=t.fontWeight)},"setConf"),yx=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),S3=T(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),lUe=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function po(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=X2(e[t].text,i,n),e[t].textLines=e[t].text.split(It.lineBreakRegex).length,e[t].width=i,e[t].height=B4(e[t].text,n);else{let a=e[t].text.split(It.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(Va(o,n),e[t].width),s=B4(o,n),e[t].height=e[t].height+s}}T(po,"calcC4ShapeTextWH");var zte=T(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=ar.c4ShapeMargin-35;let n=e.wrap&&ar.wrap,i=S3(ar);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Va(e.label.text,i);po("label",e,n,i,a),Bl.drawBoundary(t,e,ar)},"drawBoundary"),Gte=T(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=yx(ar,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=Va("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=ar.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&ar.wrap,u=ar.width-ar.c4ShapePadding*2,h=yx(ar,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",po("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=yx(ar,s.typeC4Shape.text);po("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=yx(ar,s.techn.text);po("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=yx(ar,s.typeC4Shape.text);po("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+ar.c4ShapePadding,s.width=Math.max(s.width||ar.width,f,ar.width),s.height=Math.max(s.height||ar.height,d,ar.height),s.margin=s.margin||ar.c4ShapeMargin,t.insert(s),Bl.drawC4Shape(e,s,ar)}t.bumpLastMargin(ar.c4ShapeMargin)},"drawC4ShapeArray"),go=(Mm=class{constructor(e,r){this.x=e,this.y=r}},T(Mm,"Point"),Mm),qte=T(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new go(r,o):r==i&&na&&(f=new go(s,n)),r>i&&n=h?f=new go(r,o+h*t.width/2):f=new go(s-l/u*t.height/2,n+t.height):r=h?f=new go(r+t.width,o+h*t.width/2):f=new go(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new go(r+t.width,o-h*t.width/2):f=new go(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new go(r,o-t.width/2*h):f=new go(s-t.height/2*l/u,n)),f},"getIntersectPoint"),cUe=T(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=qte(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=qte(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),uUe=T(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&ar.wrap,l=lUe(ar);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=Va(s.label.text,l);po("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=Va(s.techn.text,l),po("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=Va(s.descr.text,l),po("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=cUe(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Bl.drawRels(t,e,ar,i)},"drawRels");function AI(t,e,r,n,i){let a=new Fte(i);a.data.widthLimit=r.data.widthLimit/Math.min(EI,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&ar.wrap,h=S3(ar);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",po("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=S3(ar);po("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=S3(ar);g.fontSize=g.fontSize-2,po("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%EI===0){let g=r.data.startx+ar.diagramMarginX,m=r.data.stopy+ar.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+ar.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&Gte(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&AI(t,e,a,p,i),o.alias!=="global"&&zte(t,o,a),r.data.stopy=Math.max(a.data.stopy+ar.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+ar.c4ShapeMargin,r.data.stopx),k3=Math.max(k3,r.data.stopx),E3=Math.max(E3,r.data.stopy)}}T(AI,"drawInsideBoundary");var hUe=T(function(t,e,r,n){ar=$e().c4;const i=$e().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(ar.wrap),Bte=o.getC4ShapeInRow(),EI=o.getC4BoundaryInRow(),ae.debug(`C:${JSON.stringify(ar,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):pt(`[id="${e}"]`);Bl.insertComputerIcon(l,e),Bl.insertDatabaseIcon(l,e),Bl.insertClockIcon(l,e);let u=new Fte(n);u.setData(ar.diagramMarginX,ar.diagramMarginX,ar.diagramMarginY,ar.diagramMarginY),u.data.widthLimit=screen.availWidth,k3=ar.diagramMarginX,E3=ar.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");AI(l,"",u,d,n),Bl.insertArrowHead(l,e),Bl.insertArrowEnd(l,e),Bl.insertArrowCrossHead(l,e),Bl.insertArrowFilledHead(l,e),uUe(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=k3,u.data.stopy=E3;const f=u.data;let g=f.stopy-f.starty+2*ar.diagramMarginY;const y=f.stopx-f.startx+2*ar.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*ar.diagramMarginX).attr("y",f.starty+ar.diagramMarginY),vi(l,g,y,ar.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-ar.diagramMarginX+" -"+(ar.diagramMarginY+v)+" "+y+" "+(g+v)),ae.debug("models:",f)},"draw"),Vte={drawPersonOrSystemArray:Gte,drawBoundary:zte,setConf:SI,draw:hUe},dUe=T(t=>`.person { + `),o=Tje(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:cT.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===OE.IGNORE)return;if(l==OE.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Us(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(I){h.e(I)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;Yae(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;NE(r,r,[h,d]),Xae(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;NE(r,r,[s,o]),zD(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=zg;var o=this.indexBuffer.getView(s);Fg(n,o);var l=this.colorBuffer.getView(s);Mf([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===$E||o===uT){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===uT&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Fg(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Mf(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var x=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Mf(x,w,C);var k=r.pstyle("border-position").value;if(k==="inside")v[0]=0,v[1]=-T;else if(k==="outside")v[0]=T,v[1]=0;else{var S=T/2;v[0]=S,v[1]=-S}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return zg;case"ellipse":return hT;case"roundrectangle":case"round-rectangle":return $E;case"bottom-round-rectangle":return uT;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return Ph(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);Yae(T),NE(T,T,[s,o]),zD(T,T,[y,y]),Xae(T,T,l),this.vertTypeBuffer.getView(v)[0]=WD;var x=this.indexBuffer.getView(v);Fg(n,x);var w=this.colorBuffer.getView(v);Mf(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=jae;var d=this.indexBuffer.getView(h);Fg(n,d);var f=this.colorBuffer.getView(h);Mf(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?OE.USE_BB:OE.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:kje,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:qD(e.getLabelKey,null),getBoundingBox:VD(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:qD(e.getSourceLabelKey,"source"),getBoundingBox:VD(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:qD(e.getTargetLabelKey,"target"),getBoundingBox:VD(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=Px(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Hje(r)};function Uje(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return tre(r)}function Qae(t,e){var r=t._private.rscratch;return vs(r,"labelWrapCachedLines",e)||[]}var qD=function(e,r){return function(n){var i=e(n),a=Qae(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},VD=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=Qae(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function Hje(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Mae?(Yje(t),e.call(t,a)):(Xje(t),ese(t,a,cT.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return eKe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function Yje(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Xje(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function jje(t){var e=t.canvasWidth,r=t.canvasHeight,n=BD(t),i=n.pan,a=n.zoom,s=FD();NE(s,s,[i.x,i.y]),zD(s,s,[a,a]);var o=FD();Nje(o,e,r);var l=FD();return Dje(l,o,s),l}function Jae(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=BD(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function Kje(t,e){t.drawSelectionRectangle(e,function(r){return Jae(t,r)})}function Zje(t){var e=t.data.contexts[t.NODE];e.save(),Jae(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Qje(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(S)}return w}function eKe(t,e,r){var n=Jje(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Us(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function UD(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function ese(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Kje(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=jje(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function tKe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":ta(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[Pae,uc,wu,PD,If,Hh,Ts,Zae,Yh,dT,sse].forEach(function(t){Sr(Zr,t)});var iKe=[{name:"null",impl:cae},{name:"base",impl:Rae},{name:"canvas",impl:rKe}],aKe=[{type:"layout",extensions:_Xe},{type:"renderer",extensions:iKe}],lse={},cse={};function use(t,e,r){var n=r,i=function(E){Rn("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(rT.prototype[e])return i(e);rT.prototype[e]=r}else if(t==="collection"){if(Na.prototype[e])return i(e);Na.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),gn(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var x=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){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 T=v.edges.slice(),x,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(S,1),x.target!=x.source&&x.target.edges.splice(E,1);var k=x.source.owner.getEdges().indexOf(x);if(k==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,x,w,C=this.getNodes(),k=C.length,S=0;ST&&(y=T),v>x&&(v=x)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,C,k,S,E,L,M=this.nodes,I=M.length,P=0;PC&&(v=C),TS&&(x=S),wC&&(v=C),TS&&(x=S),w=this.nodes.length){var I=0;T.forEach(function(P){P.owner==y&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,_=!0):(u[0]=y,u[1]=m,_=!0):O===N&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=x,u[1]=T,_=!0)),-D===N?f>h?(u[2]=L,u[3]=M,R=!0):(u[2]=E,u[3]=S,R=!0):D===N&&(f>h?(u[2]=k,u[3]=S,R=!0):(u[2]=I,u[3]=M,R=!0)),_&&R)return!1;if(h>f?d>p?(B=this.getCardinalDirection(O,N,4),F=this.getCardinalDirection(D,N,2)):(B=this.getCardinalDirection(-O,N,3),F=this.getCardinalDirection(-D,N,1)):d>p?(B=this.getCardinalDirection(-O,N,1),F=this.getCardinalDirection(-D,N,3)):(B=this.getCardinalDirection(O,N,2),F=this.getCardinalDirection(D,N,4)),!_)switch(B){case 1:z=m,G=h+-C/N,u[0]=G,u[1]=z;break;case 2:G=x,z=d+w*N,u[0]=G,u[1]=z;break;case 3:z=T,G=h+C/N,u[0]=G,u[1]=z;break;case 4:G=v,z=d+-w*N,u[0]=G,u[1]=z;break}if(!R)switch(F){case 1:V=S,W=f+-$/N,u[2]=W,u[3]=V;break;case 2:W=I,V=p+P*N,u[2]=W,u[3]=V;break;case 3:V=M,W=f+$/N,u[2]=W,u[3]=V;break;case 4:W=L,V=p+-P*N,u[2]=W,u[3]=V;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,x=void 0,w=void 0,C=void 0,k=void 0,S=void 0,E=void 0,L=void 0,M=void 0,I=void 0;return C=g-f,S=d-p,L=p*f-d*g,k=T-y,E=m-v,M=v*y-m*T,I=C*E-k*S,I===0?null:(x=(S*M-E*L)/I,w=(k*L-C*M)/I,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(S[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var L=E.getEdges(),x=0;x-1&&S.splice($,1)}w=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var T=this.edgeToDummyNodes.get(v),x=0;x=0&&y.splice(M,1);var I=k.getNeighborsList();I.forEach(function(_){if(v.indexOf(_)<0){var R=T.get(_),O=R-1;O==1&&E.push(_),T.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(x=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||C>=x[0].length)){for(var k=0;kd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.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),h.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},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.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%f.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()),E=this.nodesWithGravity.filter(function(I){return S.has(I)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.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=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),E={},L=0;L1){var _;for(_=0;_<$.length;_++){var R=$[_];R.getBendpoints().push(new m),this.createDummyNodesForBendpoints(R)}}$.forEach(function(O){E.add(O)})}}}if(E.size==S.length)break}},C.prototype.positionNodesRadially=function(S){for(var E=new g(0,0),L=Math.ceil(Math.sqrt(S.length)),M=0,I=0,P=0,$=new m(0,0),_=0;_M&&(M=Math.floor($.y)),P=Math.floor($.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-$.x/2,p.WORLD_CENTER_Y-$.y/2))},C.radialLayout=function(S,E,L){var M=Math.max(this.maxDiagonalInTree(S),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,M);var I=x.calculateBounds(S),P=new w;P.setDeviceOrgX(I.getMinX()),P.setDeviceOrgY(I.getMinY()),P.setWorldOrgX(L.x),P.setWorldOrgY(L.y);for(var $=0;$1;){var V=W[0];W.splice(0,1);var H=N.indexOf(V);H>=0&&N.splice(H,1),G--,B--}E!=null?z=(N.indexOf(W[0])+1)%G:z=0;for(var te=Math.abs(M-L)/B,Y=z;F!=B;Y=++Y%G){var se=N[Y].getOtherEnd(S);if(se!=E){var J=(L+F*te)%360,Z=(J+te)%360;C.branchRadialLayout(se,S,J,Z,I+P,P),F++}}},C.maxDiagonalInTree=function(S){for(var E=v.MIN_VALUE,L=0;LE&&(E=I)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var S=this,E={};this.memberGroups={},this.idToDummyNode={};for(var L=[],M=this.graphManager.getAllNodes(),I=0;I"u"&&(E[_]=[]),E[_]=E[_].concat(P)}Object.keys(E).forEach(function(R){if(E[R].length>1){var O="DummyCompound_"+R;S.memberGroups[O]=E[R];var D=E[R][0].getParent(),N=new u(S.graphManager);N.id=O,N.paddingLeft=D.paddingLeft||0,N.paddingRight=D.paddingRight||0,N.paddingBottom=D.paddingBottom||0,N.paddingTop=D.paddingTop||0,S.idToDummyNode[O]=N;var B=S.getGraphManager().add(S.newGraph(),N),F=D.getChild();F.add(N);for(var G=0;G=0;S--){var E=this.compoundOrder[S],L=E.id,M=E.paddingLeft,I=E.paddingTop;this.adjustLocations(this.tiledMemberPack[L],E.rect.x,E.rect.y,M,I)}},C.prototype.repopulateZeroDegreeMembers=function(){var S=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(L){var M=S.idToDummyNode[L],I=M.paddingLeft,P=M.paddingTop;S.adjustLocations(E[L],M.rect.x,M.rect.y,I,P)})},C.prototype.getToBeTiled=function(S){var E=S.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var L=S.getChild();if(L==null)return this.toBeTiled[E]=!1,!1;for(var M=L.getNodes(),I=0;I0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(S){S.id;for(var E=S.getEdges(),L=0,M=0;MR&&(R=D.rect.height)}L+=R+S.verticalPadding}},C.prototype.tileCompoundMembers=function(S,E){var L=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(M){var I=E[M];L.tiledMemberPack[M]=L.tileNodes(S[M],I.paddingLeft+I.paddingRight),I.rect.width=L.tiledMemberPack[M].width,I.rect.height=L.tiledMemberPack[M].height})},C.prototype.tileNodes=function(S,E){var L=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:L,horizontalPadding:M};S.sort(function(_,R){return _.rect.width*_.rect.height>R.rect.width*R.rect.height?-1:_.rect.width*_.rect.height0&&($+=S.horizontalPadding),S.rowWidth[L]=$,S.width<$&&(S.width=$);var _=E.rect.height;L>0&&(_+=S.verticalPadding);var R=0;_>S.rowHeight[L]&&(R=S.rowHeight[L],S.rowHeight[L]=_,R=S.rowHeight[L]-R),S.height+=R,S.rows[L].push(E)},C.prototype.getShortestRowIndex=function(S){for(var E=-1,L=Number.MAX_VALUE,M=0;ML&&(E=M,L=S.rowWidth[M]);return E},C.prototype.canAddHorizontal=function(S,E,L){var M=this.getShortestRowIndex(S);if(M<0)return!0;var I=S.rowWidth[M];if(I+S.horizontalPadding+E<=S.width)return!0;var P=0;S.rowHeight[M]0&&(P=L+S.verticalPadding-S.rowHeight[M]);var $;S.width-I>=E+S.horizontalPadding?$=(S.height+P)/(I+E+S.horizontalPadding):$=(S.height+P)/S.width,P=L+S.verticalPadding;var _;return S.widthP&&E!=L){M.splice(-1,1),S.rows[L].push(I),S.rowWidth[E]=S.rowWidth[E]-P,S.rowWidth[L]=S.rowWidth[L]+P,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var $=Number.MIN_VALUE,_=0;_$&&($=M[_].height);E>0&&($+=S.verticalPadding);var R=S.rowHeight[E]+S.rowHeight[L];S.rowHeight[E]=$,S.rowHeight[L]0)for(var F=I;F<=P;F++)B[0]+=this.grid[F][$-1].length+this.grid[F][$].length-1;if(P0)for(var F=$;F<=_;F++)B[3]+=this.grid[I-1][F].length+this.grid[I][F].length-1;for(var G=v.MAX_VALUE,z,W,V=0;V0){var _;_=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(_,E,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(x){x("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(BE)),BE.exports}var gKe=pKe();const mKe=kd(gKe);dc.use(mKe);function gse(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}b(gse,"addNodes");function mse(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}b(mse,"addEdges");function yse(t){return new Promise(e=>{const r=mt("body").append("div").attr("id","cy").attr("style","display:none"),n=dc({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),gse(t.nodes,n),mse(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{he.info("Cytoscape ready",a),e(n)})})}b(yse,"createCytoscapeInstance");function vse(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}b(vse,"extractPositionedNodes");function bse(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}b(bse,"extractPositionedEdges");async function xse(t,e){he.debug("Starting cose-bilkent layout algorithm");try{Tse(t);const r=await yse(t),n=vse(r),i=bse(r);return he.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw he.error("Error in cose-bilkent layout algorithm:",r),r}}b(xse,"executeCoseBilkentLayout");function Tse(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}b(Tse,"validateLayoutData");var yKe=b(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async x=>{if(x.isGroup){const w={...x};d[x.id]=w,h[x.id]=w,await r(p,x)}else{const w={...x};h[x.id]=w;const C=await s(y,x,{config:t.config,dir:t.direction||"TB"}),k=C.node().getBBox();w.width=k.width,w.height=k.height,w.domId=C,o.debug(`Node ${x.id} dimensions: ${k.width}x${k.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(x=>{const w=h[x.id];return{...x,width:w.width,height:w.height}})},T=await xse(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(x=>{const w=h[x.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${x.x}, ${x.y})`),w.x=x.x,w.y=x.y,o.debug(`Positioned node ${w.id} at center (${x.x}, ${x.y})`))}),T.edges.forEach(x=>{const w=t.edges.find(C=>C.id===x.id);w&&(w.points=[{x:x.startX,y:x.startY},{x:x.midX,y:x.midY},{x:x.endX,y:x.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async x=>{await i(m,x);const w=h[x.start??""],C=h[x.end??""];if(w&&C){const k=T.edges.find(S=>S.id===x.id);if(k){o.debug("APA01 positionedEdge",k);const S={...x},E=n(g,S,d,t.type,w,C,t.diagramId);l(S,E)}else{const S={...x,points:[{x:w.x||0,y:w.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,S,d,t.type,w,C,t.diagramId);l(S,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),vKe=yKe;const bKe=Object.freeze(Object.defineProperty({__proto__:null,render:vKe},Symbol.toStringTag,{value:"Module"}));var GE=b((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),wse=b((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};GE(t,r).lower()},"drawBackgroundRect"),xKe=b((t,e)=>{const r=e.text.replace(h0," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),jD=b((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=Xd.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),KD=b((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=Xd.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),vo=b(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),ZD=b(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),QD=b(()=>{let t=mt(".mermaidTooltip");return t.empty()&&(t=mt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),WE=(function(){var t=b(function(we,Le,Ye,ce){for(Ye=Ye||{},ce=we.length;ce--;Ye[we[ce]]=Le);return Ye},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],x=[1,35],w=[1,36],C=[1,37],k=[1,38],S=[1,39],E=[1,40],L=[1,41],M=[1,42],I=[1,43],P=[1,44],$=[1,45],_=[1,46],R=[1,47],O=[1,48],D=[1,50],N=[1,51],B=[1,52],F=[1,53],G=[1,54],z=[1,55],W=[1,56],V=[1,57],H=[1,58],te=[1,59],Y=[1,60],se=[14,42],J=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],re=[1,83],ge=[1,84],ae=[1,85],_e=[12,14,42],Fe=[12,14,33,42],qe=[12,14,33,42,76,77,79,80],ue=[12,33],de=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ce={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:b(function(Le,Ye,ce,ye,ke,le,pe){var U=le.length-1;switch(ke){case 3:ye.setDirection("TB");break;case 4:ye.setDirection("BT");break;case 5:ye.setDirection("RL");break;case 6:ye.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:ye.setC4Type(le[U-3]);break;case 19:ye.setTitle(le[U].substring(6)),this.$=le[U].substring(6);break;case 20:ye.setAccDescription(le[U].substring(15)),this.$=le[U].substring(15);break;case 21:this.$=le[U].trim(),ye.setTitle(this.$);break;case 22:case 23:this.$=le[U].trim(),ye.setAccDescription(this.$);break;case 28:le[U].splice(2,0,"ENTERPRISE"),ye.addPersonOrSystemBoundary(...le[U]),this.$=le[U];break;case 29:le[U].splice(2,0,"SYSTEM"),ye.addPersonOrSystemBoundary(...le[U]),this.$=le[U];break;case 30:ye.addPersonOrSystemBoundary(...le[U]),this.$=le[U];break;case 31:le[U].splice(2,0,"CONTAINER"),ye.addContainerBoundary(...le[U]),this.$=le[U];break;case 32:ye.addDeploymentNode("node",...le[U]),this.$=le[U];break;case 33:ye.addDeploymentNode("nodeL",...le[U]),this.$=le[U];break;case 34:ye.addDeploymentNode("nodeR",...le[U]),this.$=le[U];break;case 35:ye.popBoundaryParseStack();break;case 39:ye.addPersonOrSystem("person",...le[U]),this.$=le[U];break;case 40:ye.addPersonOrSystem("external_person",...le[U]),this.$=le[U];break;case 41:ye.addPersonOrSystem("system",...le[U]),this.$=le[U];break;case 42:ye.addPersonOrSystem("system_db",...le[U]),this.$=le[U];break;case 43:ye.addPersonOrSystem("system_queue",...le[U]),this.$=le[U];break;case 44:ye.addPersonOrSystem("external_system",...le[U]),this.$=le[U];break;case 45:ye.addPersonOrSystem("external_system_db",...le[U]),this.$=le[U];break;case 46:ye.addPersonOrSystem("external_system_queue",...le[U]),this.$=le[U];break;case 47:ye.addContainer("container",...le[U]),this.$=le[U];break;case 48:ye.addContainer("container_db",...le[U]),this.$=le[U];break;case 49:ye.addContainer("container_queue",...le[U]),this.$=le[U];break;case 50:ye.addContainer("external_container",...le[U]),this.$=le[U];break;case 51:ye.addContainer("external_container_db",...le[U]),this.$=le[U];break;case 52:ye.addContainer("external_container_queue",...le[U]),this.$=le[U];break;case 53:ye.addComponent("component",...le[U]),this.$=le[U];break;case 54:ye.addComponent("component_db",...le[U]),this.$=le[U];break;case 55:ye.addComponent("component_queue",...le[U]),this.$=le[U];break;case 56:ye.addComponent("external_component",...le[U]),this.$=le[U];break;case 57:ye.addComponent("external_component_db",...le[U]),this.$=le[U];break;case 58:ye.addComponent("external_component_queue",...le[U]),this.$=le[U];break;case 60:ye.addRel("rel",...le[U]),this.$=le[U];break;case 61:ye.addRel("birel",...le[U]),this.$=le[U];break;case 62:ye.addRel("rel_u",...le[U]),this.$=le[U];break;case 63:ye.addRel("rel_d",...le[U]),this.$=le[U];break;case 64:ye.addRel("rel_l",...le[U]),this.$=le[U];break;case 65:ye.addRel("rel_r",...le[U]),this.$=le[U];break;case 66:ye.addRel("rel_b",...le[U]),this.$=le[U];break;case 67:le[U].splice(0,1),ye.addRel("rel",...le[U]),this.$=le[U];break;case 68:ye.updateElStyle("update_el_style",...le[U]),this.$=le[U];break;case 69:ye.updateRelStyle("update_rel_style",...le[U]),this.$=le[U];break;case 70:ye.updateLayoutConfig("update_layout_config",...le[U]),this.$=le[U];break;case 71:this.$=[le[U]];break;case 72:le[U].unshift(le[U-1]),this.$=le[U];break;case 73:case 75:this.$=le[U].trim();break;case 74:let oe={};oe[le[U-1].trim()]=le[U].trim(),this.$=oe;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{14:[1,74]},t(se,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y}),t(se,[2,14]),t(J,[2,16],{12:[1,76]}),t(se,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:re,79:ge,80:ae},{35:86,75:81,76:ee,77:re,79:ge,80:ae},{35:87,75:81,76:ee,77:re,79:ge,80:ae},{35:88,75:81,76:ee,77:re,79:ge,80:ae},{35:89,75:81,76:ee,77:re,79:ge,80:ae},{35:90,75:81,76:ee,77:re,79:ge,80:ae},{35:91,75:81,76:ee,77:re,79:ge,80:ae},{35:92,75:81,76:ee,77:re,79:ge,80:ae},{35:93,75:81,76:ee,77:re,79:ge,80:ae},{35:94,75:81,76:ee,77:re,79:ge,80:ae},{35:95,75:81,76:ee,77:re,79:ge,80:ae},{35:96,75:81,76:ee,77:re,79:ge,80:ae},{35:97,75:81,76:ee,77:re,79:ge,80:ae},{35:98,75:81,76:ee,77:re,79:ge,80:ae},{35:99,75:81,76:ee,77:re,79:ge,80:ae},{35:100,75:81,76:ee,77:re,79:ge,80:ae},{35:101,75:81,76:ee,77:re,79:ge,80:ae},{35:102,75:81,76:ee,77:re,79:ge,80:ae},{35:103,75:81,76:ee,77:re,79:ge,80:ae},{35:104,75:81,76:ee,77:re,79:ge,80:ae},t(_e,[2,59]),{35:105,75:81,76:ee,77:re,79:ge,80:ae},{35:106,75:81,76:ee,77:re,79:ge,80:ae},{35:107,75:81,76:ee,77:re,79:ge,80:ae},{35:108,75:81,76:ee,77:re,79:ge,80:ae},{35:109,75:81,76:ee,77:re,79:ge,80:ae},{35:110,75:81,76:ee,77:re,79:ge,80:ae},{35:111,75:81,76:ee,77:re,79:ge,80:ae},{35:112,75:81,76:ee,77:re,79:ge,80:ae},{35:113,75:81,76:ee,77:re,79:ge,80:ae},{35:114,75:81,76:ee,77:re,79:ge,80:ae},{35:115,75:81,76:ee,77:re,79:ge,80:ae},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:re,79:ge,80:ae},{35:120,75:81,76:ee,77:re,79:ge,80:ae},{35:121,75:81,76:ee,77:re,79:ge,80:ae},{35:122,75:81,76:ee,77:re,79:ge,80:ae},{35:123,75:81,76:ee,77:re,79:ge,80:ae},{35:124,75:81,76:ee,77:re,79:ge,80:ae},{35:125,75:81,76:ee,77:re,79:ge,80:ae},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(se,[2,15]),t(J,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(se,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:x,51:w,52:C,53:k,54:S,55:E,56:L,57:M,58:I,59:P,60:$,61:_,62:R,63:O,64:D,65:N,66:B,67:F,68:G,69:z,70:W,71:V,72:H,73:te,74:Y}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t(Fe,[2,71],{75:81,35:132,76:ee,77:re,79:ge,80:ae}),t(qe,[2,73]),{78:[1,133]},t(qe,[2,75]),t(qe,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ue,[2,28]),t(ue,[2,29]),t(ue,[2,30]),t(ue,[2,31]),t(ue,[2,32]),t(ue,[2,33]),t(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(J,[2,18]),t(se,[2,38]),t(Fe,[2,72]),t(qe,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(de,[2,25]),t(de,[2,26],{12:[1,138]}),t(de,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:b(function(Le,Ye){if(Ye.recoverable)this.trace(Le);else{var ce=new Error(Le);throw ce.hash=Ye,ce}},"parseError"),parse:b(function(Le){var Ye=this,ce=[0],ye=[],ke=[null],le=[],pe=this.table,U="",oe=0,Q=0,fe=2,j=1,Be=le.slice.call(arguments,1),Se=Object.create(this.lexer),He={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(He.yy[De]=this.yy[De]);Se.setInput(Le,He.yy),He.yy.lexer=Se,He.yy.parser=this,typeof Se.yylloc>"u"&&(Se.yylloc={});var We=Se.yylloc;le.push(We);var Ne=Se.options&&Se.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(ve){ce.length=ce.length-2*ve,ke.length=ke.length-ve,le.length=le.length-ve}b(Ze,"popStack");function Pe(){var ve;return ve=ye.pop()||Se.lex()||j,typeof ve!="number"&&(ve instanceof Array&&(ye=ve,ve=ye.pop()),ve=Ye.symbols_[ve]||ve),ve}b(Pe,"lex");for(var nt,Ie,pt,Re,kt={},bt,lt,Nt,Ct;;){if(Ie=ce[ce.length-1],this.defaultActions[Ie]?pt=this.defaultActions[Ie]:((nt===null||typeof nt>"u")&&(nt=Pe()),pt=pe[Ie]&&pe[Ie][nt]),typeof pt>"u"||!pt.length||!pt[0]){var dt="";Ct=[];for(bt in pe[Ie])this.terminals_[bt]&&bt>fe&&Ct.push("'"+this.terminals_[bt]+"'");Se.showPosition?dt="Parse error on line "+(oe+1)+`: +`+Se.showPosition()+` +Expecting `+Ct.join(", ")+", got '"+(this.terminals_[nt]||nt)+"'":dt="Parse error on line "+(oe+1)+": Unexpected "+(nt==j?"end of input":"'"+(this.terminals_[nt]||nt)+"'"),this.parseError(dt,{text:Se.match,token:this.terminals_[nt]||nt,line:Se.yylineno,loc:We,expected:Ct})}if(pt[0]instanceof Array&&pt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ie+", token: "+nt);switch(pt[0]){case 1:ce.push(nt),ke.push(Se.yytext),le.push(Se.yylloc),ce.push(pt[1]),nt=null,Q=Se.yyleng,U=Se.yytext,oe=Se.yylineno,We=Se.yylloc;break;case 2:if(lt=this.productions_[pt[1]][1],kt.$=ke[ke.length-lt],kt._$={first_line:le[le.length-(lt||1)].first_line,last_line:le[le.length-1].last_line,first_column:le[le.length-(lt||1)].first_column,last_column:le[le.length-1].last_column},Ne&&(kt._$.range=[le[le.length-(lt||1)].range[0],le[le.length-1].range[1]]),Re=this.performAction.apply(kt,[U,Q,oe,He.yy,pt[1],ke,le].concat(Be)),typeof Re<"u")return Re;lt&&(ce=ce.slice(0,-1*lt*2),ke=ke.slice(0,-1*lt),le=le.slice(0,-1*lt)),ce.push(this.productions_[pt[1]][0]),ke.push(kt.$),le.push(kt._$),Nt=pe[ce[ce.length-2]][ce[ce.length-1]],ce.push(Nt);break;case 3:return!0}}return!0},"parse")},me=(function(){var we={EOF:1,parseError:b(function(Ye,ce){if(this.yy.parser)this.yy.parser.parseError(Ye,ce);else throw new Error(Ye)},"parseError"),setInput:b(function(Le,Ye){return this.yy=Ye||this.yy||{},this._input=Le,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var Le=this._input[0];this.yytext+=Le,this.yyleng++,this.offset++,this.match+=Le,this.matched+=Le;var Ye=Le.match(/(?:\r\n?|\n).*/g);return Ye?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Le},"input"),unput:b(function(Le){var Ye=Le.length,ce=Le.split(/(?:\r\n?|\n)/g);this._input=Le+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ye),this.offset-=Ye;var ye=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===ye.length?this.yylloc.first_column:0)+ye[ye.length-ce.length].length-ce[0].length:this.yylloc.first_column-Ye},this.options.ranges&&(this.yylloc.range=[ke[0],ke[0]+this.yyleng-Ye]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(Le){this.unput(this.match.slice(Le))},"less"),pastInput:b(function(){var Le=this.matched.substr(0,this.matched.length-this.match.length);return(Le.length>20?"...":"")+Le.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var Le=this.match;return Le.length<20&&(Le+=this._input.substr(0,20-Le.length)),(Le.substr(0,20)+(Le.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var Le=this.pastInput(),Ye=new Array(Le.length+1).join("-");return Le+this.upcomingInput()+` +`+Ye+"^"},"showPosition"),test_match:b(function(Le,Ye){var ce,ye,ke;if(this.options.backtrack_lexer&&(ke={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ke.yylloc.range=this.yylloc.range.slice(0))),ye=Le[0].match(/(?:\r\n?|\n).*/g),ye&&(this.yylineno+=ye.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ye?ye[ye.length-1].length-ye[ye.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Le[0].length},this.yytext+=Le[0],this.match+=Le[0],this.matches=Le,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Le[0].length),this.matched+=Le[0],ce=this.performAction.call(this,this.yy,this,Ye,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var le in ke)this[le]=ke[le];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Le,Ye,ce,ye;this._more||(this.yytext="",this.match="");for(var ke=this._currentRules(),le=0;leYe[0].length)){if(Ye=ce,ye=le,this.options.backtrack_lexer){if(Le=this.test_match(ce,ke[le]),Le!==!1)return Le;if(this._backtrack){Ye=!1;continue}else return!1}else if(!this.options.flex)break}return Ye?(Le=this.test_match(Ye,ke[ye]),Le!==!1?Le:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var Ye=this.next();return Ye||this.lex()},"lex"),begin:b(function(Ye){this.conditionStack.push(Ye)},"begin"),popState:b(function(){var Ye=this.conditionStack.length-1;return Ye>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(Ye){return Ye=this.conditionStack.length-1-Math.abs(Ye||0),Ye>=0?this.conditionStack[Ye]:"INITIAL"},"topState"),pushState:b(function(Ye){this.begin(Ye)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(Ye,ce,ye,ke){switch(ye){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return we})();Ce.lexer=me;function $e(){this.yy={}}return b($e,"Parser"),$e.prototype=Ce,Ce.Parser=$e,new $e})();WE.parser=WE;var TKe=WE,ml=[],Xh=[""],ws="global",yl="",fc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],fT=[],JD="",eN=!1,qE=4,VE=2,Cse,wKe=b(function(){return Cse},"getC4Type"),CKe=b(function(t){Cse=Qr(t,Ve())},"setC4Type"),SKe=b(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=fT.find(d=>d.from===e&&d.to===r);if(h?u=h:fT.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=jh()},"addRel"),kKe=b(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=ml.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,ml.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=ws,o.wrap=jh()},"addPersonOrSystem"),EKe=b(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ml.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ml.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=jh(),l.typeC4Shape={text:t},l.parentBoundary=ws},"addContainer"),AKe=b(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ml.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ml.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=jh(),l.typeC4Shape={text:t},l.parentBoundary=ws},"addComponent"),_Ke=b(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=fc.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,fc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=ws,a.wrap=jh(),yl=ws,ws=t,Xh.push(yl)},"addPersonOrSystemBoundary"),RKe=b(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=fc.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,fc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=ws,a.wrap=jh(),yl=ws,ws=t,Xh.push(yl)},"addContainerBoundary"),LKe=b(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=fc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,fc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=ws,l.wrap=jh(),yl=ws,ws=e,Xh.push(yl)},"addDeploymentNode"),IKe=b(function(){ws=yl,Xh.pop(),yl=Xh.pop(),Xh.push(yl)},"popBoundaryParseStack"),MKe=b(function(t,e,r,n,i,a,s,o,l,u,h){let d=ml.find(f=>f.alias===e);if(!(d===void 0&&(d=fc.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),DKe=b(function(t,e,r,n,i,a,s){const o=fT.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),NKe=b(function(t,e,r){let n=qE,i=VE;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(qE=n),i>=1&&(VE=i)},"updateLayoutConfig"),OKe=b(function(){return qE},"getC4ShapeInRow"),$Ke=b(function(){return VE},"getC4BoundaryInRow"),PKe=b(function(){return ws},"getCurrentBoundaryParse"),BKe=b(function(){return yl},"getParentBoundaryParse"),Sse=b(function(t){return t==null?ml:ml.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),FKe=b(function(t){return ml.find(e=>e.alias===t)},"getC4Shape"),zKe=b(function(t){return Object.keys(Sse(t))},"getC4ShapeKeys"),kse=b(function(t){return t==null?fc:fc.filter(e=>e.parentBoundary===t)},"getBoundaries"),GKe=kse,WKe=b(function(){return fT},"getRels"),qKe=b(function(){return JD},"getTitle"),VKe=b(function(t){eN=t},"setWrap"),jh=b(function(){return eN},"autoWrap"),UKe=b(function(){ml=[],fc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],yl="",ws="global",Xh=[""],fT=[],Xh=[""],JD="",eN=!1,qE=4,VE=2},"clear"),HKe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},YKe={FILLED:0,OPEN:1},XKe={LEFTOF:0,RIGHTOF:1,OVER:2},jKe=b(function(t){JD=Qr(t,Ve())},"setTitle"),tN={addPersonOrSystem:kKe,addPersonOrSystemBoundary:_Ke,addContainer:EKe,addContainerBoundary:RKe,addComponent:AKe,addDeploymentNode:LKe,popBoundaryParseStack:IKe,addRel:SKe,updateElStyle:MKe,updateRelStyle:DKe,updateLayoutConfig:NKe,autoWrap:jh,setWrap:VKe,getC4ShapeArray:Sse,getC4Shape:FKe,getC4ShapeKeys:zKe,getBoundaries:kse,getBoundarys:GKe,getCurrentBoundaryParse:PKe,getParentBoundaryParse:BKe,getRels:WKe,getTitle:qKe,getC4Type:wKe,getC4ShapeInRow:OKe,getC4BoundaryInRow:$Ke,setAccTitle:qn,getAccTitle:Qn,getAccDescription:ei,setAccDescription:Jn,getConfig:b(()=>Ve().c4,"getConfig"),clear:UKe,LINETYPE:HKe,ARROWTYPE:YKe,PLACEMENT:XKe,setTitle:jKe,setC4Type:CKe},rN=b(function(t,e){return GE(t,e)},"drawRect"),Ese=b(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:Xd.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),KKe=b((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();Cu(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),Cu(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),ZKe=b(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};rN(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,Cu(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,Cu(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,Cu(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),QKe=b(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=vo();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},rN(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=sZe(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":Ese(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,Cu(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?Cu(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&Cu(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,Cu(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),JKe=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),eZe=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),tZe=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),rZe=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),nZe=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),iZe=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),aZe=b(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),sZe=b((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Cu=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}b(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split($t.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Ase)&&(r=this.nextData.startx+e.margin+pr.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},iN(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},b(A1,"Bounds"),A1),iN=b(function(t){Ri(pr,t),t.fontFamily&&(pr.personFontFamily=pr.systemFontFamily=pr.messageFontFamily=t.fontFamily),t.fontSize&&(pr.personFontSize=pr.systemFontSize=pr.messageFontSize=t.fontSize),t.fontWeight&&(pr.personFontWeight=pr.systemFontWeight=pr.messageFontWeight=t.fontWeight)},"setConf"),pT=b((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),YE=b(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),oZe=b(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function zo(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Wb(e[t].text,i,n),e[t].textLines=e[t].text.split($t.lineBreakRegex).length,e[t].width=i,e[t].height=B4(e[t].text,n);else{let a=e[t].text.split($t.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(hs(o,n),e[t].width),s=B4(o,n),e[t].height=e[t].height+s}}b(zo,"calcC4ShapeTextWH");var Rse=b(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=pr.c4ShapeMargin-35;let n=e.wrap&&pr.wrap,i=YE(pr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=hs(e.label.text,i);zo("label",e,n,i,a),pc.drawBoundary(t,e,pr)},"drawBoundary"),Lse=b(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=pT(pr,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=hs("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=pr.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&pr.wrap,u=pr.width-pr.c4ShapePadding*2,h=pT(pr,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",zo("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=pT(pr,s.typeC4Shape.text);zo("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=pT(pr,s.techn.text);zo("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=pT(pr,s.typeC4Shape.text);zo("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+pr.c4ShapePadding,s.width=Math.max(s.width||pr.width,f,pr.width),s.height=Math.max(s.height||pr.height,d,pr.height),s.margin=s.margin||pr.c4ShapeMargin,t.insert(s),pc.drawC4Shape(e,s,pr)}t.bumpLastMargin(pr.c4ShapeMargin)},"drawC4ShapeArray"),Go=(_1=class{constructor(e,r){this.x=e,this.y=r}},b(_1,"Point"),_1),Ise=b(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new Go(r,o):r==i&&na&&(f=new Go(s,n)),r>i&&n=h?f=new Go(r,o+h*t.width/2):f=new Go(s-l/u*t.height/2,n+t.height):r=h?f=new Go(r+t.width,o+h*t.width/2):f=new Go(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new Go(r+t.width,o-h*t.width/2):f=new Go(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Go(r,o-t.width/2*h):f=new Go(s-t.height/2*l/u,n)),f},"getIntersectPoint"),lZe=b(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ise(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ise(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),cZe=b(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&pr.wrap,l=oZe(pr);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=hs(s.label.text,l);zo("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=hs(s.techn.text,l),zo("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=hs(s.descr.text,l),zo("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=lZe(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}pc.drawRels(t,e,pr,i)},"drawRels");function aN(t,e,r,n,i){let a=new _se(i);a.data.widthLimit=r.data.widthLimit/Math.min(nN,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&pr.wrap,h=YE(pr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",zo("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=YE(pr);zo("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=YE(pr);g.fontSize=g.fontSize-2,zo("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%nN===0){let g=r.data.startx+pr.diagramMarginX,m=r.data.stopy+pr.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+pr.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&Lse(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&aN(t,e,a,p,i),o.alias!=="global"&&Rse(t,o,a),r.data.stopy=Math.max(a.data.stopy+pr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+pr.c4ShapeMargin,r.data.stopx),UE=Math.max(UE,r.data.stopx),HE=Math.max(HE,r.data.stopy)}}b(aN,"drawInsideBoundary");var uZe=b(function(t,e,r,n){pr=Ve().c4;const i=Ve().securityLevel;let a;i==="sandbox"&&(a=mt("#i"+e));const s=mt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(pr.wrap),Ase=o.getC4ShapeInRow(),nN=o.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(pr,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):mt(`[id="${e}"]`);pc.insertComputerIcon(l,e),pc.insertDatabaseIcon(l,e),pc.insertClockIcon(l,e);let u=new _se(n);u.setData(pr.diagramMarginX,pr.diagramMarginX,pr.diagramMarginY,pr.diagramMarginY),u.data.widthLimit=screen.availWidth,UE=pr.diagramMarginX,HE=pr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");aN(l,"",u,d,n),pc.insertArrowHead(l,e),pc.insertArrowEnd(l,e),pc.insertArrowCrossHead(l,e),pc.insertArrowFilledHead(l,e),cZe(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=UE,u.data.stopy=HE;const f=u.data;let g=f.stopy-f.starty+2*pr.diagramMarginY;const y=f.stopx-f.startx+2*pr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*pr.diagramMarginX).attr("y",f.starty+pr.diagramMarginY),bi(l,g,y,pr.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-pr.diagramMarginX+" -"+(pr.diagramMarginY+v)+" "+y+" "+(g+v)),he.debug("models:",f)},"draw"),Mse={drawPersonOrSystemArray:Lse,drawBoundary:Rse,setConf:iN,draw:uZe},hZe=b(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),fUe=dUe,pUe={parser:wWe,db:CI,renderer:Vte,styles:fUe,init:T(({c4:t,wrap:e})=>{Vte.setConf(t),CI.setWrap(e)},"init")};const gUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:pUe},Symbol.toStringTag,{value:"Module"}));var vx=T(()=>` +`,"getStyles"),dZe=hZe,fZe={parser:TKe,db:tN,renderer:Mse,styles:dZe,init:b(({c4:t,wrap:e})=>{Mse.setConf(t),tN.setWrap(e)},"init")};const pZe=Object.freeze(Object.defineProperty({__proto__:null,diagram:fZe},Symbol.toStringTag,{value:"Module"}));var gT=b(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -917,21 +922,21 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ut="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),Z0=T((t,e)=>{let r;return e==="sandbox"&&(r=pt("#i"+t)),pt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Ud=T((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=mUe(t,e);vi(t,a,i,n);const l=yUe(s,o,i,a,e);t.attr("viewBox",l),ae.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),mUe=T((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),yUe=T((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),vUe="flowchart-",bUe=(Nm=class{constructor(){this.vertexCounter=0,this.config=$e(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Mn,this.setAccDescription=qn,this.setDiagramTitle=Wn,this.getAccTitle=Gn,this.getAccDescription=Vn,this.getDiagramTitle=Nn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return It.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),Wg=b((t,e)=>{let r;return e==="sandbox"&&(r=mt("#i"+t)),mt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Nf=b((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=gZe(t,e);bi(t,a,i,n);const l=mZe(s,o,i,a,e);t.attr("viewBox",l),he.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),gZe=b((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),mZe=b((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),yZe="flowchart-",vZe=(R1=class{constructor(){this.vertexCounter=0,this.config=Ve(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=qn,this.setAccDescription=Jn,this.setDiagramTitle=ti,this.getAccTitle=Qn,this.getAccDescription=ei,this.getDiagramTitle=Vn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return $t.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=N4(m,{schema:M4})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ae.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:vUe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=$e(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!rH(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ae.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=Up(o.start,o.end,{counter:0,prefix:"L"}):o.id=Up(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ae.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=N4(m,{schema:D4})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&he.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:yZe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ve(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!XX(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};he.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=I0(o.start,o.end,{counter:0,prefix:"L"}):o.id=I0(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))he.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ae.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if($e().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Lr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Lr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=Mte();pt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=pt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Eu.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=$e(),Dn()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=T(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const x=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:x in p?p[x].hasOwnProperty(v)?!1:p[x][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=$e().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??$e().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=$e(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:Up(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return XB.flowchart}},T(Nm,"FlowDB"),Nm),xUe=T(function(t,e){return e.db.getClasses()},"getClasses"),TUe=T(async function(t,e,r,n){var d;ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=$e();n.db.setDiagramId(e),ae.debug("Before getData: ");const o=n.db.getData();ae.debug("Data: ",o);const l=Z0(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=cb(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&ae.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,ae.debug("REF1:",o),await Jp(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;Lr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Ud(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),wUe={getClasses:xUe,draw:TUe},_I=(function(){var t=T(function(_i,$t,bt,Bt){for(bt=bt||{},Bt=_i.length;Bt--;bt[_i[Bt]]=$t);return bt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],k=[1,45],S=[1,47],C=[1,43],_=[1,48],L=[1,44],O=[1,51],D=[1,46],z=[1,52],F=[1,53],A=[1,34],R=[1,35],N=[1,36],M=[1,37],I=[1,38],$=[1,58],P=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],B=[1,62],q=[1,61],V=[1,63],X=[8,9,11,75,77,78],W=[1,79],ie=[1,92],K=[1,97],se=[1,96],te=[1,93],Z=[1,89],ee=[1,95],ne=[1,91],oe=[1,98],fe=[1,94],Ae=[1,99],Re=[1,90],Ge=[8,9,10,11,40,75,77,78],Ce=[8,9,10,11,40,46,75,77,78],be=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Fe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ye=[44,60,89,102,105,106,109,111,114,115,116],He=[1,122],xe=[1,123],Ve=[1,125],Je=[1,124],nt=[44,60,62,74,89,102,105,106,109,111,114,115,116],tt=[1,134],Ze=[1,148],Ee=[1,149],Se=[1,150],Y=[1,151],ce=[1,136],j=[1,138],pe=[1,142],re=[1,143],Pe=[1,144],ve=[1,145],Ue=[1,146],Me=[1,147],qe=[1,152],Le=[1,153],Ke=[1,132],De=[1,133],it=[1,140],Te=[1,135],ct=[1,139],we=[1,137],Et=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],yt=[1,155],ot=[1,157],Dt=[8,9,11],vt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ut=[1,177],le=[1,173],At=[1,174],dt=[1,178],ht=[1,175],St=[1,176],Nr=[77,116,119],me=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],et=[10,106],lt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Rt=[1,248],Ft=[1,246],or=[1,250],ir=[1,244],xr=[1,245],sr=[1,247],Rr=[1,249],Jt=[1,251],Ir=[1,269],ln=[8,9,11,106],Or=[8,9,10,11,60,84,105,106,109,110,111,112],Ca={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:T(function($t,bt,Bt,Tt,pr,ke,Ri){var Ne=ke.length-1;switch(pr){case 2:this.$=[];break;case 3:(!Array.isArray(ke[Ne])||ke[Ne].length>0)&&ke[Ne-1].push(ke[Ne]),this.$=ke[Ne-1];break;case 4:case 183:this.$=ke[Ne];break;case 11:Tt.setDirection("TB"),this.$="TB";break;case 12:Tt.setDirection(ke[Ne-1]),this.$=ke[Ne-1];break;case 27:this.$=ke[Ne-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Tt.addSubGraph(ke[Ne-6],ke[Ne-1],ke[Ne-4]);break;case 34:this.$=Tt.addSubGraph(ke[Ne-3],ke[Ne-1],ke[Ne-3]);break;case 35:this.$=Tt.addSubGraph(void 0,ke[Ne-1],void 0);break;case 37:this.$=ke[Ne].trim(),Tt.setAccTitle(this.$);break;case 38:case 39:this.$=ke[Ne].trim(),Tt.setAccDescription(this.$);break;case 43:this.$=ke[Ne-1]+ke[Ne];break;case 44:this.$=ke[Ne];break;case 45:Tt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),Tt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 46:Tt.addLink(ke[Ne-2].stmt,ke[Ne],ke[Ne-1]),this.$={stmt:ke[Ne],nodes:ke[Ne].concat(ke[Ne-2].nodes)};break;case 47:Tt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 48:this.$={stmt:ke[Ne-1],nodes:ke[Ne-1]};break;case 49:Tt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1],shapeData:ke[Ne]};break;case 50:this.$={stmt:ke[Ne],nodes:ke[Ne]};break;case 51:this.$=[ke[Ne]];break;case 52:Tt.addVertex(ke[Ne-5][ke[Ne-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne-4]),this.$=ke[Ne-5].concat(ke[Ne]);break;case 53:this.$=ke[Ne-4].concat(ke[Ne]);break;case 54:this.$=ke[Ne];break;case 55:this.$=ke[Ne-2],Tt.setClass(ke[Ne-2],ke[Ne]);break;case 56:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"square");break;case 57:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"doublecircle");break;case 58:this.$=ke[Ne-5],Tt.addVertex(ke[Ne-5],ke[Ne-2],"circle");break;case 59:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"ellipse");break;case 60:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"stadium");break;case 61:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"subroutine");break;case 62:this.$=ke[Ne-7],Tt.addVertex(ke[Ne-7],ke[Ne-1],"rect",void 0,void 0,void 0,Object.fromEntries([[ke[Ne-5],ke[Ne-3]]]));break;case 63:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"cylinder");break;case 64:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"round");break;case 65:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"diamond");break;case 66:this.$=ke[Ne-5],Tt.addVertex(ke[Ne-5],ke[Ne-2],"hexagon");break;case 67:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"odd");break;case 68:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"trapezoid");break;case 69:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"inv_trapezoid");break;case 70:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"lean_right");break;case 71:this.$=ke[Ne-3],Tt.addVertex(ke[Ne-3],ke[Ne-1],"lean_left");break;case 72:this.$=ke[Ne],Tt.addVertex(ke[Ne]);break;case 73:ke[Ne-1].text=ke[Ne],this.$=ke[Ne-1];break;case 74:case 75:ke[Ne-2].text=ke[Ne-1],this.$=ke[Ne-2];break;case 76:this.$=ke[Ne];break;case 77:var In=Tt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:ke[Ne-1]};break;case 78:var In=Tt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:ke[Ne-1],id:ke[Ne-3]};break;case 79:this.$={text:ke[Ne],type:"text"};break;case 80:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 81:this.$={text:ke[Ne],type:"string"};break;case 82:this.$={text:ke[Ne],type:"markdown"};break;case 83:var In=Tt.destructLink(ke[Ne]);this.$={type:In.type,stroke:In.stroke,length:In.length};break;case 84:var In=Tt.destructLink(ke[Ne]);this.$={type:In.type,stroke:In.stroke,length:In.length,id:ke[Ne-1]};break;case 85:this.$=ke[Ne-1];break;case 86:this.$={text:ke[Ne],type:"text"};break;case 87:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 88:this.$={text:ke[Ne],type:"string"};break;case 89:case 104:this.$={text:ke[Ne],type:"markdown"};break;case 101:this.$={text:ke[Ne],type:"text"};break;case 102:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 103:this.$={text:ke[Ne],type:"text"};break;case 105:this.$=ke[Ne-4],Tt.addClass(ke[Ne-2],ke[Ne]);break;case 106:this.$=ke[Ne-4],Tt.setClass(ke[Ne-2],ke[Ne]);break;case 107:case 115:this.$=ke[Ne-1],Tt.setClickEvent(ke[Ne-1],ke[Ne]);break;case 108:case 116:this.$=ke[Ne-3],Tt.setClickEvent(ke[Ne-3],ke[Ne-2]),Tt.setTooltip(ke[Ne-3],ke[Ne]);break;case 109:this.$=ke[Ne-2],Tt.setClickEvent(ke[Ne-2],ke[Ne-1],ke[Ne]);break;case 110:this.$=ke[Ne-4],Tt.setClickEvent(ke[Ne-4],ke[Ne-3],ke[Ne-2]),Tt.setTooltip(ke[Ne-4],ke[Ne]);break;case 111:this.$=ke[Ne-2],Tt.setLink(ke[Ne-2],ke[Ne]);break;case 112:this.$=ke[Ne-4],Tt.setLink(ke[Ne-4],ke[Ne-2]),Tt.setTooltip(ke[Ne-4],ke[Ne]);break;case 113:this.$=ke[Ne-4],Tt.setLink(ke[Ne-4],ke[Ne-2],ke[Ne]);break;case 114:this.$=ke[Ne-6],Tt.setLink(ke[Ne-6],ke[Ne-4],ke[Ne]),Tt.setTooltip(ke[Ne-6],ke[Ne-2]);break;case 117:this.$=ke[Ne-1],Tt.setLink(ke[Ne-1],ke[Ne]);break;case 118:this.$=ke[Ne-3],Tt.setLink(ke[Ne-3],ke[Ne-2]),Tt.setTooltip(ke[Ne-3],ke[Ne]);break;case 119:this.$=ke[Ne-3],Tt.setLink(ke[Ne-3],ke[Ne-2],ke[Ne]);break;case 120:this.$=ke[Ne-5],Tt.setLink(ke[Ne-5],ke[Ne-4],ke[Ne]),Tt.setTooltip(ke[Ne-5],ke[Ne-2]);break;case 121:this.$=ke[Ne-4],Tt.addVertex(ke[Ne-2],void 0,void 0,ke[Ne]);break;case 122:this.$=ke[Ne-4],Tt.updateLink([ke[Ne-2]],ke[Ne]);break;case 123:this.$=ke[Ne-4],Tt.updateLink(ke[Ne-2],ke[Ne]);break;case 124:this.$=ke[Ne-8],Tt.updateLinkInterpolate([ke[Ne-6]],ke[Ne-2]),Tt.updateLink([ke[Ne-6]],ke[Ne]);break;case 125:this.$=ke[Ne-8],Tt.updateLinkInterpolate(ke[Ne-6],ke[Ne-2]),Tt.updateLink(ke[Ne-6],ke[Ne]);break;case 126:this.$=ke[Ne-6],Tt.updateLinkInterpolate([ke[Ne-4]],ke[Ne]);break;case 127:this.$=ke[Ne-6],Tt.updateLinkInterpolate(ke[Ne-4],ke[Ne]);break;case 128:case 130:this.$=[ke[Ne]];break;case 129:case 131:ke[Ne-2].push(ke[Ne]),this.$=ke[Ne-2];break;case 133:this.$=ke[Ne-1]+ke[Ne];break;case 181:this.$=ke[Ne];break;case 182:this.$=ke[Ne-1]+""+ke[Ne];break;case 184:this.$=ke[Ne-1]+""+ke[Ne];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F,121:A,122:R,123:N,124:M,125:I},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},t(P,[2,3]),t(P,[2,4]),t(P,[2,5]),t(P,[2,6]),t(P,[2,7]),t(P,[2,8]),{8:B,9:q,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:B,9:q,11:V,21:68},{8:B,9:q,11:V,21:69},{8:B,9:q,11:V,21:70},{8:B,9:q,11:V,21:71},{8:B,9:q,11:V,21:72},{8:B,9:q,10:[1,73],11:V,21:74},t(P,[2,36]),{35:[1,75]},{37:[1,76]},t(P,[2,39]),t(X,[2,50],{18:77,39:78,10:$,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:ie,44:K,60:se,80:[1,87],89:te,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re,120:88},t(P,[2,185]),t(P,[2,186]),t(P,[2,187]),t(P,[2,188]),t(P,[2,189]),t(Ge,[2,51]),t(Ge,[2,54],{46:[1,100]}),t(Ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:k,102:S,105:C,106:_,109:L,111:O,114:D,115:z,116:F}),t(be,[2,181]),t(be,[2,142]),t(be,[2,143]),t(be,[2,144]),t(be,[2,145]),t(be,[2,146]),t(be,[2,147]),t(be,[2,148]),t(be,[2,149]),t(be,[2,150]),t(be,[2,151]),t(be,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Fe,[2,26],{18:115,10:$}),t(P,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(ye,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:He,81:xe,116:Ve,119:Je},{75:[1,126],77:[1,127]},t(nt,[2,83]),t(P,[2,28]),t(P,[2,29]),t(P,[2,30]),t(P,[2,31]),t(P,[2,32]),{10:tt,12:Ze,14:Ee,27:Se,28:128,32:Y,44:ce,60:j,75:pe,80:[1,130],81:[1,131],83:141,84:re,85:Pe,86:ve,87:Ue,88:Me,89:qe,90:Le,91:129,105:Ke,109:De,111:it,114:Te,115:ct,116:we},t(Et,a,{5:154}),t(P,[2,37]),t(P,[2,38]),t(X,[2,48],{44:yt}),t(X,[2,49],{18:156,10:$,40:ot}),t(Ge,[2,44]),{44:g,47:158,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},{44:g,47:163,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},t(Dt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Dt,[2,115],{120:168,10:[1,167],14:ie,44:K,60:se,89:te,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re}),t(Dt,[2,117],{10:[1,169]}),t(vt,[2,183]),t(vt,[2,170]),t(vt,[2,171]),t(vt,[2,172]),t(vt,[2,173]),t(vt,[2,174]),t(vt,[2,175]),t(vt,[2,176]),t(vt,[2,177]),t(vt,[2,178]),t(vt,[2,179]),t(vt,[2,180]),{44:g,47:170,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},{30:171,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:179,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:181,50:[1,180],67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:182,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:183,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:184,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{109:[1,185]},{30:186,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:187,65:[1,188],67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:189,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:190,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{30:191,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},t(be,[2,182]),t(i,[2,20]),t(Fe,[2,25]),t(X,[2,46],{39:192,18:193,10:$,40:W}),t(ye,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{77:[1,197],79:198,116:Ve,119:Je},t(Nr,[2,79]),t(Nr,[2,81]),t(Nr,[2,82]),t(Nr,[2,168]),t(Nr,[2,169]),{76:199,79:121,80:He,81:xe,116:Ve,119:Je},t(nt,[2,84]),{8:B,9:q,10:tt,11:V,12:Ze,14:Ee,21:201,27:Se,29:[1,200],32:Y,44:ce,60:j,75:pe,83:141,84:re,85:Pe,86:ve,87:Ue,88:Me,89:qe,90:Le,91:202,105:Ke,109:De,111:it,114:Te,115:ct,116:we},t(me,[2,101]),t(me,[2,103]),t(me,[2,104]),t(me,[2,157]),t(me,[2,158]),t(me,[2,159]),t(me,[2,160]),t(me,[2,161]),t(me,[2,162]),t(me,[2,163]),t(me,[2,164]),t(me,[2,165]),t(me,[2,166]),t(me,[2,167]),t(me,[2,90]),t(me,[2,91]),t(me,[2,92]),t(me,[2,93]),t(me,[2,94]),t(me,[2,95]),t(me,[2,96]),t(me,[2,97]),t(me,[2,98]),t(me,[2,99]),t(me,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F,121:A,122:R,123:N,124:M,125:I},{10:$,18:204},{44:[1,205]},t(Ge,[2,43]),{10:[1,206],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:D,115:z,116:F},{10:[1,207]},{10:[1,208],106:[1,209]},t(et,[2,128]),{10:[1,210],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:D,115:z,116:F},{10:[1,211],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:D,115:z,116:F},{80:[1,212]},t(Dt,[2,109],{10:[1,213]}),t(Dt,[2,111],{10:[1,214]}),{80:[1,215]},t(vt,[2,184]),{80:[1,216],98:[1,217]},t(Ge,[2,55],{113:113,44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,114:D,115:z,116:F}),{31:[1,218],67:ut,82:219,116:dt,117:ht,118:St},t(lt,[2,86]),t(lt,[2,88]),t(lt,[2,89]),t(lt,[2,153]),t(lt,[2,154]),t(lt,[2,155]),t(lt,[2,156]),{49:[1,220],67:ut,82:219,116:dt,117:ht,118:St},{30:221,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{51:[1,222],67:ut,82:219,116:dt,117:ht,118:St},{53:[1,223],67:ut,82:219,116:dt,117:ht,118:St},{55:[1,224],67:ut,82:219,116:dt,117:ht,118:St},{57:[1,225],67:ut,82:219,116:dt,117:ht,118:St},{60:[1,226]},{64:[1,227],67:ut,82:219,116:dt,117:ht,118:St},{66:[1,228],67:ut,82:219,116:dt,117:ht,118:St},{30:229,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},{31:[1,230],67:ut,82:219,116:dt,117:ht,118:St},{67:ut,69:[1,231],71:[1,232],82:219,116:dt,117:ht,118:St},{67:ut,69:[1,234],71:[1,233],82:219,116:dt,117:ht,118:St},t(X,[2,45],{18:156,10:$,40:ot}),t(X,[2,47],{44:yt}),t(ye,[2,75]),t(ye,[2,74]),{62:[1,235],67:ut,82:219,116:dt,117:ht,118:St},t(ye,[2,77]),t(Nr,[2,80]),{77:[1,236],79:198,116:Ve,119:Je},{30:237,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},t(Et,a,{5:238}),t(me,[2,102]),t(P,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},{10:$,18:240},{10:Rt,60:Ft,84:or,92:241,105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},{10:Rt,60:Ft,84:or,92:252,104:[1,253],105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},{10:Rt,60:Ft,84:or,92:254,104:[1,255],105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},{105:[1,256]},{10:Rt,60:Ft,84:or,92:257,105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},{44:g,47:258,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},t(Dt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Dt,[2,116]),t(Dt,[2,118],{10:[1,262]}),t(Dt,[2,119]),t(Ce,[2,56]),t(lt,[2,87]),t(Ce,[2,57]),{51:[1,263],67:ut,82:219,116:dt,117:ht,118:St},t(Ce,[2,64]),t(Ce,[2,59]),t(Ce,[2,60]),t(Ce,[2,61]),{109:[1,264]},t(Ce,[2,63]),t(Ce,[2,65]),{66:[1,265],67:ut,82:219,116:dt,117:ht,118:St},t(Ce,[2,67]),t(Ce,[2,68]),t(Ce,[2,70]),t(Ce,[2,69]),t(Ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ye,[2,78]),{31:[1,266],67:ut,82:219,116:dt,117:ht,118:St},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F,121:A,122:R,123:N,124:M,125:I},t(Ge,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F},t(Dt,[2,121],{106:Ir}),t(ln,[2,130],{108:270,10:Rt,60:Ft,84:or,105:ir,109:xr,110:sr,111:Rr,112:Jt}),t(Or,[2,132]),t(Or,[2,134]),t(Or,[2,135]),t(Or,[2,136]),t(Or,[2,137]),t(Or,[2,138]),t(Or,[2,139]),t(Or,[2,140]),t(Or,[2,141]),t(Dt,[2,122],{106:Ir}),{10:[1,271]},t(Dt,[2,123],{106:Ir}),{10:[1,272]},t(et,[2,129]),t(Dt,[2,105],{106:Ir}),t(Dt,[2,106],{113:113,44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,114:D,115:z,116:F}),t(Dt,[2,110]),t(Dt,[2,112],{10:[1,273]}),t(Dt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:B,9:q,11:V,21:278},t(P,[2,34]),t(Ge,[2,52]),{10:Rt,60:Ft,84:or,105:ir,107:279,108:243,109:xr,110:sr,111:Rr,112:Jt},t(Or,[2,133]),{14:ie,44:K,60:se,89:te,101:280,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re,120:88},{14:ie,44:K,60:se,89:te,101:281,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re,120:88},{98:[1,282]},t(Dt,[2,120]),t(Ce,[2,58]),{30:283,67:ut,80:le,81:At,82:172,116:dt,117:ht,118:St},t(Ce,[2,66]),t(Et,a,{5:284}),t(ln,[2,131],{108:270,10:Rt,60:Ft,84:or,105:ir,109:xr,110:sr,111:Rr,112:Jt}),t(Dt,[2,126],{120:168,10:[1,285],14:ie,44:K,60:se,89:te,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re}),t(Dt,[2,127],{120:168,10:[1,286],14:ie,44:K,60:se,89:te,105:Z,106:ee,109:ne,111:oe,114:fe,115:Ae,116:Re}),t(Dt,[2,114]),{31:[1,287],67:ut,82:219,116:dt,117:ht,118:St},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:D,115:z,116:F,121:A,122:R,123:N,124:M,125:I},{10:Rt,60:Ft,84:or,92:289,105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},{10:Rt,60:Ft,84:or,92:290,105:ir,107:242,108:243,109:xr,110:sr,111:Rr,112:Jt},t(Ce,[2,62]),t(P,[2,33]),t(Dt,[2,124],{106:Ir}),t(Dt,[2,125],{106:Ir})],defaultActions:{},parseError:T(function($t,bt){if(bt.recoverable)this.trace($t);else{var Bt=new Error($t);throw Bt.hash=bt,Bt}},"parseError"),parse:T(function($t){var bt=this,Bt=[0],Tt=[],pr=[null],ke=[],Ri=this.table,Ne="",In=0,dp=0,Jv=2,e2=1,Tu=ke.slice.call(arguments,1),zn=Object.create(this.lexer),il={yy:{}};for(var sc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,sc)&&(il.yy[sc]=this.yy[sc]);zn.setInput($t,il.yy),il.yy.lexer=zn,il.yy.parser=this,typeof zn.yylloc>"u"&&(zn.yylloc={});var oc=zn.yylloc;ke.push(oc);var fp=zn.options&&zn.options.ranges;typeof il.yy.parseError=="function"?this.parseError=il.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(Jr){Bt.length=Bt.length-2*Jr,pr.length=pr.length-Jr,ke.length=ke.length-Jr}T(Ot,"popStack");function _e(){var Jr;return Jr=Tt.pop()||zn.lex()||e2,typeof Jr!="number"&&(Jr instanceof Array&&(Tt=Jr,Jr=Tt.pop()),Jr=bt.symbols_[Jr]||Jr),Jr}T(_e,"lex");for(var Qe,xt,Vt,dr,fr={},mn,yn,Ba,Kr;;){if(xt=Bt[Bt.length-1],this.defaultActions[xt]?Vt=this.defaultActions[xt]:((Qe===null||typeof Qe>"u")&&(Qe=_e()),Vt=Ri[xt]&&Ri[xt][Qe]),typeof Vt>"u"||!Vt.length||!Vt[0]){var aa="";Kr=[];for(mn in Ri[xt])this.terminals_[mn]&&mn>Jv&&Kr.push("'"+this.terminals_[mn]+"'");zn.showPosition?aa="Parse error on line "+(In+1)+`: -`+zn.showPosition()+` -Expecting `+Kr.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":aa="Parse error on line "+(In+1)+": Unexpected "+(Qe==e2?"end of input":"'"+(this.terminals_[Qe]||Qe)+"'"),this.parseError(aa,{text:zn.match,token:this.terminals_[Qe]||Qe,line:zn.yylineno,loc:oc,expected:Kr})}if(Vt[0]instanceof Array&&Vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+Qe);switch(Vt[0]){case 1:Bt.push(Qe),pr.push(zn.yytext),ke.push(zn.yylloc),Bt.push(Vt[1]),Qe=null,dp=zn.yyleng,Ne=zn.yytext,In=zn.yylineno,oc=zn.yylloc;break;case 2:if(yn=this.productions_[Vt[1]][1],fr.$=pr[pr.length-yn],fr._$={first_line:ke[ke.length-(yn||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(yn||1)].first_column,last_column:ke[ke.length-1].last_column},fp&&(fr._$.range=[ke[ke.length-(yn||1)].range[0],ke[ke.length-1].range[1]]),dr=this.performAction.apply(fr,[Ne,dp,In,il.yy,Vt[1],pr,ke].concat(Tu)),typeof dr<"u")return dr;yn&&(Bt=Bt.slice(0,-1*yn*2),pr=pr.slice(0,-1*yn),ke=ke.slice(0,-1*yn)),Bt.push(this.productions_[Vt[1]][0]),pr.push(fr.$),ke.push(fr._$),Ba=Ri[Bt[Bt.length-2]][Bt[Bt.length-1]],Bt.push(Ba);break;case 3:return!0}}return!0},"parse")},Pa=(function(){var _i={EOF:1,parseError:T(function(bt,Bt){if(this.yy.parser)this.yy.parser.parseError(bt,Bt);else throw new Error(bt)},"parseError"),setInput:T(function($t,bt){return this.yy=bt||this.yy||{},this._input=$t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var $t=this._input[0];this.yytext+=$t,this.yyleng++,this.offset++,this.match+=$t,this.matched+=$t;var bt=$t.match(/(?:\r\n?|\n).*/g);return bt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$t},"input"),unput:T(function($t){var bt=$t.length,Bt=$t.split(/(?:\r\n?|\n)/g);this._input=$t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-bt),this.offset-=bt;var Tt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Bt.length-1&&(this.yylineno-=Bt.length-1);var pr=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Bt?(Bt.length===Tt.length?this.yylloc.first_column:0)+Tt[Tt.length-Bt.length].length-Bt[0].length:this.yylloc.first_column-bt},this.options.ranges&&(this.yylloc.range=[pr[0],pr[0]+this.yyleng-bt]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function($t){this.unput(this.match.slice($t))},"less"),pastInput:T(function(){var $t=this.matched.substr(0,this.matched.length-this.match.length);return($t.length>20?"...":"")+$t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var $t=this.match;return $t.length<20&&($t+=this._input.substr(0,20-$t.length)),($t.substr(0,20)+($t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var $t=this.pastInput(),bt=new Array($t.length+1).join("-");return $t+this.upcomingInput()+` -`+bt+"^"},"showPosition"),test_match:T(function($t,bt){var Bt,Tt,pr;if(this.options.backtrack_lexer&&(pr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pr.yylloc.range=this.yylloc.range.slice(0))),Tt=$t[0].match(/(?:\r\n?|\n).*/g),Tt&&(this.yylineno+=Tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Tt?Tt[Tt.length-1].length-Tt[Tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$t[0].length},this.yytext+=$t[0],this.match+=$t[0],this.matches=$t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice($t[0].length),this.matched+=$t[0],Bt=this.performAction.call(this,this.yy,this,bt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Bt)return Bt;if(this._backtrack){for(var ke in pr)this[ke]=pr[ke];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $t,bt,Bt,Tt;this._more||(this.yytext="",this.match="");for(var pr=this._currentRules(),ke=0;kebt[0].length)){if(bt=Bt,Tt=ke,this.options.backtrack_lexer){if($t=this.test_match(Bt,pr[ke]),$t!==!1)return $t;if(this._backtrack){bt=!1;continue}else return!1}else if(!this.options.flex)break}return bt?($t=this.test_match(bt,pr[Tt]),$t!==!1?$t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var bt=this.next();return bt||this.lex()},"lex"),begin:T(function(bt){this.conditionStack.push(bt)},"begin"),popState:T(function(){var bt=this.conditionStack.length-1;return bt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(bt){return bt=this.conditionStack.length-1-Math.abs(bt||0),bt>=0?this.conditionStack[bt]:"INITIAL"},"topState"),pushState:T(function(bt){this.begin(bt)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(bt,Bt,Tt,pr){switch(Tt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Bt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const ke=/\n\s*/g;return Bt.yytext=Bt.yytext.replace(ke,"
    "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return bt.lex.firstGraph()&&this.begin("dir"),12;case 36:return bt.lex.firstGraph()&&this.begin("dir"),12;case 37:return bt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return _i})();Ca.lexer=Pa;function Wi(){this.yy={}}return T(Wi,"Parser"),Wi.prototype=Ca,Ca.Parser=Wi,new Wi})();_I.parser=_I;var Wte=_I,Ute=Object.assign({},Wte);Ute.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return Wte.parse(e)};var CUe=Ute,kUe=T((t,e)=>{const r=w6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),EUe=T(t=>`.label { +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;he.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Ve().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Er.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Er.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=QD();mt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=mt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(zc.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),mt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Ve(),zn()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=b(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(x){const w=typeof x;return x.stmt&&x.stmt==="dir"?(v=x.value,!1):x.trim()===""?!1:w in m?m[w].hasOwnProperty(x)?!1:m[w][x]=!0:y.includes(x)?!1:y.push(x)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Ve().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Ve().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Ve(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:I0(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return WG.flowchart}},b(R1,"FlowDB"),R1),bZe=b(function(t,e){return e.db.getClasses()},"getClasses"),xZe=b(async function(t,e,r,n,i){var f;he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=Ve();n.db.setDiagramId(e),he.debug("Before getData: ");const l=n.db.getData();he.debug("Data: ",l);const u=Wg(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=ax(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&he.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,he.debug("REF1:",l),await B0(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Er.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),Nf(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),TZe={getClasses:bZe,draw:xZe},sN=(function(){var t=b(function(Wr,xt,ht,Rt){for(ht=ht||{},Rt=Wr.length;Rt--;ht[Wr[Rt]]=xt);return ht},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],x=[1,32],w=[1,33],C=[1,45],k=[1,47],S=[1,43],E=[1,48],L=[1,44],M=[1,51],I=[1,46],P=[1,52],$=[1,53],_=[1,34],R=[1,35],O=[1,36],D=[1,37],N=[1,38],B=[1,58],F=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],G=[1,62],z=[1,61],W=[1,63],V=[8,9,11,75,77,78],H=[1,79],te=[1,92],Y=[1,97],se=[1,96],J=[1,93],Z=[1,89],ee=[1,95],re=[1,91],ge=[1,98],ae=[1,94],_e=[1,99],Fe=[1,90],qe=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],de=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ce=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],me=[44,60,89,102,105,106,109,111,114,115,116],$e=[1,122],we=[1,123],Le=[1,125],Ye=[1,124],ce=[44,60,62,74,89,102,105,106,109,111,114,115,116],ye=[1,134],ke=[1,148],le=[1,149],pe=[1,150],U=[1,151],oe=[1,136],Q=[1,138],fe=[1,142],j=[1,143],Be=[1,144],Se=[1,145],He=[1,146],De=[1,147],We=[1,152],Ne=[1,153],Ze=[1,132],Pe=[1,133],nt=[1,140],Ie=[1,135],pt=[1,139],Re=[1,137],kt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],bt=[1,155],lt=[1,157],Nt=[8,9,11],Ct=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],dt=[1,177],ve=[1,173],_t=[1,174],gt=[1,178],ft=[1,175],Et=[1,176],Nr=[77,116,119],Ae=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],tt=[10,106],ct=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Mt=[1,248],Wt=[1,246],gr=[1,250],lr=[1,244],Tr=[1,245],fr=[1,247],Or=[1,249],ir=[1,251],cr=[1,269],Vr=[8,9,11,106],at=[8,9,10,11,60,84,105,106,109,110,111,112],vt={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(xt,ht,Rt,ut,Kt,Me,Yr){var ze=Me.length-1;switch(Kt){case 2:this.$=[];break;case 3:(!Array.isArray(Me[ze])||Me[ze].length>0)&&Me[ze-1].push(Me[ze]),this.$=Me[ze-1];break;case 4:case 183:this.$=Me[ze];break;case 11:ut.setDirection("TB"),this.$="TB";break;case 12:ut.setDirection(Me[ze-1]),this.$=Me[ze-1];break;case 27:this.$=Me[ze-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=ut.addSubGraph(Me[ze-6],Me[ze-1],Me[ze-4]);break;case 34:this.$=ut.addSubGraph(Me[ze-3],Me[ze-1],Me[ze-3]);break;case 35:this.$=ut.addSubGraph(void 0,Me[ze-1],void 0);break;case 37:this.$=Me[ze].trim(),ut.setAccTitle(this.$);break;case 38:case 39:this.$=Me[ze].trim(),ut.setAccDescription(this.$);break;case 43:this.$=Me[ze-1]+Me[ze];break;case 44:this.$=Me[ze];break;case 45:ut.addVertex(Me[ze-1][Me[ze-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Me[ze]),ut.addLink(Me[ze-3].stmt,Me[ze-1],Me[ze-2]),this.$={stmt:Me[ze-1],nodes:Me[ze-1].concat(Me[ze-3].nodes)};break;case 46:ut.addLink(Me[ze-2].stmt,Me[ze],Me[ze-1]),this.$={stmt:Me[ze],nodes:Me[ze].concat(Me[ze-2].nodes)};break;case 47:ut.addLink(Me[ze-3].stmt,Me[ze-1],Me[ze-2]),this.$={stmt:Me[ze-1],nodes:Me[ze-1].concat(Me[ze-3].nodes)};break;case 48:this.$={stmt:Me[ze-1],nodes:Me[ze-1]};break;case 49:ut.addVertex(Me[ze-1][Me[ze-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Me[ze]),this.$={stmt:Me[ze-1],nodes:Me[ze-1],shapeData:Me[ze]};break;case 50:this.$={stmt:Me[ze],nodes:Me[ze]};break;case 51:this.$=[Me[ze]];break;case 52:ut.addVertex(Me[ze-5][Me[ze-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Me[ze-4]),this.$=Me[ze-5].concat(Me[ze]);break;case 53:this.$=Me[ze-4].concat(Me[ze]);break;case 54:this.$=Me[ze];break;case 55:this.$=Me[ze-2],ut.setClass(Me[ze-2],Me[ze]);break;case 56:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"square");break;case 57:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"doublecircle");break;case 58:this.$=Me[ze-5],ut.addVertex(Me[ze-5],Me[ze-2],"circle");break;case 59:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"ellipse");break;case 60:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"stadium");break;case 61:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"subroutine");break;case 62:this.$=Me[ze-7],ut.addVertex(Me[ze-7],Me[ze-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Me[ze-5],Me[ze-3]]]));break;case 63:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"cylinder");break;case 64:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"round");break;case 65:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"diamond");break;case 66:this.$=Me[ze-5],ut.addVertex(Me[ze-5],Me[ze-2],"hexagon");break;case 67:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"odd");break;case 68:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"trapezoid");break;case 69:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"inv_trapezoid");break;case 70:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"lean_right");break;case 71:this.$=Me[ze-3],ut.addVertex(Me[ze-3],Me[ze-1],"lean_left");break;case 72:this.$=Me[ze],ut.addVertex(Me[ze]);break;case 73:Me[ze-1].text=Me[ze],this.$=Me[ze-1];break;case 74:case 75:Me[ze-2].text=Me[ze-1],this.$=Me[ze-2];break;case 76:this.$=Me[ze];break;case 77:var Fr=ut.destructLink(Me[ze],Me[ze-2]);this.$={type:Fr.type,stroke:Fr.stroke,length:Fr.length,text:Me[ze-1]};break;case 78:var Fr=ut.destructLink(Me[ze],Me[ze-2]);this.$={type:Fr.type,stroke:Fr.stroke,length:Fr.length,text:Me[ze-1],id:Me[ze-3]};break;case 79:this.$={text:Me[ze],type:"text"};break;case 80:this.$={text:Me[ze-1].text+""+Me[ze],type:Me[ze-1].type};break;case 81:this.$={text:Me[ze],type:"string"};break;case 82:this.$={text:Me[ze],type:"markdown"};break;case 83:var Fr=ut.destructLink(Me[ze]);this.$={type:Fr.type,stroke:Fr.stroke,length:Fr.length};break;case 84:var Fr=ut.destructLink(Me[ze]);this.$={type:Fr.type,stroke:Fr.stroke,length:Fr.length,id:Me[ze-1]};break;case 85:this.$=Me[ze-1];break;case 86:this.$={text:Me[ze],type:"text"};break;case 87:this.$={text:Me[ze-1].text+""+Me[ze],type:Me[ze-1].type};break;case 88:this.$={text:Me[ze],type:"string"};break;case 89:case 104:this.$={text:Me[ze],type:"markdown"};break;case 101:this.$={text:Me[ze],type:"text"};break;case 102:this.$={text:Me[ze-1].text+""+Me[ze],type:Me[ze-1].type};break;case 103:this.$={text:Me[ze],type:"text"};break;case 105:this.$=Me[ze-4],ut.addClass(Me[ze-2],Me[ze]);break;case 106:this.$=Me[ze-4],ut.setClass(Me[ze-2],Me[ze]);break;case 107:case 115:this.$=Me[ze-1],ut.setClickEvent(Me[ze-1],Me[ze]);break;case 108:case 116:this.$=Me[ze-3],ut.setClickEvent(Me[ze-3],Me[ze-2]),ut.setTooltip(Me[ze-3],Me[ze]);break;case 109:this.$=Me[ze-2],ut.setClickEvent(Me[ze-2],Me[ze-1],Me[ze]);break;case 110:this.$=Me[ze-4],ut.setClickEvent(Me[ze-4],Me[ze-3],Me[ze-2]),ut.setTooltip(Me[ze-4],Me[ze]);break;case 111:this.$=Me[ze-2],ut.setLink(Me[ze-2],Me[ze]);break;case 112:this.$=Me[ze-4],ut.setLink(Me[ze-4],Me[ze-2]),ut.setTooltip(Me[ze-4],Me[ze]);break;case 113:this.$=Me[ze-4],ut.setLink(Me[ze-4],Me[ze-2],Me[ze]);break;case 114:this.$=Me[ze-6],ut.setLink(Me[ze-6],Me[ze-4],Me[ze]),ut.setTooltip(Me[ze-6],Me[ze-2]);break;case 117:this.$=Me[ze-1],ut.setLink(Me[ze-1],Me[ze]);break;case 118:this.$=Me[ze-3],ut.setLink(Me[ze-3],Me[ze-2]),ut.setTooltip(Me[ze-3],Me[ze]);break;case 119:this.$=Me[ze-3],ut.setLink(Me[ze-3],Me[ze-2],Me[ze]);break;case 120:this.$=Me[ze-5],ut.setLink(Me[ze-5],Me[ze-4],Me[ze]),ut.setTooltip(Me[ze-5],Me[ze-2]);break;case 121:this.$=Me[ze-4],ut.addVertex(Me[ze-2],void 0,void 0,Me[ze]);break;case 122:this.$=Me[ze-4],ut.updateLink([Me[ze-2]],Me[ze]);break;case 123:this.$=Me[ze-4],ut.updateLink(Me[ze-2],Me[ze]);break;case 124:this.$=Me[ze-8],ut.updateLinkInterpolate([Me[ze-6]],Me[ze-2]),ut.updateLink([Me[ze-6]],Me[ze]);break;case 125:this.$=Me[ze-8],ut.updateLinkInterpolate(Me[ze-6],Me[ze-2]),ut.updateLink(Me[ze-6],Me[ze]);break;case 126:this.$=Me[ze-6],ut.updateLinkInterpolate([Me[ze-4]],Me[ze]);break;case 127:this.$=Me[ze-6],ut.updateLinkInterpolate(Me[ze-4],Me[ze]);break;case 128:case 130:this.$=[Me[ze]];break;case 129:case 131:Me[ze-2].push(Me[ze]),this.$=Me[ze-2];break;case 133:this.$=Me[ze-1]+Me[ze];break;case 181:this.$=Me[ze];break;case 182:this.$=Me[ze-1]+""+Me[ze];break;case 184:this.$=Me[ze-1]+""+Me[ze];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:x,88:w,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$,121:_,122:R,123:O,124:D,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:B,15:54,18:57},t(F,[2,3]),t(F,[2,4]),t(F,[2,5]),t(F,[2,6]),t(F,[2,7]),t(F,[2,8]),{8:G,9:z,11:W,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:G,9:z,11:W,21:68},{8:G,9:z,11:W,21:69},{8:G,9:z,11:W,21:70},{8:G,9:z,11:W,21:71},{8:G,9:z,11:W,21:72},{8:G,9:z,10:[1,73],11:W,21:74},t(F,[2,36]),{35:[1,75]},{37:[1,76]},t(F,[2,39]),t(V,[2,50],{18:77,39:78,10:B,40:H}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:te,44:Y,60:se,80:[1,87],89:J,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe,120:88},t(F,[2,185]),t(F,[2,186]),t(F,[2,187]),t(F,[2,188]),t(F,[2,189]),t(qe,[2,51]),t(qe,[2,54],{46:[1,100]}),t(ue,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:k,105:S,106:E,109:L,111:M,114:I,115:P,116:$}),t(de,[2,181]),t(de,[2,142]),t(de,[2,143]),t(de,[2,144]),t(de,[2,145]),t(de,[2,146]),t(de,[2,147]),t(de,[2,148]),t(de,[2,149]),t(de,[2,150]),t(de,[2,151]),t(de,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Ce,[2,26],{18:115,10:B}),t(F,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},t(F,[2,40]),t(F,[2,41]),t(F,[2,42]),t(me,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:$e,81:we,116:Le,119:Ye},{75:[1,126],77:[1,127]},t(ce,[2,83]),t(F,[2,28]),t(F,[2,29]),t(F,[2,30]),t(F,[2,31]),t(F,[2,32]),{10:ye,12:ke,14:le,27:pe,28:128,32:U,44:oe,60:Q,75:fe,80:[1,130],81:[1,131],83:141,84:j,85:Be,86:Se,87:He,88:De,89:We,90:Ne,91:129,105:Ze,109:Pe,111:nt,114:Ie,115:pt,116:Re},t(kt,a,{5:154}),t(F,[2,37]),t(F,[2,38]),t(V,[2,48],{44:bt}),t(V,[2,49],{18:156,10:B,40:lt}),t(qe,[2,44]),{44:g,47:158,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},{44:g,47:163,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},t(Nt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Nt,[2,115],{120:168,10:[1,167],14:te,44:Y,60:se,89:J,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe}),t(Nt,[2,117],{10:[1,169]}),t(Ct,[2,183]),t(Ct,[2,170]),t(Ct,[2,171]),t(Ct,[2,172]),t(Ct,[2,173]),t(Ct,[2,174]),t(Ct,[2,175]),t(Ct,[2,176]),t(Ct,[2,177]),t(Ct,[2,178]),t(Ct,[2,179]),t(Ct,[2,180]),{44:g,47:170,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},{30:171,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:179,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:181,50:[1,180],67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:182,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:183,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:184,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{109:[1,185]},{30:186,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:187,65:[1,188],67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:189,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:190,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{30:191,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},t(de,[2,182]),t(i,[2,20]),t(Ce,[2,25]),t(V,[2,46],{39:192,18:193,10:B,40:H}),t(me,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{77:[1,197],79:198,116:Le,119:Ye},t(Nr,[2,79]),t(Nr,[2,81]),t(Nr,[2,82]),t(Nr,[2,168]),t(Nr,[2,169]),{76:199,79:121,80:$e,81:we,116:Le,119:Ye},t(ce,[2,84]),{8:G,9:z,10:ye,11:W,12:ke,14:le,21:201,27:pe,29:[1,200],32:U,44:oe,60:Q,75:fe,83:141,84:j,85:Be,86:Se,87:He,88:De,89:We,90:Ne,91:202,105:Ze,109:Pe,111:nt,114:Ie,115:pt,116:Re},t(Ae,[2,101]),t(Ae,[2,103]),t(Ae,[2,104]),t(Ae,[2,157]),t(Ae,[2,158]),t(Ae,[2,159]),t(Ae,[2,160]),t(Ae,[2,161]),t(Ae,[2,162]),t(Ae,[2,163]),t(Ae,[2,164]),t(Ae,[2,165]),t(Ae,[2,166]),t(Ae,[2,167]),t(Ae,[2,90]),t(Ae,[2,91]),t(Ae,[2,92]),t(Ae,[2,93]),t(Ae,[2,94]),t(Ae,[2,95]),t(Ae,[2,96]),t(Ae,[2,97]),t(Ae,[2,98]),t(Ae,[2,99]),t(Ae,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:x,88:w,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$,121:_,122:R,123:O,124:D,125:N},{10:B,18:204},{44:[1,205]},t(qe,[2,43]),{10:[1,206],44:g,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:113,114:I,115:P,116:$},{10:[1,207]},{10:[1,208],106:[1,209]},t(tt,[2,128]),{10:[1,210],44:g,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:113,114:I,115:P,116:$},{10:[1,211],44:g,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:113,114:I,115:P,116:$},{80:[1,212]},t(Nt,[2,109],{10:[1,213]}),t(Nt,[2,111],{10:[1,214]}),{80:[1,215]},t(Ct,[2,184]),{80:[1,216],98:[1,217]},t(qe,[2,55],{113:113,44:g,60:m,89:C,102:k,105:S,106:E,109:L,111:M,114:I,115:P,116:$}),{31:[1,218],67:dt,82:219,116:gt,117:ft,118:Et},t(ct,[2,86]),t(ct,[2,88]),t(ct,[2,89]),t(ct,[2,153]),t(ct,[2,154]),t(ct,[2,155]),t(ct,[2,156]),{49:[1,220],67:dt,82:219,116:gt,117:ft,118:Et},{30:221,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{51:[1,222],67:dt,82:219,116:gt,117:ft,118:Et},{53:[1,223],67:dt,82:219,116:gt,117:ft,118:Et},{55:[1,224],67:dt,82:219,116:gt,117:ft,118:Et},{57:[1,225],67:dt,82:219,116:gt,117:ft,118:Et},{60:[1,226]},{64:[1,227],67:dt,82:219,116:gt,117:ft,118:Et},{66:[1,228],67:dt,82:219,116:gt,117:ft,118:Et},{30:229,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},{31:[1,230],67:dt,82:219,116:gt,117:ft,118:Et},{67:dt,69:[1,231],71:[1,232],82:219,116:gt,117:ft,118:Et},{67:dt,69:[1,234],71:[1,233],82:219,116:gt,117:ft,118:Et},t(V,[2,45],{18:156,10:B,40:lt}),t(V,[2,47],{44:bt}),t(me,[2,75]),t(me,[2,74]),{62:[1,235],67:dt,82:219,116:gt,117:ft,118:Et},t(me,[2,77]),t(Nr,[2,80]),{77:[1,236],79:198,116:Le,119:Ye},{30:237,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},t(kt,a,{5:238}),t(Ae,[2,102]),t(F,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},{10:B,18:240},{10:Mt,60:Wt,84:gr,92:241,105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},{10:Mt,60:Wt,84:gr,92:252,104:[1,253],105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},{10:Mt,60:Wt,84:gr,92:254,104:[1,255],105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},{105:[1,256]},{10:Mt,60:Wt,84:gr,92:257,105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},{44:g,47:258,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},t(Nt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Nt,[2,116]),t(Nt,[2,118],{10:[1,262]}),t(Nt,[2,119]),t(ue,[2,56]),t(ct,[2,87]),t(ue,[2,57]),{51:[1,263],67:dt,82:219,116:gt,117:ft,118:Et},t(ue,[2,64]),t(ue,[2,59]),t(ue,[2,60]),t(ue,[2,61]),{109:[1,264]},t(ue,[2,63]),t(ue,[2,65]),{66:[1,265],67:dt,82:219,116:gt,117:ft,118:Et},t(ue,[2,67]),t(ue,[2,68]),t(ue,[2,70]),t(ue,[2,69]),t(ue,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(me,[2,78]),{31:[1,266],67:dt,82:219,116:gt,117:ft,118:Et},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:x,88:w,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$,121:_,122:R,123:O,124:D,125:N},t(qe,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$},t(Nt,[2,121],{106:cr}),t(Vr,[2,130],{108:270,10:Mt,60:Wt,84:gr,105:lr,109:Tr,110:fr,111:Or,112:ir}),t(at,[2,132]),t(at,[2,134]),t(at,[2,135]),t(at,[2,136]),t(at,[2,137]),t(at,[2,138]),t(at,[2,139]),t(at,[2,140]),t(at,[2,141]),t(Nt,[2,122],{106:cr}),{10:[1,271]},t(Nt,[2,123],{106:cr}),{10:[1,272]},t(tt,[2,129]),t(Nt,[2,105],{106:cr}),t(Nt,[2,106],{113:113,44:g,60:m,89:C,102:k,105:S,106:E,109:L,111:M,114:I,115:P,116:$}),t(Nt,[2,110]),t(Nt,[2,112],{10:[1,273]}),t(Nt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:G,9:z,11:W,21:278},t(F,[2,34]),t(qe,[2,52]),{10:Mt,60:Wt,84:gr,105:lr,107:279,108:243,109:Tr,110:fr,111:Or,112:ir},t(at,[2,133]),{14:te,44:Y,60:se,89:J,101:280,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe,120:88},{14:te,44:Y,60:se,89:J,101:281,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe,120:88},{98:[1,282]},t(Nt,[2,120]),t(ue,[2,58]),{30:283,67:dt,80:ve,81:_t,82:172,116:gt,117:ft,118:Et},t(ue,[2,66]),t(kt,a,{5:284}),t(Vr,[2,131],{108:270,10:Mt,60:Wt,84:gr,105:lr,109:Tr,110:fr,111:Or,112:ir}),t(Nt,[2,126],{120:168,10:[1,285],14:te,44:Y,60:se,89:J,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe}),t(Nt,[2,127],{120:168,10:[1,286],14:te,44:Y,60:se,89:J,105:Z,106:ee,109:re,111:ge,114:ae,115:_e,116:Fe}),t(Nt,[2,114]),{31:[1,287],67:dt,82:219,116:gt,117:ft,118:Et},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:x,88:w,89:C,102:k,105:S,106:E,109:L,111:M,113:42,114:I,115:P,116:$,121:_,122:R,123:O,124:D,125:N},{10:Mt,60:Wt,84:gr,92:289,105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},{10:Mt,60:Wt,84:gr,92:290,105:lr,107:242,108:243,109:Tr,110:fr,111:Or,112:ir},t(ue,[2,62]),t(F,[2,33]),t(Nt,[2,124],{106:cr}),t(Nt,[2,125],{106:cr})],defaultActions:{},parseError:b(function(xt,ht){if(ht.recoverable)this.trace(xt);else{var Rt=new Error(xt);throw Rt.hash=ht,Rt}},"parseError"),parse:b(function(xt){var ht=this,Rt=[0],ut=[],Kt=[null],Me=[],Yr=this.table,ze="",Fr=0,nn=0,_i=2,ln=1,cn=Me.slice.call(arguments,1),Xr=Object.create(this.lexer),Ea={yy:{}};for(var Bs in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bs)&&(Ea.yy[Bs]=this.yy[Bs]);Xr.setInput(xt,Ea.yy),Ea.yy.lexer=Xr,Ea.yy.parser=this,typeof Xr.yylloc>"u"&&(Xr.yylloc={});var io=Xr.yylloc;Me.push(io);var Oc=Xr.options&&Xr.options.ranges;typeof Ea.yy.parseError=="function"?this.parseError=Ea.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Bt(bn){Rt.length=Rt.length-2*bn,Kt.length=Kt.length-bn,Me.length=Me.length-bn}b(Bt,"popStack");function Oe(){var bn;return bn=ut.pop()||Xr.lex()||ln,typeof bn!="number"&&(bn instanceof Array&&(ut=bn,bn=ut.pop()),bn=ht.symbols_[bn]||bn),bn}b(Oe,"lex");for(var rt,St,Ut,er,xr={},Dn,Nn,os,fn;;){if(St=Rt[Rt.length-1],this.defaultActions[St]?Ut=this.defaultActions[St]:((rt===null||typeof rt>"u")&&(rt=Oe()),Ut=Yr[St]&&Yr[St][rt]),typeof Ut>"u"||!Ut.length||!Ut[0]){var Aa="";fn=[];for(Dn in Yr[St])this.terminals_[Dn]&&Dn>_i&&fn.push("'"+this.terminals_[Dn]+"'");Xr.showPosition?Aa="Parse error on line "+(Fr+1)+`: +`+Xr.showPosition()+` +Expecting `+fn.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":Aa="Parse error on line "+(Fr+1)+": Unexpected "+(rt==ln?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(Aa,{text:Xr.match,token:this.terminals_[rt]||rt,line:Xr.yylineno,loc:io,expected:fn})}if(Ut[0]instanceof Array&&Ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+St+", token: "+rt);switch(Ut[0]){case 1:Rt.push(rt),Kt.push(Xr.yytext),Me.push(Xr.yylloc),Rt.push(Ut[1]),rt=null,nn=Xr.yyleng,ze=Xr.yytext,Fr=Xr.yylineno,io=Xr.yylloc;break;case 2:if(Nn=this.productions_[Ut[1]][1],xr.$=Kt[Kt.length-Nn],xr._$={first_line:Me[Me.length-(Nn||1)].first_line,last_line:Me[Me.length-1].last_line,first_column:Me[Me.length-(Nn||1)].first_column,last_column:Me[Me.length-1].last_column},Oc&&(xr._$.range=[Me[Me.length-(Nn||1)].range[0],Me[Me.length-1].range[1]]),er=this.performAction.apply(xr,[ze,nn,Fr,Ea.yy,Ut[1],Kt,Me].concat(cn)),typeof er<"u")return er;Nn&&(Rt=Rt.slice(0,-1*Nn*2),Kt=Kt.slice(0,-1*Nn),Me=Me.slice(0,-1*Nn)),Rt.push(this.productions_[Ut[1]][0]),Kt.push(xr.$),Me.push(xr._$),os=Yr[Rt[Rt.length-2]][Rt[Rt.length-1]],Rt.push(os);break;case 3:return!0}}return!0},"parse")},zt=(function(){var Wr={EOF:1,parseError:b(function(ht,Rt){if(this.yy.parser)this.yy.parser.parseError(ht,Rt);else throw new Error(ht)},"parseError"),setInput:b(function(xt,ht){return this.yy=ht||this.yy||{},this._input=xt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var xt=this._input[0];this.yytext+=xt,this.yyleng++,this.offset++,this.match+=xt,this.matched+=xt;var ht=xt.match(/(?:\r\n?|\n).*/g);return ht?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),xt},"input"),unput:b(function(xt){var ht=xt.length,Rt=xt.split(/(?:\r\n?|\n)/g);this._input=xt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ht),this.offset-=ht;var ut=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Rt.length-1&&(this.yylineno-=Rt.length-1);var Kt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Rt?(Rt.length===ut.length?this.yylloc.first_column:0)+ut[ut.length-Rt.length].length-Rt[0].length:this.yylloc.first_column-ht},this.options.ranges&&(this.yylloc.range=[Kt[0],Kt[0]+this.yyleng-ht]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(xt){this.unput(this.match.slice(xt))},"less"),pastInput:b(function(){var xt=this.matched.substr(0,this.matched.length-this.match.length);return(xt.length>20?"...":"")+xt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var xt=this.match;return xt.length<20&&(xt+=this._input.substr(0,20-xt.length)),(xt.substr(0,20)+(xt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var xt=this.pastInput(),ht=new Array(xt.length+1).join("-");return xt+this.upcomingInput()+` +`+ht+"^"},"showPosition"),test_match:b(function(xt,ht){var Rt,ut,Kt;if(this.options.backtrack_lexer&&(Kt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Kt.yylloc.range=this.yylloc.range.slice(0))),ut=xt[0].match(/(?:\r\n?|\n).*/g),ut&&(this.yylineno+=ut.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ut?ut[ut.length-1].length-ut[ut.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+xt[0].length},this.yytext+=xt[0],this.match+=xt[0],this.matches=xt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(xt[0].length),this.matched+=xt[0],Rt=this.performAction.call(this,this.yy,this,ht,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Rt)return Rt;if(this._backtrack){for(var Me in Kt)this[Me]=Kt[Me];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var xt,ht,Rt,ut;this._more||(this.yytext="",this.match="");for(var Kt=this._currentRules(),Me=0;Meht[0].length)){if(ht=Rt,ut=Me,this.options.backtrack_lexer){if(xt=this.test_match(Rt,Kt[Me]),xt!==!1)return xt;if(this._backtrack){ht=!1;continue}else return!1}else if(!this.options.flex)break}return ht?(xt=this.test_match(ht,Kt[ut]),xt!==!1?xt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var ht=this.next();return ht||this.lex()},"lex"),begin:b(function(ht){this.conditionStack.push(ht)},"begin"),popState:b(function(){var ht=this.conditionStack.length-1;return ht>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(ht){return ht=this.conditionStack.length-1-Math.abs(ht||0),ht>=0?this.conditionStack[ht]:"INITIAL"},"topState"),pushState:b(function(ht){this.begin(ht)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(ht,Rt,ut,Kt){switch(ut){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Rt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Me=/\n\s*/g;return Rt.yytext=Rt.yytext.replace(Me,"
    "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return ht.lex.firstGraph()&&this.begin("dir"),12;case 36:return ht.lex.firstGraph()&&this.begin("dir"),12;case 37:return ht.lex.firstGraph()&&this.begin("dir"),12;case 38:return ht.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Wr})();vt.lexer=zt;function br(){this.yy={}}return b(br,"Parser"),br.prototype=vt,vt.Parser=br,new br})();sN.parser=sN;var Dse=sN,Nse=Object.assign({},Dse);Nse.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return Dse.parse(e)};var wZe=Nse,CZe=b((t,e)=>{const r=X6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tl(n,i,a,e)},"fade"),SZe=b(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -962,12 +967,6 @@ Expecting `+Kr.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":aa="Parse erro .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { text-anchor: middle; } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } .node .katex path { fill: #000; @@ -1018,7 +1017,7 @@ Expecting `+Kr.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":aa="Parse erro /* For html labels only */ .labelBkg { - background-color: ${kUe(t.edgeLabelBackground,.5)}; + background-color: ${CZe(t.edgeLabelBackground,.5)}; // background-color: } @@ -1077,13 +1076,20 @@ Expecting `+Kr.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":aa="Parse erro } text-align: center; } - ${vx()} -`,"getStyles"),SUe=EUe,AUe={parser:CUe,get db(){return new bUe},renderer:wUe,styles:SUe,init:T(t=>{t.flowchart||(t.flowchart={}),t.layout&&q6({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,q6({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const RI=Object.freeze(Object.defineProperty({__proto__:null,diagram:AUe},Symbol.toStringTag,{value:"Module"}));var LI=(function(){var t=T(function(Ae,Re,Ge,Ce){for(Ge=Ge||{},Ce=Ae.length;Ce--;Ge[Ae[Ce]]=Re);return Ge},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],x=[1,36],b=[1,37],w=[1,38],k=[1,39],S=[1,40],C=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],_=[1,45],L=[1,46],O=[1,55],D=[40,48,50,51,52,70,71],z=[1,66],F=[1,64],A=[1,61],R=[1,65],N=[1,67],M=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],I=[65,66,67,68,69],$=[1,84],P=[1,83],B=[1,81],q=[1,82],V=[6,10,42,47],X=[6,10,13,41,42,47,48,49],W=[1,92],ie=[1,91],K=[1,90],se=[19,58],te=[1,101],Z=[1,100],ee=[19,58,60,62],ne={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:T(function(Re,Ge,Ce,be,Fe,ye,He){var xe=ye.length-1;switch(Fe){case 1:break;case 2:this.$=[];break;case 3:ye[xe-1].push(ye[xe]),this.$=ye[xe-1];break;case 4:case 5:this.$=ye[xe];break;case 6:case 7:this.$=[];break;case 8:be.addEntity(ye[xe-4]),be.addEntity(ye[xe-2]),be.addRelationship(ye[xe-4],ye[xe],ye[xe-2],ye[xe-3]);break;case 9:be.addEntity(ye[xe-8]),be.addEntity(ye[xe-4]),be.addRelationship(ye[xe-8],ye[xe],ye[xe-4],ye[xe-5]),be.setClass([ye[xe-8]],ye[xe-6]),be.setClass([ye[xe-4]],ye[xe-2]);break;case 10:be.addEntity(ye[xe-6]),be.addEntity(ye[xe-2]),be.addRelationship(ye[xe-6],ye[xe],ye[xe-2],ye[xe-3]),be.setClass([ye[xe-6]],ye[xe-4]);break;case 11:be.addEntity(ye[xe-6]),be.addEntity(ye[xe-4]),be.addRelationship(ye[xe-6],ye[xe],ye[xe-4],ye[xe-5]),be.setClass([ye[xe-4]],ye[xe-2]);break;case 12:be.addEntity(ye[xe-3]),be.addAttributes(ye[xe-3],ye[xe-1]);break;case 13:be.addEntity(ye[xe-5]),be.addAttributes(ye[xe-5],ye[xe-1]),be.setClass([ye[xe-5]],ye[xe-3]);break;case 14:be.addEntity(ye[xe-2]);break;case 15:be.addEntity(ye[xe-4]),be.setClass([ye[xe-4]],ye[xe-2]);break;case 16:be.addEntity(ye[xe]);break;case 17:be.addEntity(ye[xe-2]),be.setClass([ye[xe-2]],ye[xe]);break;case 18:be.addEntity(ye[xe-6],ye[xe-4]),be.addAttributes(ye[xe-6],ye[xe-1]);break;case 19:be.addEntity(ye[xe-8],ye[xe-6]),be.addAttributes(ye[xe-8],ye[xe-1]),be.setClass([ye[xe-8]],ye[xe-3]);break;case 20:be.addEntity(ye[xe-5],ye[xe-3]);break;case 21:be.addEntity(ye[xe-7],ye[xe-5]),be.setClass([ye[xe-7]],ye[xe-2]);break;case 22:be.addEntity(ye[xe-3],ye[xe-1]);break;case 23:be.addEntity(ye[xe-5],ye[xe-3]),be.setClass([ye[xe-5]],ye[xe]);break;case 24:case 25:this.$=ye[xe].trim(),be.setAccTitle(this.$);break;case 26:case 27:this.$=ye[xe].trim(),be.setAccDescription(this.$);break;case 32:be.setDirection("TB");break;case 33:be.setDirection("BT");break;case 34:be.setDirection("RL");break;case 35:be.setDirection("LR");break;case 36:this.$=ye[xe-3],be.addClass(ye[xe-2],ye[xe-1]);break;case 37:case 38:case 59:case 67:this.$=[ye[xe]];break;case 39:case 40:this.$=ye[xe-2].concat([ye[xe]]);break;case 41:this.$=ye[xe-2],be.setClass(ye[xe-1],ye[xe]);break;case 42:this.$=ye[xe-3],be.addCssStyles(ye[xe-2],ye[xe-1]);break;case 43:this.$=[ye[xe]];break;case 44:ye[xe-2].push(ye[xe]),this.$=ye[xe-2];break;case 46:this.$=ye[xe-1]+ye[xe];break;case 54:case 79:case 80:this.$=ye[xe].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=ye[xe];break;case 60:ye[xe].push(ye[xe-1]),this.$=ye[xe];break;case 61:this.$={type:ye[xe-1],name:ye[xe]};break;case 62:this.$={type:ye[xe-2],name:ye[xe-1],keys:ye[xe]};break;case 63:this.$={type:ye[xe-2],name:ye[xe-1],comment:ye[xe]};break;case 64:this.$={type:ye[xe-3],name:ye[xe-2],keys:ye[xe-1],comment:ye[xe]};break;case 65:case 66:case 69:this.$=ye[xe];break;case 68:ye[xe-2].push(ye[xe]),this.$=ye[xe-2];break;case 70:this.$=ye[xe].replace(/"/g,"");break;case 71:this.$={cardA:ye[xe],relType:ye[xe-1],cardB:ye[xe-2]};break;case 72:this.$=be.Cardinality.ZERO_OR_ONE;break;case 73:this.$=be.Cardinality.ZERO_OR_MORE;break;case 74:this.$=be.Cardinality.ONE_OR_MORE;break;case 75:this.$=be.Cardinality.ONLY_ONE;break;case 76:this.$=be.Cardinality.MD_PARENT;break;case 77:this.$=be.Identification.NON_IDENTIFYING;break;case 78:this.$=be.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:x,66:b,67:w,68:k,69:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:_,41:L},{16:47,40:_,41:L},{16:48,40:_,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:_,41:L},{18:51,19:[1,52],53:53,54:54,58:O},{11:56,40:d,48:g,50:m,51:y,52:v},{64:57,70:[1,58],71:[1,59]},t(D,[2,72]),t(D,[2,73]),t(D,[2,74]),t(D,[2,75]),t(D,[2,76]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:z,38:60,41:F,42:A,45:62,46:63,48:R,49:N},t(M,[2,37]),t(M,[2,38]),{16:68,40:_,41:L,42:A},{13:z,38:69,41:F,42:A,45:62,46:63,48:R,49:N},{13:[1,70],15:[1,71]},t(e,[2,17],{63:35,12:72,17:[1,73],42:A,65:x,66:b,67:w,68:k,69:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:O},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:x,66:b,67:w,68:k,69:S},t(I,[2,77]),t(I,[2,78]),{6:$,10:P,39:80,42:B,47:q},{40:[1,85],41:[1,86]},t(V,[2,43],{46:87,13:z,41:F,48:R,49:N}),t(X,[2,45]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(e,[2,41],{42:A}),{6:$,10:P,39:88,42:B,47:q},{14:89,40:W,50:ie,72:K},{16:93,40:_,41:L},{11:94,40:d,48:g,50:m,51:y,52:v},{18:95,19:[1,96],53:53,54:54,58:O},t(e,[2,12]),{19:[2,60]},t(se,[2,61],{56:97,57:98,59:99,61:te,62:Z}),t([19,58,61,62],[2,66]),t(e,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(e,[2,36]),{13:z,41:F,45:104,46:63,48:R,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(M,[2,39]),t(M,[2,40]),t(X,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,79]),t(e,[2,80]),t(e,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},t(e,[2,15]),t(se,[2,62],{57:109,60:[1,110],62:Z}),t(se,[2,63]),t(ee,[2,67]),t(se,[2,70]),t(ee,[2,69]),{18:111,19:[1,112],53:53,54:54,58:O},{16:113,40:_,41:L},t(V,[2,44],{46:87,13:z,41:F,48:R,49:N}),{14:114,40:W,50:ie,72:K},{16:115,40:_,41:L},{14:116,40:W,50:ie,72:K},t(e,[2,13]),t(se,[2,64]),{59:117,61:te},{19:[1,118]},t(e,[2,20]),t(e,[2,23],{17:[1,119],42:A}),t(e,[2,11]),{13:[1,120],42:A},t(e,[2,10]),t(ee,[2,68]),t(e,[2,18]),{18:121,19:[1,122],53:53,54:54,58:O},{14:123,40:W,50:ie,72:K},{19:[1,124]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:T(function(Re,Ge){if(Ge.recoverable)this.trace(Re);else{var Ce=new Error(Re);throw Ce.hash=Ge,Ce}},"parseError"),parse:T(function(Re){var Ge=this,Ce=[0],be=[],Fe=[null],ye=[],He=this.table,xe="",Ve=0,Je=0,nt=2,tt=1,Ze=ye.slice.call(arguments,1),Ee=Object.create(this.lexer),Se={yy:{}};for(var Y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Y)&&(Se.yy[Y]=this.yy[Y]);Ee.setInput(Re,Se.yy),Se.yy.lexer=Ee,Se.yy.parser=this,typeof Ee.yylloc>"u"&&(Ee.yylloc={});var ce=Ee.yylloc;ye.push(ce);var j=Ee.options&&Ee.options.ranges;typeof Se.yy.parseError=="function"?this.parseError=Se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(ct){Ce.length=Ce.length-2*ct,Fe.length=Fe.length-ct,ye.length=ye.length-ct}T(pe,"popStack");function re(){var ct;return ct=be.pop()||Ee.lex()||tt,typeof ct!="number"&&(ct instanceof Array&&(be=ct,ct=be.pop()),ct=Ge.symbols_[ct]||ct),ct}T(re,"lex");for(var Pe,ve,Ue,Me,qe={},Le,Ke,De,it;;){if(ve=Ce[Ce.length-1],this.defaultActions[ve]?Ue=this.defaultActions[ve]:((Pe===null||typeof Pe>"u")&&(Pe=re()),Ue=He[ve]&&He[ve][Pe]),typeof Ue>"u"||!Ue.length||!Ue[0]){var Te="";it=[];for(Le in He[ve])this.terminals_[Le]&&Le>nt&&it.push("'"+this.terminals_[Le]+"'");Ee.showPosition?Te="Parse error on line "+(Ve+1)+`: -`+Ee.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[Pe]||Pe)+"'":Te="Parse error on line "+(Ve+1)+": Unexpected "+(Pe==tt?"end of input":"'"+(this.terminals_[Pe]||Pe)+"'"),this.parseError(Te,{text:Ee.match,token:this.terminals_[Pe]||Pe,line:Ee.yylineno,loc:ce,expected:it})}if(Ue[0]instanceof Array&&Ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ve+", token: "+Pe);switch(Ue[0]){case 1:Ce.push(Pe),Fe.push(Ee.yytext),ye.push(Ee.yylloc),Ce.push(Ue[1]),Pe=null,Je=Ee.yyleng,xe=Ee.yytext,Ve=Ee.yylineno,ce=Ee.yylloc;break;case 2:if(Ke=this.productions_[Ue[1]][1],qe.$=Fe[Fe.length-Ke],qe._$={first_line:ye[ye.length-(Ke||1)].first_line,last_line:ye[ye.length-1].last_line,first_column:ye[ye.length-(Ke||1)].first_column,last_column:ye[ye.length-1].last_column},j&&(qe._$.range=[ye[ye.length-(Ke||1)].range[0],ye[ye.length-1].range[1]]),Me=this.performAction.apply(qe,[xe,Je,Ve,Se.yy,Ue[1],Fe,ye].concat(Ze)),typeof Me<"u")return Me;Ke&&(Ce=Ce.slice(0,-1*Ke*2),Fe=Fe.slice(0,-1*Ke),ye=ye.slice(0,-1*Ke)),Ce.push(this.productions_[Ue[1]][0]),Fe.push(qe.$),ye.push(qe._$),De=He[Ce[Ce.length-2]][Ce[Ce.length-1]],Ce.push(De);break;case 3:return!0}}return!0},"parse")},oe=(function(){var Ae={EOF:1,parseError:T(function(Ge,Ce){if(this.yy.parser)this.yy.parser.parseError(Ge,Ce);else throw new Error(Ge)},"parseError"),setInput:T(function(Re,Ge){return this.yy=Ge||this.yy||{},this._input=Re,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Re=this._input[0];this.yytext+=Re,this.yyleng++,this.offset++,this.match+=Re,this.matched+=Re;var Ge=Re.match(/(?:\r\n?|\n).*/g);return Ge?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Re},"input"),unput:T(function(Re){var Ge=Re.length,Ce=Re.split(/(?:\r\n?|\n)/g);this._input=Re+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ge),this.offset-=Ge;var be=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Ce.length-1&&(this.yylineno-=Ce.length-1);var Fe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ce?(Ce.length===be.length?this.yylloc.first_column:0)+be[be.length-Ce.length].length-Ce[0].length:this.yylloc.first_column-Ge},this.options.ranges&&(this.yylloc.range=[Fe[0],Fe[0]+this.yyleng-Ge]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Re){this.unput(this.match.slice(Re))},"less"),pastInput:T(function(){var Re=this.matched.substr(0,this.matched.length-this.match.length);return(Re.length>20?"...":"")+Re.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Re=this.match;return Re.length<20&&(Re+=this._input.substr(0,20-Re.length)),(Re.substr(0,20)+(Re.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Re=this.pastInput(),Ge=new Array(Re.length+1).join("-");return Re+this.upcomingInput()+` -`+Ge+"^"},"showPosition"),test_match:T(function(Re,Ge){var Ce,be,Fe;if(this.options.backtrack_lexer&&(Fe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Fe.yylloc.range=this.yylloc.range.slice(0))),be=Re[0].match(/(?:\r\n?|\n).*/g),be&&(this.yylineno+=be.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:be?be[be.length-1].length-be[be.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Re[0].length},this.yytext+=Re[0],this.match+=Re[0],this.matches=Re,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Re[0].length),this.matched+=Re[0],Ce=this.performAction.call(this,this.yy,this,Ge,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ce)return Ce;if(this._backtrack){for(var ye in Fe)this[ye]=Fe[ye];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Re,Ge,Ce,be;this._more||(this.yytext="",this.match="");for(var Fe=this._currentRules(),ye=0;yeGe[0].length)){if(Ge=Ce,be=ye,this.options.backtrack_lexer){if(Re=this.test_match(Ce,Fe[ye]),Re!==!1)return Re;if(this._backtrack){Ge=!1;continue}else return!1}else if(!this.options.flex)break}return Ge?(Re=this.test_match(Ge,Fe[be]),Re!==!1?Re:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Ge=this.next();return Ge||this.lex()},"lex"),begin:T(function(Ge){this.conditionStack.push(Ge)},"begin"),popState:T(function(){var Ge=this.conditionStack.length-1;return Ge>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Ge){return Ge=this.conditionStack.length-1-Math.abs(Ge||0),Ge>=0?this.conditionStack[Ge]:"INITIAL"},"topState"),pushState:T(function(Ge){this.begin(Ge)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Ge,Ce,be,Fe){switch(be){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return Ce.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return Ce.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return Ae})();ne.lexer=oe;function fe(){this.yy={}}return T(fe,"Parser"),fe.prototype=ne,ne.Parser=fe,new fe})();LI.parser=LI;var _Ue=LI,RUe=(Om=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Mn,this.getAccTitle=Gn,this.setAccDescription=qn,this.getAccDescription=Vn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getConfig=T(()=>$e().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,ae.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:$e().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ae.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),ae.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),ae.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Dn()}getData(){const e=[],r=[],n=$e();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:Up(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},T(Om,"ErDB"),Om),Hte={};Ew(Hte,{draw:()=>LUe});var LUe=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=$e(),o=n.db.getData(),l=Z0(e,i);o.type=n.type,o.layoutAlgorithm=cb(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Jp(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=pt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Lr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Ud(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Yte=T((t,e)=>{const r=w6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),A3=new Set(["redux-color","redux-dark-color"]),IUe=T(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!A3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o({parser:wZe,get db(){return new vZe},renderer:TZe,styles:e,init:b(r=>{r.flowchart||(r.flowchart={});const n=MG().layout??t??r.layout;n&&p_({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,p_({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),kZe=oN();const lN=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:oN,diagram:kZe},Symbol.toStringTag,{value:"Module"}));var EZe=b(t=>`${Ose(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),AZe=EZe,_Ze=oN({defaultLayout:"swimlane",styles:AZe});const RZe=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Ze},Symbol.toStringTag,{value:"Module"}));var cN=(function(){var t=b(function(_e,Fe,qe,ue){for(qe=qe||{},ue=_e.length;ue--;qe[_e[ue]]=Fe);return qe},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],x=[1,37],w=[1,38],C=[1,39],k=[1,40],S=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],L=[1,46],M=[1,55],I=[40,48,50,51,52,71,72],P=[1,66],$=[1,64],_=[1,61],R=[1,65],O=[1,67],D=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],B=[1,85],F=[1,84],G=[1,82],z=[1,83],W=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,93],te=[1,92],Y=[1,91],se=[19,58],J=[1,102],Z=[1,101],ee=[19,58,61,63],re={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:b(function(Fe,qe,ue,de,Ce,me,$e){var we=me.length-1;switch(Ce){case 1:break;case 2:this.$=[];break;case 3:me[we-1].push(me[we]),this.$=me[we-1];break;case 4:case 5:this.$=me[we];break;case 6:case 7:this.$=[];break;case 8:de.addEntity(me[we-4]),de.addEntity(me[we-2]),de.addRelationship(me[we-4],me[we],me[we-2],me[we-3]);break;case 9:de.addEntity(me[we-8]),de.addEntity(me[we-4]),de.addRelationship(me[we-8],me[we],me[we-4],me[we-5]),de.setClass([me[we-8]],me[we-6]),de.setClass([me[we-4]],me[we-2]);break;case 10:de.addEntity(me[we-6]),de.addEntity(me[we-2]),de.addRelationship(me[we-6],me[we],me[we-2],me[we-3]),de.setClass([me[we-6]],me[we-4]);break;case 11:de.addEntity(me[we-6]),de.addEntity(me[we-4]),de.addRelationship(me[we-6],me[we],me[we-4],me[we-5]),de.setClass([me[we-4]],me[we-2]);break;case 12:de.addEntity(me[we-3]),de.addAttributes(me[we-3],me[we-1]);break;case 13:de.addEntity(me[we-5]),de.addAttributes(me[we-5],me[we-1]),de.setClass([me[we-5]],me[we-3]);break;case 14:de.addEntity(me[we-2]);break;case 15:de.addEntity(me[we-4]),de.setClass([me[we-4]],me[we-2]);break;case 16:de.addEntity(me[we]);break;case 17:de.addEntity(me[we-2]),de.setClass([me[we-2]],me[we]);break;case 18:de.addEntity(me[we-6],me[we-4]),de.addAttributes(me[we-6],me[we-1]);break;case 19:de.addEntity(me[we-8],me[we-6]),de.addAttributes(me[we-8],me[we-1]),de.setClass([me[we-8]],me[we-3]);break;case 20:de.addEntity(me[we-5],me[we-3]);break;case 21:de.addEntity(me[we-7],me[we-5]),de.setClass([me[we-7]],me[we-2]);break;case 22:de.addEntity(me[we-3],me[we-1]);break;case 23:de.addEntity(me[we-5],me[we-3]),de.setClass([me[we-5]],me[we]);break;case 24:case 25:this.$=me[we].trim(),de.setAccTitle(this.$);break;case 26:case 27:this.$=me[we].trim(),de.setAccDescription(this.$);break;case 32:de.setDirection("TB");break;case 33:de.setDirection("BT");break;case 34:de.setDirection("RL");break;case 35:de.setDirection("LR");break;case 36:this.$=me[we-3],de.addClass(me[we-2],me[we-1]);break;case 37:case 38:case 59:case 68:this.$=[me[we]];break;case 39:case 40:this.$=me[we-2].concat([me[we]]);break;case 41:this.$=me[we-2],de.setClass(me[we-1],me[we]);break;case 42:this.$=me[we-3],de.addCssStyles(me[we-2],me[we-1]);break;case 43:this.$=[me[we]];break;case 44:me[we-2].push(me[we]),this.$=me[we-2];break;case 46:this.$=me[we-1]+me[we];break;case 54:case 80:case 81:this.$=me[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=me[we];break;case 60:me[we].push(me[we-1]),this.$=me[we];break;case 61:this.$={type:me[we-1],name:me[we]};break;case 62:this.$={type:me[we-2],name:me[we-1],keys:me[we]};break;case 63:this.$={type:me[we-2],name:me[we-1],comment:me[we]};break;case 64:this.$={type:me[we-3],name:me[we-2],keys:me[we-1],comment:me[we]};break;case 65:case 67:case 70:this.$=me[we];break;case 66:this.$=me[we-1]+me[we];break;case 69:me[we-2].push(me[we]),this.$=me[we-2];break;case 71:this.$=me[we].replace(/"/g,"");break;case 72:this.$={cardA:me[we],relType:me[we-1],cardB:me[we-2]};break;case 73:this.$=de.Cardinality.ZERO_OR_ONE;break;case 74:this.$=de.Cardinality.ZERO_OR_MORE;break;case 75:this.$=de.Cardinality.ONE_OR_MORE;break;case 76:this.$=de.Cardinality.ONLY_ONE;break;case 77:this.$=de.Cardinality.MD_PARENT;break;case 78:this.$=de.Identification.NON_IDENTIFYING;break;case 79:this.$=de.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:T,67:x,68:w,69:C,70:k}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(S,[2,54]),t(S,[2,55]),t(S,[2,56]),t(S,[2,57]),t(S,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:L},{16:47,40:E,41:L},{16:48,40:E,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:L},{18:51,19:[1,52],53:53,54:54,58:M},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(I,[2,73]),t(I,[2,74]),t(I,[2,75]),t(I,[2,76]),t(I,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:$,42:_,45:62,46:63,48:R,49:O},t(D,[2,37]),t(D,[2,38]),{16:68,40:E,41:L,42:_},{13:P,38:69,41:$,42:_,45:62,46:63,48:R,49:O},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:_,66:T,67:x,68:w,69:C,70:k}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:M},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:T,67:x,68:w,69:C,70:k},t(N,[2,78]),t(N,[2,79]),{6:B,10:F,39:81,42:G,47:z},{40:[1,86],41:[1,87]},t(W,[2,43],{46:88,13:P,41:$,48:R,49:O}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(e,[2,41],{42:_}),{6:B,10:F,39:89,42:G,47:z},{14:90,40:H,50:te,73:Y},{16:94,40:E,41:L},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:M},t(e,[2,12]),{19:[2,60]},t(se,[2,61],{56:98,57:99,60:100,62:J,63:Z}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:$,45:105,46:63,48:R,49:O},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(V,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:_},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(se,[2,62],{57:110,61:[1,111],63:Z}),t(se,[2,63]),t(ee,[2,68]),t(se,[2,71]),t(ee,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:L},t(W,[2,44],{46:88,13:P,41:$,48:R,49:O}),{14:115,40:H,50:te,73:Y},{16:116,40:E,41:L},{14:117,40:H,50:te,73:Y},t(e,[2,13]),t(se,[2,64]),{60:118,62:J},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:_}),t(e,[2,11]),{13:[1,121],42:_},t(e,[2,10]),t(ee,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:H,50:te,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:b(function(Fe,qe){if(qe.recoverable)this.trace(Fe);else{var ue=new Error(Fe);throw ue.hash=qe,ue}},"parseError"),parse:b(function(Fe){var qe=this,ue=[0],de=[],Ce=[null],me=[],$e=this.table,we="",Le=0,Ye=0,ce=2,ye=1,ke=me.slice.call(arguments,1),le=Object.create(this.lexer),pe={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(pe.yy[U]=this.yy[U]);le.setInput(Fe,pe.yy),pe.yy.lexer=le,pe.yy.parser=this,typeof le.yylloc>"u"&&(le.yylloc={});var oe=le.yylloc;me.push(oe);var Q=le.options&&le.options.ranges;typeof pe.yy.parseError=="function"?this.parseError=pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(pt){ue.length=ue.length-2*pt,Ce.length=Ce.length-pt,me.length=me.length-pt}b(fe,"popStack");function j(){var pt;return pt=de.pop()||le.lex()||ye,typeof pt!="number"&&(pt instanceof Array&&(de=pt,pt=de.pop()),pt=qe.symbols_[pt]||pt),pt}b(j,"lex");for(var Be,Se,He,De,We={},Ne,Ze,Pe,nt;;){if(Se=ue[ue.length-1],this.defaultActions[Se]?He=this.defaultActions[Se]:((Be===null||typeof Be>"u")&&(Be=j()),He=$e[Se]&&$e[Se][Be]),typeof He>"u"||!He.length||!He[0]){var Ie="";nt=[];for(Ne in $e[Se])this.terminals_[Ne]&&Ne>ce&&nt.push("'"+this.terminals_[Ne]+"'");le.showPosition?Ie="Parse error on line "+(Le+1)+`: +`+le.showPosition()+` +Expecting `+nt.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":Ie="Parse error on line "+(Le+1)+": Unexpected "+(Be==ye?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(Ie,{text:le.match,token:this.terminals_[Be]||Be,line:le.yylineno,loc:oe,expected:nt})}if(He[0]instanceof Array&&He.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Se+", token: "+Be);switch(He[0]){case 1:ue.push(Be),Ce.push(le.yytext),me.push(le.yylloc),ue.push(He[1]),Be=null,Ye=le.yyleng,we=le.yytext,Le=le.yylineno,oe=le.yylloc;break;case 2:if(Ze=this.productions_[He[1]][1],We.$=Ce[Ce.length-Ze],We._$={first_line:me[me.length-(Ze||1)].first_line,last_line:me[me.length-1].last_line,first_column:me[me.length-(Ze||1)].first_column,last_column:me[me.length-1].last_column},Q&&(We._$.range=[me[me.length-(Ze||1)].range[0],me[me.length-1].range[1]]),De=this.performAction.apply(We,[we,Ye,Le,pe.yy,He[1],Ce,me].concat(ke)),typeof De<"u")return De;Ze&&(ue=ue.slice(0,-1*Ze*2),Ce=Ce.slice(0,-1*Ze),me=me.slice(0,-1*Ze)),ue.push(this.productions_[He[1]][0]),Ce.push(We.$),me.push(We._$),Pe=$e[ue[ue.length-2]][ue[ue.length-1]],ue.push(Pe);break;case 3:return!0}}return!0},"parse")},ge=(function(){var _e={EOF:1,parseError:b(function(qe,ue){if(this.yy.parser)this.yy.parser.parseError(qe,ue);else throw new Error(qe)},"parseError"),setInput:b(function(Fe,qe){return this.yy=qe||this.yy||{},this._input=Fe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var Fe=this._input[0];this.yytext+=Fe,this.yyleng++,this.offset++,this.match+=Fe,this.matched+=Fe;var qe=Fe.match(/(?:\r\n?|\n).*/g);return qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Fe},"input"),unput:b(function(Fe){var qe=Fe.length,ue=Fe.split(/(?:\r\n?|\n)/g);this._input=Fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-qe),this.offset-=qe;var de=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ue.length-1&&(this.yylineno-=ue.length-1);var Ce=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ue?(ue.length===de.length?this.yylloc.first_column:0)+de[de.length-ue.length].length-ue[0].length:this.yylloc.first_column-qe},this.options.ranges&&(this.yylloc.range=[Ce[0],Ce[0]+this.yyleng-qe]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(Fe){this.unput(this.match.slice(Fe))},"less"),pastInput:b(function(){var Fe=this.matched.substr(0,this.matched.length-this.match.length);return(Fe.length>20?"...":"")+Fe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var Fe=this.match;return Fe.length<20&&(Fe+=this._input.substr(0,20-Fe.length)),(Fe.substr(0,20)+(Fe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var Fe=this.pastInput(),qe=new Array(Fe.length+1).join("-");return Fe+this.upcomingInput()+` +`+qe+"^"},"showPosition"),test_match:b(function(Fe,qe){var ue,de,Ce;if(this.options.backtrack_lexer&&(Ce={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ce.yylloc.range=this.yylloc.range.slice(0))),de=Fe[0].match(/(?:\r\n?|\n).*/g),de&&(this.yylineno+=de.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:de?de[de.length-1].length-de[de.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Fe[0].length},this.yytext+=Fe[0],this.match+=Fe[0],this.matches=Fe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Fe[0].length),this.matched+=Fe[0],ue=this.performAction.call(this,this.yy,this,qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var me in Ce)this[me]=Ce[me];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Fe,qe,ue,de;this._more||(this.yytext="",this.match="");for(var Ce=this._currentRules(),me=0;meqe[0].length)){if(qe=ue,de=me,this.options.backtrack_lexer){if(Fe=this.test_match(ue,Ce[me]),Fe!==!1)return Fe;if(this._backtrack){qe=!1;continue}else return!1}else if(!this.options.flex)break}return qe?(Fe=this.test_match(qe,Ce[de]),Fe!==!1?Fe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var qe=this.next();return qe||this.lex()},"lex"),begin:b(function(qe){this.conditionStack.push(qe)},"begin"),popState:b(function(){var qe=this.conditionStack.length-1;return qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(qe){return qe=this.conditionStack.length-1-Math.abs(qe||0),qe>=0?this.conditionStack[qe]:"INITIAL"},"topState"),pushState:b(function(qe){this.begin(qe)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(qe,ue,de,Ce){switch(de){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ue.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ue.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return _e})();re.lexer=ge;function ae(){this.yy={}}return b(ae,"Parser"),ae.prototype=re,re.Parser=ae,new ae})();cN.parser=cN;var LZe=cN,IZe=(L1=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=qn,this.getAccTitle=Qn,this.setAccDescription=Jn,this.getAccDescription=ei,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getConfig=b(()=>Ve().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,he.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Ve().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),he.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),he.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),he.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],zn()}getData(){const e=[],r=[],n=Ve();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:I0(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},b(L1,"ErDB"),L1),$se={};Bc($se,{draw:()=>MZe});var MZe=b(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Ve(),o=n.db.getData(),l=Wg(e,i);o.type=n.type,o.layoutAlgorithm=ax(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await B0(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=mt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Er.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Nf(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Pse=b((t,e)=>{const r=X6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tl(n,i,a,e)},"fade"),XE=new Set(["redux-color","redux-dark-color"]),DZe=b(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!XE.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${IUe(t)} + `;return s},"genColor"),NZe=b(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${DZe(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -1111,14 +1117,14 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Pe]||Pe)+"'":Te="Parse erro } .labelBkg { - background-color: ${A3.has(r)&&n?n:Yte(t.tertiaryColor,.5)}; + background-color: ${XE.has(r)&&n?n:Pse(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${A3.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${XE.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${A3.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${XE.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -1160,105 +1166,105 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Pe]||Pe)+"'":Te="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${Yte(t.tertiaryColor,.5)}; + background-color: ${Pse(t.tertiaryColor,.5)}; } -`},"getStyles"),MUe=DUe,NUe={parser:_Ue,get db(){return new RUe},renderer:Hte,styles:MUe};const OUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:NUe},Symbol.toStringTag,{value:"Module"}));function Fl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}T(Fl,"populateCommonDb");var II=($m=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},T($m,"ImperativeState"),$m),$Ue=Object.create,bx=Object.defineProperty,PUe=Object.getOwnPropertyDescriptor,DI=Object.getOwnPropertyNames,BUe=Object.getPrototypeOf,FUe=Object.prototype.hasOwnProperty,E=(t,e)=>bx(t,"name",{value:e,configurable:!0}),zUe=(t,e)=>function(){return t&&(e=(0,t[DI(t)[0]])(t=0)),e},Mr=(t,e)=>function(){return e||(0,t[DI(t)[0]])((e={exports:{}}).exports,e),e.exports},ph=(t,e)=>{for(var r in e)bx(t,r,{get:e[r],enumerable:!0})},MI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DI(e))!FUe.call(t,i)&&i!==r&&bx(t,i,{get:()=>e[i],enumerable:!(n=PUe(e,i))||n.enumerable});return t},_3=(t,e,r)=>(MI(t,e,"default"),r),NI=(t,e,r)=>(r=t!=null?$Ue(BUe(t)):{},MI(bx(r,"default",{value:t,enumerable:!0}),t)),OI=t=>MI(bx({},"__esModule",{value:!0}),t),R3={};ph(R3,{AnnotatedTextEdit:()=>Wc,ChangeAnnotation:()=>Yd,ChangeAnnotationIdentifier:()=>pa,CodeAction:()=>m9,CodeActionContext:()=>g9,CodeActionKind:()=>p9,CodeActionTriggerKind:()=>Ax,CodeDescription:()=>UI,CodeLens:()=>y9,Color:()=>I3,ColorInformation:()=>FI,ColorPresentation:()=>zI,Command:()=>Hd,CompletionItem:()=>r9,CompletionItemKind:()=>jI,CompletionItemLabelDetails:()=>t9,CompletionItemTag:()=>QI,CompletionList:()=>n9,CreateFile:()=>Q0,DeleteFile:()=>eg,Diagnostic:()=>wx,DiagnosticRelatedInformation:()=>D3,DiagnosticSeverity:()=>VI,DiagnosticTag:()=>WI,DocumentHighlight:()=>l9,DocumentHighlightKind:()=>o9,DocumentLink:()=>b9,DocumentSymbol:()=>f9,DocumentUri:()=>$I,EOL:()=>Kte,FoldingRange:()=>qI,FoldingRangeKind:()=>GI,FormattingOptions:()=>v9,Hover:()=>i9,InlayHint:()=>_9,InlayHintKind:()=>O3,InlayHintLabelPart:()=>$3,InlineCompletionContext:()=>N9,InlineCompletionItem:()=>L9,InlineCompletionList:()=>I9,InlineCompletionTriggerKind:()=>D9,InlineValueContext:()=>A9,InlineValueEvaluatableExpression:()=>S9,InlineValueText:()=>k9,InlineValueVariableLookup:()=>E9,InsertReplaceEdit:()=>JI,InsertTextFormat:()=>ZI,InsertTextMode:()=>e9,Location:()=>Tx,LocationLink:()=>BI,MarkedString:()=>Sx,MarkupContent:()=>tg,MarkupKind:()=>N3,OptionalVersionedTextDocumentIdentifier:()=>Ex,ParameterInformation:()=>a9,Position:()=>on,Range:()=>Ur,RenameFile:()=>J0,SelectedCompletionInfo:()=>M9,SelectionRange:()=>x9,SemanticTokenModifiers:()=>w9,SemanticTokenTypes:()=>T9,SemanticTokens:()=>C9,SignatureInformation:()=>s9,StringValue:()=>R9,SymbolInformation:()=>h9,SymbolKind:()=>c9,SymbolTag:()=>u9,TextDocument:()=>$9,TextDocumentEdit:()=>Cx,TextDocumentIdentifier:()=>YI,TextDocumentItem:()=>KI,TextEdit:()=>zl,URI:()=>L3,VersionedTextDocumentIdentifier:()=>XI,WorkspaceChange:()=>Xte,WorkspaceEdit:()=>M3,WorkspaceFolder:()=>O9,WorkspaceSymbol:()=>d9,integer:()=>PI,uinteger:()=>xx});var $I,L3,PI,xx,on,Ur,Tx,BI,I3,FI,zI,GI,qI,D3,VI,WI,UI,wx,Hd,zl,Yd,pa,Wc,Cx,Q0,J0,eg,M3,kx,HI,Xte,YI,XI,Ex,KI,N3,tg,jI,ZI,QI,JI,e9,t9,r9,n9,Sx,i9,a9,s9,o9,l9,c9,u9,h9,d9,f9,p9,Ax,g9,m9,y9,v9,b9,x9,T9,w9,C9,k9,E9,S9,A9,O3,$3,_9,R9,L9,I9,D9,M9,N9,O9,Kte,$9,jte,rt,_x=zUe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})($I||($I={})),(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(L3||(L3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(PI||(PI={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(xx||(xx={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=xx.MAX_VALUE),l===Number.MAX_VALUE&&(l=xx.MAX_VALUE),{line:o,character:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&rt.uinteger(l.line)&&rt.uinteger(l.character)}E(s,"is"),i.is=s})(on||(on={})),(function(i){function a(o,l,u,h){if(rt.uinteger(o)&&rt.uinteger(l)&&rt.uinteger(u)&&rt.uinteger(h))return{start:on.create(o,l),end:on.create(u,h)};if(on.is(o)&&on.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&on.is(l.start)&&on.is(l.end)}E(s,"is"),i.is=s})(Ur||(Ur={})),(function(i){function a(o,l){return{uri:o,range:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(rt.string(l.uri)||rt.undefined(l.uri))}E(s,"is"),i.is=s})(Tx||(Tx={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.targetRange)&&rt.string(l.targetUri)&&Ur.is(l.targetSelectionRange)&&(Ur.is(l.originSelectionRange)||rt.undefined(l.originSelectionRange))}E(s,"is"),i.is=s})(BI||(BI={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.numberRange(l.red,0,1)&&rt.numberRange(l.green,0,1)&&rt.numberRange(l.blue,0,1)&&rt.numberRange(l.alpha,0,1)}E(s,"is"),i.is=s})(I3||(I3={})),(function(i){function a(o,l){return{range:o,color:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&I3.is(l.color)}E(s,"is"),i.is=s})(FI||(FI={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.undefined(l.textEdit)||zl.is(l))&&(rt.undefined(l.additionalTextEdits)||rt.typedArray(l.additionalTextEdits,zl.is))}E(s,"is"),i.is=s})(zI||(zI={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(GI||(GI={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return rt.defined(u)&&(p.startCharacter=u),rt.defined(h)&&(p.endCharacter=h),rt.defined(d)&&(p.kind=d),rt.defined(f)&&(p.collapsedText=f),p}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.uinteger(l.startLine)&&rt.uinteger(l.startLine)&&(rt.undefined(l.startCharacter)||rt.uinteger(l.startCharacter))&&(rt.undefined(l.endCharacter)||rt.uinteger(l.endCharacter))&&(rt.undefined(l.kind)||rt.string(l.kind))}E(s,"is"),i.is=s})(qI||(qI={})),(function(i){function a(o,l){return{location:o,message:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Tx.is(l.location)&&rt.string(l.message)}E(s,"is"),i.is=s})(D3||(D3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(VI||(VI={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(WI||(WI={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&rt.string(o.href)}E(a,"is"),i.is=a})(UI||(UI={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return rt.defined(u)&&(p.severity=u),rt.defined(h)&&(p.code=h),rt.defined(d)&&(p.source=d),rt.defined(f)&&(p.relatedInformation=f),p}E(a,"create"),i.create=a;function s(o){var l;let u=o;return rt.defined(u)&&Ur.is(u.range)&&rt.string(u.message)&&(rt.number(u.severity)||rt.undefined(u.severity))&&(rt.integer(u.code)||rt.string(u.code)||rt.undefined(u.code))&&(rt.undefined(u.codeDescription)||rt.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(rt.string(u.source)||rt.undefined(u.source))&&(rt.undefined(u.relatedInformation)||rt.typedArray(u.relatedInformation,D3.is))}E(s,"is"),i.is=s})(wx||(wx={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return rt.defined(u)&&u.length>0&&(h.arguments=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.title)&&rt.string(l.command)}E(s,"is"),i.is=s})(Hd||(Hd={})),(function(i){function a(u,h){return{range:u,newText:h}}E(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}E(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}E(o,"del"),i.del=o;function l(u){const h=u;return rt.objectLiteral(h)&&rt.string(h.newText)&&Ur.is(h.range)}E(l,"is"),i.is=l})(zl||(zl={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(rt.string(l.description)||l.description===void 0)}E(s,"is"),i.is=s})(Yd||(Yd={})),(function(i){function a(s){const o=s;return rt.string(o)}E(a,"is"),i.is=a})(pa||(pa={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}E(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}E(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}E(o,"del"),i.del=o;function l(u){const h=u;return zl.is(h)&&(Yd.is(h.annotationId)||pa.is(h.annotationId))}E(l,"is"),i.is=l})(Wc||(Wc={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ex.is(l.textDocument)&&Array.isArray(l.edits)}E(s,"is"),i.is=s})(Cx||(Cx={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&rt.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||pa.is(l.annotationId))}E(s,"is"),i.is=s})(Q0||(Q0={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&rt.string(l.oldUri)&&rt.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||pa.is(l.annotationId))}E(s,"is"),i.is=s})(J0||(J0={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&rt.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||rt.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||rt.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||pa.is(l.annotationId))}E(s,"is"),i.is=s})(eg||(eg={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>rt.string(l.kind)?Q0.is(l)||J0.is(l)||eg.is(l):Cx.is(l)))}E(a,"is"),i.is=a})(M3||(M3={})),kx=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=zl.insert(a,s):pa.is(o)?(u=o,l=Wc.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Wc.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=zl.replace(a,s):pa.is(o)?(u=o,l=Wc.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Wc.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=zl.del(a):pa.is(s)?(l=s,o=Wc.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Wc.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},E(t,"TextEditChangeImpl"),t),HI=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(pa.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},E(e,"ChangeAnnotations"),e),Xte=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new HI(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(Cx.is(s)){const o=new kx(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new kx(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(Ex.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new kx(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new kx(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new HI,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Yd.is(s)||pa.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Q0.create(a,o):(h=pa.is(l)?l:this._changeAnnotations.manage(l),u=Q0.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Yd.is(o)||pa.is(o)?u=o:l=o;let h,d;if(u===void 0?h=J0.create(a,s,l):(d=pa.is(u)?u:this._changeAnnotations.manage(u),h=J0.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Yd.is(s)||pa.is(s)?l=s:o=s;let u,h;if(l===void 0?u=eg.create(a,o):(h=pa.is(l)?l:this._changeAnnotations.manage(l),u=eg.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},E(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)}E(s,"is"),i.is=s})(YI||(YI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.integer(l.version)}E(s,"is"),i.is=s})(XI||(XI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&(l.version===null||rt.integer(l.version))}E(s,"is"),i.is=s})(Ex||(Ex={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.string(l.languageId)&&rt.integer(l.version)&&rt.string(l.text)}E(s,"is"),i.is=s})(KI||(KI={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}E(a,"is"),i.is=a})(N3||(N3={})),(function(i){function a(s){const o=s;return rt.objectLiteral(s)&&N3.is(o.kind)&&rt.string(o.value)}E(a,"is"),i.is=a})(tg||(tg={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(jI||(jI={})),(function(i){i.PlainText=1,i.Snippet=2})(ZI||(ZI={})),(function(i){i.Deprecated=1})(QI||(QI={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l&&rt.string(l.newText)&&Ur.is(l.insert)&&Ur.is(l.replace)}E(s,"is"),i.is=s})(JI||(JI={})),(function(i){i.asIs=1,i.adjustIndentation=2})(e9||(e9={})),(function(i){function a(s){const o=s;return o&&(rt.string(o.detail)||o.detail===void 0)&&(rt.string(o.description)||o.description===void 0)}E(a,"is"),i.is=a})(t9||(t9={})),(function(i){function a(s){return{label:s}}E(a,"create"),i.create=a})(r9||(r9={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}E(a,"create"),i.create=a})(n9||(n9={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}E(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return rt.string(l)||rt.objectLiteral(l)&&rt.string(l.language)&&rt.string(l.value)}E(s,"is"),i.is=s})(Sx||(Sx={})),(function(i){function a(s){let o=s;return!!o&&rt.objectLiteral(o)&&(tg.is(o.contents)||Sx.is(o.contents)||rt.typedArray(o.contents,Sx.is))&&(s.range===void 0||Ur.is(s.range))}E(a,"is"),i.is=a})(i9||(i9={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}E(a,"create"),i.create=a})(a9||(a9={})),(function(i){function a(s,o,...l){let u={label:s};return rt.defined(o)&&(u.documentation=o),rt.defined(l)?u.parameters=l:u.parameters=[],u}E(a,"create"),i.create=a})(s9||(s9={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(o9||(o9={})),(function(i){function a(s,o){let l={range:s};return rt.number(o)&&(l.kind=o),l}E(a,"create"),i.create=a})(l9||(l9={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(c9||(c9={})),(function(i){i.Deprecated=1})(u9||(u9={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}E(a,"create"),i.create=a})(h9||(h9={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}E(a,"create"),i.create=a})(d9||(d9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.name)&&rt.number(l.kind)&&Ur.is(l.range)&&Ur.is(l.selectionRange)&&(l.detail===void 0||rt.string(l.detail))&&(l.deprecated===void 0||rt.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}E(s,"is"),i.is=s})(f9||(f9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(p9||(p9={})),(function(i){i.Invoked=1,i.Automatic=2})(Ax||(Ax={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.typedArray(l.diagnostics,wx.is)&&(l.only===void 0||rt.typedArray(l.only,rt.string))&&(l.triggerKind===void 0||l.triggerKind===Ax.Invoked||l.triggerKind===Ax.Automatic)}E(s,"is"),i.is=s})(g9||(g9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Hd.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.title)&&(l.diagnostics===void 0||rt.typedArray(l.diagnostics,wx.is))&&(l.kind===void 0||rt.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Hd.is(l.command))&&(l.isPreferred===void 0||rt.boolean(l.isPreferred))&&(l.edit===void 0||M3.is(l.edit))}E(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(o,l){let u={range:o};return rt.defined(l)&&(u.data=l),u}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.command)||Hd.is(l.command))}E(s,"is"),i.is=s})(y9||(y9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.uinteger(l.tabSize)&&rt.boolean(l.insertSpaces)}E(s,"is"),i.is=s})(v9||(v9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.target)||rt.string(l.target))}E(s,"is"),i.is=s})(b9||(b9={})),(function(i){function a(o,l){return{range:o,parent:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(l.parent===void 0||i.is(l.parent))}E(s,"is"),i.is=s})(x9||(x9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(T9||(T9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(w9||(w9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}E(a,"is"),i.is=a})(C9||(C9={})),(function(i){function a(o,l){return{range:o,text:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.string(l.text)}E(s,"is"),i.is=s})(k9||(k9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.boolean(l.caseSensitiveLookup)&&(rt.string(l.variableName)||l.variableName===void 0)}E(s,"is"),i.is=s})(E9||(E9={})),(function(i){function a(o,l){return{range:o,expression:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&(rt.string(l.expression)||l.expression===void 0)}E(s,"is"),i.is=s})(S9||(S9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.defined(l)&&Ur.is(o.stoppedLocation)}E(s,"is"),i.is=s})(A9||(A9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}E(a,"is"),i.is=a})(O3||(O3={})),(function(i){function a(o){return{value:o}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&(l.tooltip===void 0||rt.string(l.tooltip)||tg.is(l.tooltip))&&(l.location===void 0||Tx.is(l.location))&&(l.command===void 0||Hd.is(l.command))}E(s,"is"),i.is=s})($3||($3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&on.is(l.position)&&(rt.string(l.label)||rt.typedArray(l.label,$3.is))&&(l.kind===void 0||O3.is(l.kind))&&l.textEdits===void 0||rt.typedArray(l.textEdits,zl.is)&&(l.tooltip===void 0||rt.string(l.tooltip)||tg.is(l.tooltip))&&(l.paddingLeft===void 0||rt.boolean(l.paddingLeft))&&(l.paddingRight===void 0||rt.boolean(l.paddingRight))}E(s,"is"),i.is=s})(_9||(_9={})),(function(i){function a(s){return{kind:"snippet",value:s}}E(a,"createSnippet"),i.createSnippet=a})(R9||(R9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}E(a,"create"),i.create=a})(L9||(L9={})),(function(i){function a(s){return{items:s}}E(a,"create"),i.create=a})(I9||(I9={})),(function(i){i.Invoked=0,i.Automatic=1})(D9||(D9={})),(function(i){function a(s,o){return{range:s,text:o}}E(a,"create"),i.create=a})(M9||(M9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}E(a,"create"),i.create=a})(N9||(N9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&L3.is(o.uri)&&rt.string(o.name)}E(a,"is"),i.is=a})(O9||(O9={})),Kte=[` +`},"getStyles"),OZe=NZe,$Ze={parser:LZe,get db(){return new IZe},renderer:$se,styles:OZe};const PZe=Object.freeze(Object.defineProperty({__proto__:null,diagram:$Ze},Symbol.toStringTag,{value:"Module"}));var uN=(I1=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},b(I1,"ImperativeState"),I1);function Cs(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}b(Cs,"populateCommonDb");var BZe=Object.create,mT=Object.defineProperty,FZe=Object.getOwnPropertyDescriptor,hN=Object.getOwnPropertyNames,zZe=Object.getPrototypeOf,GZe=Object.prototype.hasOwnProperty,A=(t,e)=>mT(t,"name",{value:e,configurable:!0}),WZe=(t,e)=>function(){return t&&(e=(0,t[hN(t)[0]])(t=0)),e},qr=(t,e)=>function(){return e||(0,t[hN(t)[0]])((e={exports:{}}).exports,e),e.exports},Kh=(t,e)=>{for(var r in e)mT(t,r,{get:e[r],enumerable:!0})},dN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hN(e))!GZe.call(t,i)&&i!==r&&mT(t,i,{get:()=>e[i],enumerable:!(n=FZe(e,i))||n.enumerable});return t},jE=(t,e,r)=>(dN(t,e,"default"),r),fN=(t,e,r)=>(r=t!=null?BZe(zZe(t)):{},dN(mT(r,"default",{value:t,enumerable:!0}),t)),pN=t=>dN(mT({},"__esModule",{value:!0}),t),KE={};Kh(KE,{AnnotatedTextEdit:()=>Su,ChangeAnnotation:()=>$f,ChangeAnnotationIdentifier:()=>$a,CodeAction:()=>jN,CodeActionContext:()=>XN,CodeActionKind:()=>YN,CodeActionTriggerKind:()=>ST,CodeDescription:()=>SN,CodeLens:()=>KN,Color:()=>QE,ColorInformation:()=>vN,ColorPresentation:()=>bN,Command:()=>Of,CompletionItem:()=>ON,CompletionItemKind:()=>RN,CompletionItemLabelDetails:()=>NN,CompletionItemTag:()=>IN,CompletionList:()=>$N,CreateFile:()=>qg,DeleteFile:()=>Ug,Diagnostic:()=>bT,DiagnosticRelatedInformation:()=>JE,DiagnosticSeverity:()=>wN,DiagnosticTag:()=>CN,DocumentHighlight:()=>GN,DocumentHighlightKind:()=>zN,DocumentLink:()=>QN,DocumentSymbol:()=>HN,DocumentUri:()=>gN,EOL:()=>Fse,FoldingRange:()=>TN,FoldingRangeKind:()=>xN,FormattingOptions:()=>ZN,Hover:()=>PN,InlayHint:()=>o9,InlayHintKind:()=>r5,InlayHintLabelPart:()=>n5,InlineCompletionContext:()=>f9,InlineCompletionItem:()=>c9,InlineCompletionList:()=>u9,InlineCompletionTriggerKind:()=>h9,InlineValueContext:()=>s9,InlineValueEvaluatableExpression:()=>a9,InlineValueText:()=>n9,InlineValueVariableLookup:()=>i9,InsertReplaceEdit:()=>MN,InsertTextFormat:()=>LN,InsertTextMode:()=>DN,Location:()=>vT,LocationLink:()=>yN,MarkedString:()=>CT,MarkupContent:()=>Hg,MarkupKind:()=>t5,OptionalVersionedTextDocumentIdentifier:()=>wT,ParameterInformation:()=>BN,Position:()=>En,Range:()=>on,RenameFile:()=>Vg,SelectedCompletionInfo:()=>d9,SelectionRange:()=>JN,SemanticTokenModifiers:()=>t9,SemanticTokenTypes:()=>e9,SemanticTokens:()=>r9,SignatureInformation:()=>FN,StringValue:()=>l9,SymbolInformation:()=>VN,SymbolKind:()=>WN,SymbolTag:()=>qN,TextDocument:()=>g9,TextDocumentEdit:()=>xT,TextDocumentIdentifier:()=>EN,TextDocumentItem:()=>_N,TextEdit:()=>gc,URI:()=>ZE,VersionedTextDocumentIdentifier:()=>AN,WorkspaceChange:()=>Bse,WorkspaceEdit:()=>e5,WorkspaceFolder:()=>p9,WorkspaceSymbol:()=>UN,integer:()=>mN,uinteger:()=>yT});var gN,ZE,mN,yT,En,on,vT,yN,QE,vN,bN,xN,TN,JE,wN,CN,SN,bT,Of,gc,$f,$a,Su,xT,qg,Vg,Ug,e5,TT,kN,Bse,EN,AN,wT,_N,t5,Hg,RN,LN,IN,MN,DN,NN,ON,$N,CT,PN,BN,FN,zN,GN,WN,qN,VN,UN,HN,YN,ST,XN,jN,KN,ZN,QN,JN,e9,t9,r9,n9,i9,a9,s9,r5,n5,o9,l9,c9,u9,h9,d9,f9,p9,Fse,g9,zse,it,kT=WZe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(gN||(gN={})),(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(ZE||(ZE={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(mN||(mN={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(yT||(yT={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=yT.MAX_VALUE),l===Number.MAX_VALUE&&(l=yT.MAX_VALUE),{line:o,character:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.objectLiteral(l)&&it.uinteger(l.line)&&it.uinteger(l.character)}A(s,"is"),i.is=s})(En||(En={})),(function(i){function a(o,l,u,h){if(it.uinteger(o)&&it.uinteger(l)&&it.uinteger(u)&&it.uinteger(h))return{start:En.create(o,l),end:En.create(u,h)};if(En.is(o)&&En.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}A(a,"create"),i.create=a;function s(o){let l=o;return it.objectLiteral(l)&&En.is(l.start)&&En.is(l.end)}A(s,"is"),i.is=s})(on||(on={})),(function(i){function a(o,l){return{uri:o,range:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.objectLiteral(l)&&on.is(l.range)&&(it.string(l.uri)||it.undefined(l.uri))}A(s,"is"),i.is=s})(vT||(vT={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}A(a,"create"),i.create=a;function s(o){let l=o;return it.objectLiteral(l)&&on.is(l.targetRange)&&it.string(l.targetUri)&&on.is(l.targetSelectionRange)&&(on.is(l.originSelectionRange)||it.undefined(l.originSelectionRange))}A(s,"is"),i.is=s})(yN||(yN={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&it.numberRange(l.red,0,1)&&it.numberRange(l.green,0,1)&&it.numberRange(l.blue,0,1)&&it.numberRange(l.alpha,0,1)}A(s,"is"),i.is=s})(QE||(QE={})),(function(i){function a(o,l){return{range:o,color:l}}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&on.is(l.range)&&QE.is(l.color)}A(s,"is"),i.is=s})(vN||(vN={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&it.string(l.label)&&(it.undefined(l.textEdit)||gc.is(l))&&(it.undefined(l.additionalTextEdits)||it.typedArray(l.additionalTextEdits,gc.is))}A(s,"is"),i.is=s})(bN||(bN={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(xN||(xN={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return it.defined(u)&&(p.startCharacter=u),it.defined(h)&&(p.endCharacter=h),it.defined(d)&&(p.kind=d),it.defined(f)&&(p.collapsedText=f),p}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&it.uinteger(l.startLine)&&it.uinteger(l.startLine)&&(it.undefined(l.startCharacter)||it.uinteger(l.startCharacter))&&(it.undefined(l.endCharacter)||it.uinteger(l.endCharacter))&&(it.undefined(l.kind)||it.string(l.kind))}A(s,"is"),i.is=s})(TN||(TN={})),(function(i){function a(o,l){return{location:o,message:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&vT.is(l.location)&&it.string(l.message)}A(s,"is"),i.is=s})(JE||(JE={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(wN||(wN={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(CN||(CN={})),(function(i){function a(s){const o=s;return it.objectLiteral(o)&&it.string(o.href)}A(a,"is"),i.is=a})(SN||(SN={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return it.defined(u)&&(p.severity=u),it.defined(h)&&(p.code=h),it.defined(d)&&(p.source=d),it.defined(f)&&(p.relatedInformation=f),p}A(a,"create"),i.create=a;function s(o){var l;let u=o;return it.defined(u)&&on.is(u.range)&&it.string(u.message)&&(it.number(u.severity)||it.undefined(u.severity))&&(it.integer(u.code)||it.string(u.code)||it.undefined(u.code))&&(it.undefined(u.codeDescription)||it.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(it.string(u.source)||it.undefined(u.source))&&(it.undefined(u.relatedInformation)||it.typedArray(u.relatedInformation,JE.is))}A(s,"is"),i.is=s})(bT||(bT={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return it.defined(u)&&u.length>0&&(h.arguments=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.string(l.title)&&it.string(l.command)}A(s,"is"),i.is=s})(Of||(Of={})),(function(i){function a(u,h){return{range:u,newText:h}}A(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}A(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}A(o,"del"),i.del=o;function l(u){const h=u;return it.objectLiteral(h)&&it.string(h.newText)&&on.is(h.range)}A(l,"is"),i.is=l})(gc||(gc={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&it.string(l.label)&&(it.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(it.string(l.description)||l.description===void 0)}A(s,"is"),i.is=s})($f||($f={})),(function(i){function a(s){const o=s;return it.string(o)}A(a,"is"),i.is=a})($a||($a={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}A(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}A(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}A(o,"del"),i.del=o;function l(u){const h=u;return gc.is(h)&&($f.is(h.annotationId)||$a.is(h.annotationId))}A(l,"is"),i.is=l})(Su||(Su={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&wT.is(l.textDocument)&&Array.isArray(l.edits)}A(s,"is"),i.is=s})(xT||(xT={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&it.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||it.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||it.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||$a.is(l.annotationId))}A(s,"is"),i.is=s})(qg||(qg={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&it.string(l.oldUri)&&it.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||it.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||it.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||$a.is(l.annotationId))}A(s,"is"),i.is=s})(Vg||(Vg={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&it.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||it.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||it.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||$a.is(l.annotationId))}A(s,"is"),i.is=s})(Ug||(Ug={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>it.string(l.kind)?qg.is(l)||Vg.is(l)||Ug.is(l):xT.is(l)))}A(a,"is"),i.is=a})(e5||(e5={})),TT=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=gc.insert(a,s):$a.is(o)?(u=o,l=Su.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Su.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=gc.replace(a,s):$a.is(o)?(u=o,l=Su.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Su.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=gc.del(a):$a.is(s)?(l=s,o=Su.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Su.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},A(t,"TextEditChangeImpl"),t),kN=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if($a.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},A(e,"ChangeAnnotations"),e),Bse=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new kN(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(xT.is(s)){const o=new TT(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new TT(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(wT.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new TT(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new TT(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new kN,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;$f.is(s)||$a.is(s)?l=s:o=s;let u,h;if(l===void 0?u=qg.create(a,o):(h=$a.is(l)?l:this._changeAnnotations.manage(l),u=qg.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;$f.is(o)||$a.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Vg.create(a,s,l):(d=$a.is(u)?u:this._changeAnnotations.manage(u),h=Vg.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;$f.is(s)||$a.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Ug.create(a,o):(h=$a.is(l)?l:this._changeAnnotations.manage(l),u=Ug.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},A(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.string(l.uri)}A(s,"is"),i.is=s})(EN||(EN={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.string(l.uri)&&it.integer(l.version)}A(s,"is"),i.is=s})(AN||(AN={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.string(l.uri)&&(l.version===null||it.integer(l.version))}A(s,"is"),i.is=s})(wT||(wT={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.string(l.uri)&&it.string(l.languageId)&&it.integer(l.version)&&it.string(l.text)}A(s,"is"),i.is=s})(_N||(_N={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}A(a,"is"),i.is=a})(t5||(t5={})),(function(i){function a(s){const o=s;return it.objectLiteral(s)&&t5.is(o.kind)&&it.string(o.value)}A(a,"is"),i.is=a})(Hg||(Hg={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(RN||(RN={})),(function(i){i.PlainText=1,i.Snippet=2})(LN||(LN={})),(function(i){i.Deprecated=1})(IN||(IN={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l&&it.string(l.newText)&&on.is(l.insert)&&on.is(l.replace)}A(s,"is"),i.is=s})(MN||(MN={})),(function(i){i.asIs=1,i.adjustIndentation=2})(DN||(DN={})),(function(i){function a(s){const o=s;return o&&(it.string(o.detail)||o.detail===void 0)&&(it.string(o.description)||o.description===void 0)}A(a,"is"),i.is=a})(NN||(NN={})),(function(i){function a(s){return{label:s}}A(a,"create"),i.create=a})(ON||(ON={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}A(a,"create"),i.create=a})($N||($N={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}A(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return it.string(l)||it.objectLiteral(l)&&it.string(l.language)&&it.string(l.value)}A(s,"is"),i.is=s})(CT||(CT={})),(function(i){function a(s){let o=s;return!!o&&it.objectLiteral(o)&&(Hg.is(o.contents)||CT.is(o.contents)||it.typedArray(o.contents,CT.is))&&(s.range===void 0||on.is(s.range))}A(a,"is"),i.is=a})(PN||(PN={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}A(a,"create"),i.create=a})(BN||(BN={})),(function(i){function a(s,o,...l){let u={label:s};return it.defined(o)&&(u.documentation=o),it.defined(l)?u.parameters=l:u.parameters=[],u}A(a,"create"),i.create=a})(FN||(FN={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(zN||(zN={})),(function(i){function a(s,o){let l={range:s};return it.number(o)&&(l.kind=o),l}A(a,"create"),i.create=a})(GN||(GN={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(WN||(WN={})),(function(i){i.Deprecated=1})(qN||(qN={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}A(a,"create"),i.create=a})(VN||(VN={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}A(a,"create"),i.create=a})(UN||(UN={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}A(a,"create"),i.create=a;function s(o){let l=o;return l&&it.string(l.name)&&it.number(l.kind)&&on.is(l.range)&&on.is(l.selectionRange)&&(l.detail===void 0||it.string(l.detail))&&(l.deprecated===void 0||it.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}A(s,"is"),i.is=s})(HN||(HN={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(YN||(YN={})),(function(i){i.Invoked=1,i.Automatic=2})(ST||(ST={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.typedArray(l.diagnostics,bT.is)&&(l.only===void 0||it.typedArray(l.only,it.string))&&(l.triggerKind===void 0||l.triggerKind===ST.Invoked||l.triggerKind===ST.Automatic)}A(s,"is"),i.is=s})(XN||(XN={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Of.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&it.string(l.title)&&(l.diagnostics===void 0||it.typedArray(l.diagnostics,bT.is))&&(l.kind===void 0||it.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Of.is(l.command))&&(l.isPreferred===void 0||it.boolean(l.isPreferred))&&(l.edit===void 0||e5.is(l.edit))}A(s,"is"),i.is=s})(jN||(jN={})),(function(i){function a(o,l){let u={range:o};return it.defined(l)&&(u.data=l),u}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&on.is(l.range)&&(it.undefined(l.command)||Of.is(l.command))}A(s,"is"),i.is=s})(KN||(KN={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&it.uinteger(l.tabSize)&&it.boolean(l.insertSpaces)}A(s,"is"),i.is=s})(ZN||(ZN={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}A(a,"create"),i.create=a;function s(o){let l=o;return it.defined(l)&&on.is(l.range)&&(it.undefined(l.target)||it.string(l.target))}A(s,"is"),i.is=s})(QN||(QN={})),(function(i){function a(o,l){return{range:o,parent:l}}A(a,"create"),i.create=a;function s(o){let l=o;return it.objectLiteral(l)&&on.is(l.range)&&(l.parent===void 0||i.is(l.parent))}A(s,"is"),i.is=s})(JN||(JN={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(e9||(e9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(t9||(t9={})),(function(i){function a(s){const o=s;return it.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}A(a,"is"),i.is=a})(r9||(r9={})),(function(i){function a(o,l){return{range:o,text:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&on.is(l.range)&&it.string(l.text)}A(s,"is"),i.is=s})(n9||(n9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&on.is(l.range)&&it.boolean(l.caseSensitiveLookup)&&(it.string(l.variableName)||l.variableName===void 0)}A(s,"is"),i.is=s})(i9||(i9={})),(function(i){function a(o,l){return{range:o,expression:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&on.is(l.range)&&(it.string(l.expression)||l.expression===void 0)}A(s,"is"),i.is=s})(a9||(a9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}A(a,"create"),i.create=a;function s(o){const l=o;return it.defined(l)&&on.is(o.stoppedLocation)}A(s,"is"),i.is=s})(s9||(s9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}A(a,"is"),i.is=a})(r5||(r5={})),(function(i){function a(o){return{value:o}}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&(l.tooltip===void 0||it.string(l.tooltip)||Hg.is(l.tooltip))&&(l.location===void 0||vT.is(l.location))&&(l.command===void 0||Of.is(l.command))}A(s,"is"),i.is=s})(n5||(n5={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return it.objectLiteral(l)&&En.is(l.position)&&(it.string(l.label)||it.typedArray(l.label,n5.is))&&(l.kind===void 0||r5.is(l.kind))&&l.textEdits===void 0||it.typedArray(l.textEdits,gc.is)&&(l.tooltip===void 0||it.string(l.tooltip)||Hg.is(l.tooltip))&&(l.paddingLeft===void 0||it.boolean(l.paddingLeft))&&(l.paddingRight===void 0||it.boolean(l.paddingRight))}A(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(s){return{kind:"snippet",value:s}}A(a,"createSnippet"),i.createSnippet=a})(l9||(l9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}A(a,"create"),i.create=a})(c9||(c9={})),(function(i){function a(s){return{items:s}}A(a,"create"),i.create=a})(u9||(u9={})),(function(i){i.Invoked=0,i.Automatic=1})(h9||(h9={})),(function(i){function a(s,o){return{range:s,text:o}}A(a,"create"),i.create=a})(d9||(d9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}A(a,"create"),i.create=a})(f9||(f9={})),(function(i){function a(s){const o=s;return it.objectLiteral(o)&&ZE.is(o.uri)&&it.string(o.name)}A(a,"is"),i.is=a})(p9||(p9={})),Fse=[` `,`\r -`,"\r"],(function(i){function a(u,h,d,f){return new jte(u,h,d,f)}E(a,"create"),i.create=a;function s(u){let h=u;return!!(rt.defined(h)&&rt.string(h.uri)&&(rt.undefined(h.languageId)||rt.string(h.languageId))&&rt.uinteger(h.lineCount)&&rt.func(h.getText)&&rt.func(h.positionAt)&&rt.func(h.offsetAt))}E(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}E(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}A(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return on.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return on.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}E(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}E(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}E(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}E(h,"number"),i.number=h;function d(v,x,b){return a.call(v)==="[object Number]"&&x<=v&&v<=b}E(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}E(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}E(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}E(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}E(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}E(y,"typedArray"),i.typedArray=y})(rt||(rt={}))}}),Xd=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}E(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}E(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Rx=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}E(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}E(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}E(n,"number"),t.number=n;function i(l){return l instanceof Error}E(i,"error"),t.error=i;function a(l){return typeof l=="function"}E(a,"func"),t.func=a;function s(l){return Array.isArray(l)}E(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}E(o,"stringArray"),t.stringArray=o}}),rg=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Xd(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:E(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:E(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},E(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),P3=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Xd(),r=Rx(),n=rg(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}E(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},E(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Zte=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var F,A,R,N,M,I,$,P,B,q,V,X,W,ie,K,se,te,Z,ee,ne,oe,fe,Ae,Re,Ge;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=Rx(),r;(function(Ce){Ce.ParseError=-32700,Ce.InvalidRequest=-32600,Ce.MethodNotFound=-32601,Ce.InvalidParams=-32602,Ce.InternalError=-32603,Ce.jsonrpcReservedErrorRangeStart=-32099,Ce.serverErrorStart=-32099,Ce.MessageWriteError=-32099,Ce.MessageReadError=-32098,Ce.PendingResponseRejected=-32097,Ce.ConnectionInactive=-32096,Ce.ServerNotInitialized=-32002,Ce.UnknownErrorCode=-32001,Ce.jsonrpcReservedErrorRangeEnd=-32e3,Ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(F=class extends Error{constructor(be,Fe,ye){super(Fe),this.code=e.number(be)?be:r.UnknownErrorCode,this.data=ye,Object.setPrototypeOf(this,F.prototype)}toJson(){const be={code:this.code,message:this.message};return this.data!==void 0&&(be.data=this.data),be}},E(F,"ResponseError"),F);t.ResponseError=n;var i=(A=class{constructor(be){this.kind=be}static is(be){return be===A.auto||be===A.byName||be===A.byPosition}toString(){return this.kind}},E(A,"ParameterStructures"),A);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(be,Fe){this.method=be,this.numberOfParams=Fe}get parameterStructures(){return i.auto}},E(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(N=class extends a{constructor(be){super(be,0)}},E(N,"RequestType0"),N);t.RequestType0=s;var o=(M=class extends a{constructor(be,Fe=i.auto){super(be,1),this._parameterStructures=Fe}get parameterStructures(){return this._parameterStructures}},E(M,"RequestType"),M);t.RequestType=o;var l=(I=class extends a{constructor(be,Fe=i.auto){super(be,1),this._parameterStructures=Fe}get parameterStructures(){return this._parameterStructures}},E(I,"RequestType1"),I);t.RequestType1=l;var u=($=class extends a{constructor(be){super(be,2)}},E($,"RequestType2"),$);t.RequestType2=u;var h=(P=class extends a{constructor(be){super(be,3)}},E(P,"RequestType3"),P);t.RequestType3=h;var d=(B=class extends a{constructor(be){super(be,4)}},E(B,"RequestType4"),B);t.RequestType4=d;var f=(q=class extends a{constructor(be){super(be,5)}},E(q,"RequestType5"),q);t.RequestType5=f;var p=(V=class extends a{constructor(be){super(be,6)}},E(V,"RequestType6"),V);t.RequestType6=p;var g=(X=class extends a{constructor(be){super(be,7)}},E(X,"RequestType7"),X);t.RequestType7=g;var m=(W=class extends a{constructor(be){super(be,8)}},E(W,"RequestType8"),W);t.RequestType8=m;var y=(ie=class extends a{constructor(be){super(be,9)}},E(ie,"RequestType9"),ie);t.RequestType9=y;var v=(K=class extends a{constructor(be,Fe=i.auto){super(be,1),this._parameterStructures=Fe}get parameterStructures(){return this._parameterStructures}},E(K,"NotificationType"),K);t.NotificationType=v;var x=(se=class extends a{constructor(be){super(be,0)}},E(se,"NotificationType0"),se);t.NotificationType0=x;var b=(te=class extends a{constructor(be,Fe=i.auto){super(be,1),this._parameterStructures=Fe}get parameterStructures(){return this._parameterStructures}},E(te,"NotificationType1"),te);t.NotificationType1=b;var w=(Z=class extends a{constructor(be){super(be,2)}},E(Z,"NotificationType2"),Z);t.NotificationType2=w;var k=(ee=class extends a{constructor(be){super(be,3)}},E(ee,"NotificationType3"),ee);t.NotificationType3=k;var S=(ne=class extends a{constructor(be){super(be,4)}},E(ne,"NotificationType4"),ne);t.NotificationType4=S;var C=(oe=class extends a{constructor(be){super(be,5)}},E(oe,"NotificationType5"),oe);t.NotificationType5=C;var _=(fe=class extends a{constructor(be){super(be,6)}},E(fe,"NotificationType6"),fe);t.NotificationType6=_;var L=(Ae=class extends a{constructor(be){super(be,7)}},E(Ae,"NotificationType7"),Ae);t.NotificationType7=L;var O=(Re=class extends a{constructor(be){super(be,8)}},E(Re,"NotificationType8"),Re);t.NotificationType8=O;var D=(Ge=class extends a{constructor(be){super(be,9)}},E(Ge,"NotificationType9"),Ge);t.NotificationType9=D;var z;(function(Ce){function be(He){const xe=He;return xe&&e.string(xe.method)&&(e.string(xe.id)||e.number(xe.id))}E(be,"isRequest"),Ce.isRequest=be;function Fe(He){const xe=He;return xe&&e.string(xe.method)&&He.id===void 0}E(Fe,"isNotification"),Ce.isNotification=Fe;function ye(He){const xe=He;return xe&&(xe.result!==void 0||!!xe.error)&&(e.string(xe.id)||e.number(xe.id)||xe.id===null)}E(ye,"isResponse"),Ce.isResponse=ye})(z||(t.Message=z={}))}}),Qte=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},E(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},E(s,"LRUCache"),s);t.LRUCache=i}}),GUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}E(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),qUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=P3(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},E(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},E(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},E(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},E(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),Jte=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Xd(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},E(n,"Semaphore"),n);t.Semaphore=r}}),VUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Xd(),r=Rx(),n=rg(),i=Jte(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}E(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},E(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}E(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},E(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),WUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Xd(),r=Rx(),n=Jte(),i=rg(),a="Content-Length: ",s=`\r -`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}E(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},E(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}E(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},E(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),UUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return En.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return En.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}A(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}A(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}A(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}A(h,"number"),i.number=h;function d(v,T,x){return a.call(v)==="[object Number]"&&T<=v&&v<=x}A(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}A(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}A(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}A(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}A(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}A(y,"typedArray"),i.typedArray=y})(it||(it={}))}}),Pf=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}A(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}A(i,"install"),n.install=i})(r||(r={})),t.default=r}}),ET=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}A(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}A(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}A(n,"number"),t.number=n;function i(l){return l instanceof Error}A(i,"error"),t.error=i;function a(l){return typeof l=="function"}A(a,"func"),t.func=a;function s(l){return Array.isArray(l)}A(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}A(o,"stringArray"),t.stringArray=o}}),Yg=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Pf(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:A(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:A(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},A(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),i5=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Pf(),r=ET(),n=Yg(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}A(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},A(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},A(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Gse=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var $,_,R,O,D,N,B,F,G,z,W,V,H,te,Y,se,J,Z,ee,re,ge,ae,_e,Fe,qe;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=ET(),r;(function(ue){ue.ParseError=-32700,ue.InvalidRequest=-32600,ue.MethodNotFound=-32601,ue.InvalidParams=-32602,ue.InternalError=-32603,ue.jsonrpcReservedErrorRangeStart=-32099,ue.serverErrorStart=-32099,ue.MessageWriteError=-32099,ue.MessageReadError=-32098,ue.PendingResponseRejected=-32097,ue.ConnectionInactive=-32096,ue.ServerNotInitialized=-32002,ue.UnknownErrorCode=-32001,ue.jsonrpcReservedErrorRangeEnd=-32e3,ue.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=($=class extends Error{constructor(de,Ce,me){super(Ce),this.code=e.number(de)?de:r.UnknownErrorCode,this.data=me,Object.setPrototypeOf(this,$.prototype)}toJson(){const de={code:this.code,message:this.message};return this.data!==void 0&&(de.data=this.data),de}},A($,"ResponseError"),$);t.ResponseError=n;var i=(_=class{constructor(de){this.kind=de}static is(de){return de===_.auto||de===_.byName||de===_.byPosition}toString(){return this.kind}},A(_,"ParameterStructures"),_);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(de,Ce){this.method=de,this.numberOfParams=Ce}get parameterStructures(){return i.auto}},A(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(O=class extends a{constructor(de){super(de,0)}},A(O,"RequestType0"),O);t.RequestType0=s;var o=(D=class extends a{constructor(de,Ce=i.auto){super(de,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},A(D,"RequestType"),D);t.RequestType=o;var l=(N=class extends a{constructor(de,Ce=i.auto){super(de,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},A(N,"RequestType1"),N);t.RequestType1=l;var u=(B=class extends a{constructor(de){super(de,2)}},A(B,"RequestType2"),B);t.RequestType2=u;var h=(F=class extends a{constructor(de){super(de,3)}},A(F,"RequestType3"),F);t.RequestType3=h;var d=(G=class extends a{constructor(de){super(de,4)}},A(G,"RequestType4"),G);t.RequestType4=d;var f=(z=class extends a{constructor(de){super(de,5)}},A(z,"RequestType5"),z);t.RequestType5=f;var p=(W=class extends a{constructor(de){super(de,6)}},A(W,"RequestType6"),W);t.RequestType6=p;var g=(V=class extends a{constructor(de){super(de,7)}},A(V,"RequestType7"),V);t.RequestType7=g;var m=(H=class extends a{constructor(de){super(de,8)}},A(H,"RequestType8"),H);t.RequestType8=m;var y=(te=class extends a{constructor(de){super(de,9)}},A(te,"RequestType9"),te);t.RequestType9=y;var v=(Y=class extends a{constructor(de,Ce=i.auto){super(de,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},A(Y,"NotificationType"),Y);t.NotificationType=v;var T=(se=class extends a{constructor(de){super(de,0)}},A(se,"NotificationType0"),se);t.NotificationType0=T;var x=(J=class extends a{constructor(de,Ce=i.auto){super(de,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},A(J,"NotificationType1"),J);t.NotificationType1=x;var w=(Z=class extends a{constructor(de){super(de,2)}},A(Z,"NotificationType2"),Z);t.NotificationType2=w;var C=(ee=class extends a{constructor(de){super(de,3)}},A(ee,"NotificationType3"),ee);t.NotificationType3=C;var k=(re=class extends a{constructor(de){super(de,4)}},A(re,"NotificationType4"),re);t.NotificationType4=k;var S=(ge=class extends a{constructor(de){super(de,5)}},A(ge,"NotificationType5"),ge);t.NotificationType5=S;var E=(ae=class extends a{constructor(de){super(de,6)}},A(ae,"NotificationType6"),ae);t.NotificationType6=E;var L=(_e=class extends a{constructor(de){super(de,7)}},A(_e,"NotificationType7"),_e);t.NotificationType7=L;var M=(Fe=class extends a{constructor(de){super(de,8)}},A(Fe,"NotificationType8"),Fe);t.NotificationType8=M;var I=(qe=class extends a{constructor(de){super(de,9)}},A(qe,"NotificationType9"),qe);t.NotificationType9=I;var P;(function(ue){function de($e){const we=$e;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}A(de,"isRequest"),ue.isRequest=de;function Ce($e){const we=$e;return we&&e.string(we.method)&&$e.id===void 0}A(Ce,"isNotification"),ue.isNotification=Ce;function me($e){const we=$e;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}A(me,"isResponse"),ue.isResponse=me})(P||(t.Message=P={}))}}),Wse=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},A(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},A(s,"LRUCache"),s);t.LRUCache=i}}),qZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}A(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),VZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=i5(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},A(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},A(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},A(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},A(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),qse=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Pf(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},A(n,"Semaphore"),n);t.Semaphore=r}}),UZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Pf(),r=ET(),n=Yg(),i=qse(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}A(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},A(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const x of p.contentDecoders)y.set(x.name,x);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const x of p.contentTypeDecoders)T.set(x.name,x)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}A(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},A(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),HZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Pf(),r=ET(),n=qse(),i=Yg(),a="Content-Length: ",s=`\r +`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}A(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},A(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}A(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},A(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),YZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},E(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),HUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var F,A;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Xd(),r=Rx(),n=Zte(),i=Qte(),a=rg(),s=P3(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function N(M){return typeof M=="string"||typeof M=="number"}E(N,"is"),R.is=N})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(F=class{constructor(){}},E(F,"ProgressType"),F);t.ProgressType=h;var d;(function(R){function N(M){return r.func(M)}E(N,"is"),R.is=N})(d||(d={})),t.NullLogger=Object.freeze({error:E(()=>{},"error"),warn:E(()=>{},"warn"),info:E(()=>{},"info"),log:E(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function N(I){if(!r.string(I))return R.Off;switch(I=I.toLowerCase(),I){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}E(N,"fromString"),R.fromString=N;function M(I){switch(I){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}E(M,"toString"),R.toString=M})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function N(M){return r.string(M)?(M=M.toLowerCase(),M==="json"?R.JSON:R.Text):R.Text}E(N,"fromString"),R.fromString=N})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(A=class extends Error{constructor(N,M){super(M),this.code=N,Object.setPrototypeOf(this,A.prototype)}},E(A,"ConnectionError"),A);t.ConnectionError=x;var b;(function(R){function N(M){const I=M;return I&&r.func(I.cancelUndispatched)}E(N,"is"),R.is=N})(b||(t.ConnectionStrategy=b={}));var w;(function(R){function N(M){const I=M;return I&&(I.kind===void 0||I.kind==="id")&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(w||(t.IdCancellationReceiverStrategy=w={}));var k;(function(R){function N(M){const I=M;return I&&I.kind==="request"&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(k||(t.RequestCancellationReceiverStrategy=k={}));var S;(function(R){R.Message=Object.freeze({createCancellationTokenSource(M){return new s.CancellationTokenSource}});function N(M){return w.is(M)||k.is(M)}E(N,"is"),R.is=N})(S||(t.CancellationReceiverStrategy=S={}));var C;(function(R){R.Message=Object.freeze({sendCancellation(M,I){return M.sendNotification(o.type,{id:I})},cleanup(M){}});function N(M){const I=M;return I&&r.func(I.sendCancellation)&&r.func(I.cleanup)}E(N,"is"),R.is=N})(C||(t.CancellationSenderStrategy=C={}));var _;(function(R){R.Message=Object.freeze({receiver:S.Message,sender:C.Message});function N(M){const I=M;return I&&S.is(I.receiver)&&C.is(I.sender)}E(N,"is"),R.is=N})(_||(t.CancellationStrategy=_={}));var L;(function(R){function N(M){const I=M;return I&&r.func(I.handleMessage)}E(N,"is"),R.is=N})(L||(t.MessageStrategy=L={}));var O;(function(R){function N(M){const I=M;return I&&(_.is(I.cancellationStrategy)||b.is(I.connectionStrategy)||L.is(I.messageStrategy))}E(N,"is"),R.is=N})(O||(t.ConnectionOptions=O={}));var D;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(D||(D={}));function z(R,N,M,I){const $=M!==void 0?M:t.NullLogger;let P=0,B=0,q=0;const V="2.0";let X;const W=new Map;let ie;const K=new Map,se=new Map;let te,Z=new i.LinkedMap,ee=new Map,ne=new Set,oe=new Map,fe=f.Off,Ae=g.Text,Re,Ge=D.New;const Ce=new a.Emitter,be=new a.Emitter,Fe=new a.Emitter,ye=new a.Emitter,He=new a.Emitter,xe=I&&I.cancellationStrategy?I.cancellationStrategy:_.Message;function Ve(me){if(me===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+me.toString()}E(Ve,"createRequestQueueKey");function Je(me){return me===null?"res-unknown-"+(++q).toString():"res-"+me.toString()}E(Je,"createResponseQueueKey");function nt(){return"not-"+(++B).toString()}E(nt,"createNotificationQueueKey");function tt(me,et){n.Message.isRequest(et)?me.set(Ve(et.id),et):n.Message.isResponse(et)?me.set(Je(et.id),et):me.set(nt(),et)}E(tt,"addMessageToQueue");function Ze(me){}E(Ze,"cancelUndispatched");function Ee(){return Ge===D.Listening}E(Ee,"isListening");function Se(){return Ge===D.Closed}E(Se,"isClosed");function Y(){return Ge===D.Disposed}E(Y,"isDisposed");function ce(){(Ge===D.New||Ge===D.Listening)&&(Ge=D.Closed,be.fire(void 0))}E(ce,"closeHandler");function j(me){Ce.fire([me,void 0,void 0])}E(j,"readErrorHandler");function pe(me){Ce.fire(me)}E(pe,"writeErrorHandler"),R.onClose(ce),R.onError(j),N.onClose(ce),N.onError(pe);function re(){te||Z.size===0||(te=(0,e.default)().timer.setImmediate(()=>{te=void 0,ve()}))}E(re,"triggerMessageQueue");function Pe(me){n.Message.isRequest(me)?Me(me):n.Message.isNotification(me)?Le(me):n.Message.isResponse(me)?qe(me):Ke(me)}E(Pe,"handleMessage");function ve(){if(Z.size===0)return;const me=Z.shift();try{const et=I==null?void 0:I.messageStrategy;L.is(et)?et.handleMessage(me,Pe):Pe(me)}finally{re()}}E(ve,"processMessageQueue");const Ue=E(me=>{try{if(n.Message.isNotification(me)&&me.method===o.type.method){const et=me.params.id,lt=Ve(et),Rt=Z.get(lt);if(n.Message.isRequest(Rt)){const or=I==null?void 0:I.connectionStrategy,ir=or&&or.cancelUndispatched?or.cancelUndispatched(Rt,Ze):void 0;if(ir&&(ir.error!==void 0||ir.result!==void 0)){Z.delete(lt),oe.delete(et),ir.id=Rt.id,ct(ir,me.method,Date.now()),N.write(ir).catch(()=>$.error("Sending response for canceled message failed."));return}}const Ft=oe.get(et);if(Ft!==void 0){Ft.cancel(),Et(me);return}else ne.add(et)}tt(Z,me)}finally{re()}},"callback");function Me(me){if(Y())return;function et(sr,Rr,Jt){const Ir={jsonrpc:V,id:me.id};sr instanceof n.ResponseError?Ir.error=sr.toJson():Ir.result=sr===void 0?null:sr,ct(Ir,Rr,Jt),N.write(Ir).catch(()=>$.error("Sending response failed."))}E(et,"reply");function lt(sr,Rr,Jt){const Ir={jsonrpc:V,id:me.id,error:sr.toJson()};ct(Ir,Rr,Jt),N.write(Ir).catch(()=>$.error("Sending response failed."))}E(lt,"replyError");function Rt(sr,Rr,Jt){sr===void 0&&(sr=null);const Ir={jsonrpc:V,id:me.id,result:sr};ct(Ir,Rr,Jt),N.write(Ir).catch(()=>$.error("Sending response failed."))}E(Rt,"replySuccess"),we(me);const Ft=W.get(me.method);let or,ir;Ft&&(or=Ft.type,ir=Ft.handler);const xr=Date.now();if(ir||X){const sr=me.id??String(Date.now()),Rr=w.is(xe.receiver)?xe.receiver.createCancellationTokenSource(sr):xe.receiver.createCancellationTokenSource(me);me.id!==null&&ne.has(me.id)&&Rr.cancel(),me.id!==null&&oe.set(sr,Rr);try{let Jt;if(ir)if(me.params===void 0){if(or!==void 0&&or.numberOfParams!==0){lt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${me.method} defines ${or.numberOfParams} params but received none.`),me.method,xr);return}Jt=ir(Rr.token)}else if(Array.isArray(me.params)){if(or!==void 0&&or.parameterStructures===n.ParameterStructures.byName){lt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${me.method} defines parameters by name but received parameters by position`),me.method,xr);return}Jt=ir(...me.params,Rr.token)}else{if(or!==void 0&&or.parameterStructures===n.ParameterStructures.byPosition){lt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${me.method} defines parameters by position but received parameters by name`),me.method,xr);return}Jt=ir(me.params,Rr.token)}else X&&(Jt=X(me.method,me.params,Rr.token));const Ir=Jt;Jt?Ir.then?Ir.then(ln=>{oe.delete(sr),et(ln,me.method,xr)},ln=>{oe.delete(sr),ln instanceof n.ResponseError?lt(ln,me.method,xr):ln&&r.string(ln.message)?lt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${me.method} failed with message: ${ln.message}`),me.method,xr):lt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${me.method} failed unexpectedly without providing any details.`),me.method,xr)}):(oe.delete(sr),et(Jt,me.method,xr)):(oe.delete(sr),Rt(Jt,me.method,xr))}catch(Jt){oe.delete(sr),Jt instanceof n.ResponseError?et(Jt,me.method,xr):Jt&&r.string(Jt.message)?lt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${me.method} failed with message: ${Jt.message}`),me.method,xr):lt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${me.method} failed unexpectedly without providing any details.`),me.method,xr)}}else lt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${me.method}`),me.method,xr)}E(Me,"handleRequest");function qe(me){if(!Y())if(me.id===null)me.error?$.error(`Received response message without id: Error is: -${JSON.stringify(me.error,void 0,4)}`):$.error("Received response message without id. No further error information provided.");else{const et=me.id,lt=ee.get(et);if(yt(me,lt),lt!==void 0){ee.delete(et);try{if(me.error){const Rt=me.error;lt.reject(new n.ResponseError(Rt.code,Rt.message,Rt.data))}else if(me.result!==void 0)lt.resolve(me.result);else throw new Error("Should never happen.")}catch(Rt){Rt.message?$.error(`Response handler '${lt.method}' failed with message: ${Rt.message}`):$.error(`Response handler '${lt.method}' failed unexpectedly.`)}}}}E(qe,"handleResponse");function Le(me){if(Y())return;let et,lt;if(me.method===o.type.method){const Rt=me.params.id;ne.delete(Rt),Et(me);return}else{const Rt=K.get(me.method);Rt&&(lt=Rt.handler,et=Rt.type)}if(lt||ie)try{if(Et(me),lt)if(me.params===void 0)et!==void 0&&et.numberOfParams!==0&&et.parameterStructures!==n.ParameterStructures.byName&&$.error(`Notification ${me.method} defines ${et.numberOfParams} params but received none.`),lt();else if(Array.isArray(me.params)){const Rt=me.params;me.method===u.type.method&&Rt.length===2&&l.is(Rt[0])?lt({token:Rt[0],value:Rt[1]}):(et!==void 0&&(et.parameterStructures===n.ParameterStructures.byName&&$.error(`Notification ${me.method} defines parameters by name but received parameters by position`),et.numberOfParams!==me.params.length&&$.error(`Notification ${me.method} defines ${et.numberOfParams} params but received ${Rt.length} arguments`)),lt(...Rt))}else et!==void 0&&et.parameterStructures===n.ParameterStructures.byPosition&&$.error(`Notification ${me.method} defines parameters by position but received parameters by name`),lt(me.params);else ie&&ie(me.method,me.params)}catch(Rt){Rt.message?$.error(`Notification handler '${me.method}' failed with message: ${Rt.message}`):$.error(`Notification handler '${me.method}' failed unexpectedly.`)}else Fe.fire(me)}E(Le,"handleNotification");function Ke(me){if(!me){$.error("Received empty message.");return}$.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(me,null,4)}`);const et=me;if(r.string(et.id)||r.number(et.id)){const lt=et.id,Rt=ee.get(lt);Rt&&Rt.reject(new Error("The received response has neither a result nor an error property."))}}E(Ke,"handleInvalidMessage");function De(me){if(me!=null)switch(fe){case f.Verbose:return JSON.stringify(me,null,4);case f.Compact:return JSON.stringify(me);default:return}}E(De,"stringifyTrace");function it(me){if(!(fe===f.Off||!Re))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&me.params&&(et=`Params: ${De(me.params)} +${y}`);const T=y.substr(0,v),x=y.substr(v+1).trim();p.set(o?T.toLowerCase():T,x)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},A(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),XZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var $,_;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Pf(),r=ET(),n=Gse(),i=Wse(),a=Yg(),s=i5(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function O(D){return typeof D=="string"||typeof D=="number"}A(O,"is"),R.is=O})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=($=class{constructor(){}},A($,"ProgressType"),$);t.ProgressType=h;var d;(function(R){function O(D){return r.func(D)}A(O,"is"),R.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:A(()=>{},"error"),warn:A(()=>{},"warn"),info:A(()=>{},"info"),log:A(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function O(N){if(!r.string(N))return R.Off;switch(N=N.toLowerCase(),N){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}A(O,"fromString"),R.fromString=O;function D(N){switch(N){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}A(D,"toString"),R.toString=D})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function O(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?R.JSON:R.Text):R.Text}A(O,"fromString"),R.fromString=O})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(_=class extends Error{constructor(O,D){super(D),this.code=O,Object.setPrototypeOf(this,_.prototype)}},A(_,"ConnectionError"),_);t.ConnectionError=T;var x;(function(R){function O(D){const N=D;return N&&r.func(N.cancelUndispatched)}A(O,"is"),R.is=O})(x||(t.ConnectionStrategy=x={}));var w;(function(R){function O(D){const N=D;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A(O,"is"),R.is=O})(w||(t.IdCancellationReceiverStrategy=w={}));var C;(function(R){function O(D){const N=D;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A(O,"is"),R.is=O})(C||(t.RequestCancellationReceiverStrategy=C={}));var k;(function(R){R.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function O(D){return w.is(D)||C.is(D)}A(O,"is"),R.is=O})(k||(t.CancellationReceiverStrategy=k={}));var S;(function(R){R.Message=Object.freeze({sendCancellation(D,N){return D.sendNotification(o.type,{id:N})},cleanup(D){}});function O(D){const N=D;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}A(O,"is"),R.is=O})(S||(t.CancellationSenderStrategy=S={}));var E;(function(R){R.Message=Object.freeze({receiver:k.Message,sender:S.Message});function O(D){const N=D;return N&&k.is(N.receiver)&&S.is(N.sender)}A(O,"is"),R.is=O})(E||(t.CancellationStrategy=E={}));var L;(function(R){function O(D){const N=D;return N&&r.func(N.handleMessage)}A(O,"is"),R.is=O})(L||(t.MessageStrategy=L={}));var M;(function(R){function O(D){const N=D;return N&&(E.is(N.cancellationStrategy)||x.is(N.connectionStrategy)||L.is(N.messageStrategy))}A(O,"is"),R.is=O})(M||(t.ConnectionOptions=M={}));var I;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(I||(I={}));function P(R,O,D,N){const B=D!==void 0?D:t.NullLogger;let F=0,G=0,z=0;const W="2.0";let V;const H=new Map;let te;const Y=new Map,se=new Map;let J,Z=new i.LinkedMap,ee=new Map,re=new Set,ge=new Map,ae=f.Off,_e=g.Text,Fe,qe=I.New;const ue=new a.Emitter,de=new a.Emitter,Ce=new a.Emitter,me=new a.Emitter,$e=new a.Emitter,we=N&&N.cancellationStrategy?N.cancellationStrategy:E.Message;function Le(Ae){if(Ae===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ae.toString()}A(Le,"createRequestQueueKey");function Ye(Ae){return Ae===null?"res-unknown-"+(++z).toString():"res-"+Ae.toString()}A(Ye,"createResponseQueueKey");function ce(){return"not-"+(++G).toString()}A(ce,"createNotificationQueueKey");function ye(Ae,tt){n.Message.isRequest(tt)?Ae.set(Le(tt.id),tt):n.Message.isResponse(tt)?Ae.set(Ye(tt.id),tt):Ae.set(ce(),tt)}A(ye,"addMessageToQueue");function ke(Ae){}A(ke,"cancelUndispatched");function le(){return qe===I.Listening}A(le,"isListening");function pe(){return qe===I.Closed}A(pe,"isClosed");function U(){return qe===I.Disposed}A(U,"isDisposed");function oe(){(qe===I.New||qe===I.Listening)&&(qe=I.Closed,de.fire(void 0))}A(oe,"closeHandler");function Q(Ae){ue.fire([Ae,void 0,void 0])}A(Q,"readErrorHandler");function fe(Ae){ue.fire(Ae)}A(fe,"writeErrorHandler"),R.onClose(oe),R.onError(Q),O.onClose(oe),O.onError(fe);function j(){J||Z.size===0||(J=(0,e.default)().timer.setImmediate(()=>{J=void 0,Se()}))}A(j,"triggerMessageQueue");function Be(Ae){n.Message.isRequest(Ae)?De(Ae):n.Message.isNotification(Ae)?Ne(Ae):n.Message.isResponse(Ae)?We(Ae):Ze(Ae)}A(Be,"handleMessage");function Se(){if(Z.size===0)return;const Ae=Z.shift();try{const tt=N==null?void 0:N.messageStrategy;L.is(tt)?tt.handleMessage(Ae,Be):Be(Ae)}finally{j()}}A(Se,"processMessageQueue");const He=A(Ae=>{try{if(n.Message.isNotification(Ae)&&Ae.method===o.type.method){const tt=Ae.params.id,ct=Le(tt),Mt=Z.get(ct);if(n.Message.isRequest(Mt)){const gr=N==null?void 0:N.connectionStrategy,lr=gr&&gr.cancelUndispatched?gr.cancelUndispatched(Mt,ke):void 0;if(lr&&(lr.error!==void 0||lr.result!==void 0)){Z.delete(ct),ge.delete(tt),lr.id=Mt.id,pt(lr,Ae.method,Date.now()),O.write(lr).catch(()=>B.error("Sending response for canceled message failed."));return}}const Wt=ge.get(tt);if(Wt!==void 0){Wt.cancel(),kt(Ae);return}else re.add(tt)}ye(Z,Ae)}finally{j()}},"callback");function De(Ae){if(U())return;function tt(fr,Or,ir){const cr={jsonrpc:W,id:Ae.id};fr instanceof n.ResponseError?cr.error=fr.toJson():cr.result=fr===void 0?null:fr,pt(cr,Or,ir),O.write(cr).catch(()=>B.error("Sending response failed."))}A(tt,"reply");function ct(fr,Or,ir){const cr={jsonrpc:W,id:Ae.id,error:fr.toJson()};pt(cr,Or,ir),O.write(cr).catch(()=>B.error("Sending response failed."))}A(ct,"replyError");function Mt(fr,Or,ir){fr===void 0&&(fr=null);const cr={jsonrpc:W,id:Ae.id,result:fr};pt(cr,Or,ir),O.write(cr).catch(()=>B.error("Sending response failed."))}A(Mt,"replySuccess"),Re(Ae);const Wt=H.get(Ae.method);let gr,lr;Wt&&(gr=Wt.type,lr=Wt.handler);const Tr=Date.now();if(lr||V){const fr=Ae.id??String(Date.now()),Or=w.is(we.receiver)?we.receiver.createCancellationTokenSource(fr):we.receiver.createCancellationTokenSource(Ae);Ae.id!==null&&re.has(Ae.id)&&Or.cancel(),Ae.id!==null&&ge.set(fr,Or);try{let ir;if(lr)if(Ae.params===void 0){if(gr!==void 0&&gr.numberOfParams!==0){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ae.method} defines ${gr.numberOfParams} params but received none.`),Ae.method,Tr);return}ir=lr(Or.token)}else if(Array.isArray(Ae.params)){if(gr!==void 0&&gr.parameterStructures===n.ParameterStructures.byName){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ae.method} defines parameters by name but received parameters by position`),Ae.method,Tr);return}ir=lr(...Ae.params,Or.token)}else{if(gr!==void 0&&gr.parameterStructures===n.ParameterStructures.byPosition){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ae.method} defines parameters by position but received parameters by name`),Ae.method,Tr);return}ir=lr(Ae.params,Or.token)}else V&&(ir=V(Ae.method,Ae.params,Or.token));const cr=ir;ir?cr.then?cr.then(Vr=>{ge.delete(fr),tt(Vr,Ae.method,Tr)},Vr=>{ge.delete(fr),Vr instanceof n.ResponseError?ct(Vr,Ae.method,Tr):Vr&&r.string(Vr.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ae.method} failed with message: ${Vr.message}`),Ae.method,Tr):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ae.method} failed unexpectedly without providing any details.`),Ae.method,Tr)}):(ge.delete(fr),tt(ir,Ae.method,Tr)):(ge.delete(fr),Mt(ir,Ae.method,Tr))}catch(ir){ge.delete(fr),ir instanceof n.ResponseError?tt(ir,Ae.method,Tr):ir&&r.string(ir.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ae.method} failed with message: ${ir.message}`),Ae.method,Tr):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ae.method} failed unexpectedly without providing any details.`),Ae.method,Tr)}}else ct(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ae.method}`),Ae.method,Tr)}A(De,"handleRequest");function We(Ae){if(!U())if(Ae.id===null)Ae.error?B.error(`Received response message without id: Error is: +${JSON.stringify(Ae.error,void 0,4)}`):B.error("Received response message without id. No further error information provided.");else{const tt=Ae.id,ct=ee.get(tt);if(bt(Ae,ct),ct!==void 0){ee.delete(tt);try{if(Ae.error){const Mt=Ae.error;ct.reject(new n.ResponseError(Mt.code,Mt.message,Mt.data))}else if(Ae.result!==void 0)ct.resolve(Ae.result);else throw new Error("Should never happen.")}catch(Mt){Mt.message?B.error(`Response handler '${ct.method}' failed with message: ${Mt.message}`):B.error(`Response handler '${ct.method}' failed unexpectedly.`)}}}}A(We,"handleResponse");function Ne(Ae){if(U())return;let tt,ct;if(Ae.method===o.type.method){const Mt=Ae.params.id;re.delete(Mt),kt(Ae);return}else{const Mt=Y.get(Ae.method);Mt&&(ct=Mt.handler,tt=Mt.type)}if(ct||te)try{if(kt(Ae),ct)if(Ae.params===void 0)tt!==void 0&&tt.numberOfParams!==0&&tt.parameterStructures!==n.ParameterStructures.byName&&B.error(`Notification ${Ae.method} defines ${tt.numberOfParams} params but received none.`),ct();else if(Array.isArray(Ae.params)){const Mt=Ae.params;Ae.method===u.type.method&&Mt.length===2&&l.is(Mt[0])?ct({token:Mt[0],value:Mt[1]}):(tt!==void 0&&(tt.parameterStructures===n.ParameterStructures.byName&&B.error(`Notification ${Ae.method} defines parameters by name but received parameters by position`),tt.numberOfParams!==Ae.params.length&&B.error(`Notification ${Ae.method} defines ${tt.numberOfParams} params but received ${Mt.length} arguments`)),ct(...Mt))}else tt!==void 0&&tt.parameterStructures===n.ParameterStructures.byPosition&&B.error(`Notification ${Ae.method} defines parameters by position but received parameters by name`),ct(Ae.params);else te&&te(Ae.method,Ae.params)}catch(Mt){Mt.message?B.error(`Notification handler '${Ae.method}' failed with message: ${Mt.message}`):B.error(`Notification handler '${Ae.method}' failed unexpectedly.`)}else Ce.fire(Ae)}A(Ne,"handleNotification");function Ze(Ae){if(!Ae){B.error("Received empty message.");return}B.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(Ae,null,4)}`);const tt=Ae;if(r.string(tt.id)||r.number(tt.id)){const ct=tt.id,Mt=ee.get(ct);Mt&&Mt.reject(new Error("The received response has neither a result nor an error property."))}}A(Ze,"handleInvalidMessage");function Pe(Ae){if(Ae!=null)switch(ae){case f.Verbose:return JSON.stringify(Ae,null,4);case f.Compact:return JSON.stringify(Ae);default:return}}A(Pe,"stringifyTrace");function nt(Ae){if(!(ae===f.Off||!Fe))if(_e===g.Text){let tt;(ae===f.Verbose||ae===f.Compact)&&Ae.params&&(tt=`Params: ${Pe(Ae.params)} -`),Re.log(`Sending request '${me.method} - (${me.id})'.`,et)}else ot("send-request",me)}E(it,"traceSendingRequest");function Te(me){if(!(fe===f.Off||!Re))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(me.params?et=`Params: ${De(me.params)} +`),Fe.log(`Sending request '${Ae.method} - (${Ae.id})'.`,tt)}else lt("send-request",Ae)}A(nt,"traceSendingRequest");function Ie(Ae){if(!(ae===f.Off||!Fe))if(_e===g.Text){let tt;(ae===f.Verbose||ae===f.Compact)&&(Ae.params?tt=`Params: ${Pe(Ae.params)} -`:et=`No parameters provided. +`:tt=`No parameters provided. -`),Re.log(`Sending notification '${me.method}'.`,et)}else ot("send-notification",me)}E(Te,"traceSendingNotification");function ct(me,et,lt){if(!(fe===f.Off||!Re))if(Ae===g.Text){let Rt;(fe===f.Verbose||fe===f.Compact)&&(me.error&&me.error.data?Rt=`Error data: ${De(me.error.data)} +`),Fe.log(`Sending notification '${Ae.method}'.`,tt)}else lt("send-notification",Ae)}A(Ie,"traceSendingNotification");function pt(Ae,tt,ct){if(!(ae===f.Off||!Fe))if(_e===g.Text){let Mt;(ae===f.Verbose||ae===f.Compact)&&(Ae.error&&Ae.error.data?Mt=`Error data: ${Pe(Ae.error.data)} -`:me.result?Rt=`Result: ${De(me.result)} +`:Ae.result?Mt=`Result: ${Pe(Ae.result)} -`:me.error===void 0&&(Rt=`No result returned. +`:Ae.error===void 0&&(Mt=`No result returned. -`)),Re.log(`Sending response '${et} - (${me.id})'. Processing request took ${Date.now()-lt}ms`,Rt)}else ot("send-response",me)}E(ct,"traceSendingResponse");function we(me){if(!(fe===f.Off||!Re))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&me.params&&(et=`Params: ${De(me.params)} +`)),Fe.log(`Sending response '${tt} - (${Ae.id})'. Processing request took ${Date.now()-ct}ms`,Mt)}else lt("send-response",Ae)}A(pt,"traceSendingResponse");function Re(Ae){if(!(ae===f.Off||!Fe))if(_e===g.Text){let tt;(ae===f.Verbose||ae===f.Compact)&&Ae.params&&(tt=`Params: ${Pe(Ae.params)} -`),Re.log(`Received request '${me.method} - (${me.id})'.`,et)}else ot("receive-request",me)}E(we,"traceReceivedRequest");function Et(me){if(!(fe===f.Off||!Re||me.method===y.type.method))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(me.params?et=`Params: ${De(me.params)} +`),Fe.log(`Received request '${Ae.method} - (${Ae.id})'.`,tt)}else lt("receive-request",Ae)}A(Re,"traceReceivedRequest");function kt(Ae){if(!(ae===f.Off||!Fe||Ae.method===y.type.method))if(_e===g.Text){let tt;(ae===f.Verbose||ae===f.Compact)&&(Ae.params?tt=`Params: ${Pe(Ae.params)} -`:et=`No parameters provided. +`:tt=`No parameters provided. -`),Re.log(`Received notification '${me.method}'.`,et)}else ot("receive-notification",me)}E(Et,"traceReceivedNotification");function yt(me,et){if(!(fe===f.Off||!Re))if(Ae===g.Text){let lt;if((fe===f.Verbose||fe===f.Compact)&&(me.error&&me.error.data?lt=`Error data: ${De(me.error.data)} +`),Fe.log(`Received notification '${Ae.method}'.`,tt)}else lt("receive-notification",Ae)}A(kt,"traceReceivedNotification");function bt(Ae,tt){if(!(ae===f.Off||!Fe))if(_e===g.Text){let ct;if((ae===f.Verbose||ae===f.Compact)&&(Ae.error&&Ae.error.data?ct=`Error data: ${Pe(Ae.error.data)} -`:me.result?lt=`Result: ${De(me.result)} +`:Ae.result?ct=`Result: ${Pe(Ae.result)} -`:me.error===void 0&&(lt=`No result returned. +`:Ae.error===void 0&&(ct=`No result returned. -`)),et){const Rt=me.error?` Request failed: ${me.error.message} (${me.error.code}).`:"";Re.log(`Received response '${et.method} - (${me.id})' in ${Date.now()-et.timerStart}ms.${Rt}`,lt)}else Re.log(`Received response ${me.id} without active response promise.`,lt)}else ot("receive-response",me)}E(yt,"traceReceivedResponse");function ot(me,et){if(!Re||fe===f.Off)return;const lt={isLSPMessage:!0,type:me,message:et,timestamp:Date.now()};Re.log(lt)}E(ot,"logLSPMessage");function Dt(){if(Se())throw new x(v.Closed,"Connection is closed.");if(Y())throw new x(v.Disposed,"Connection is disposed.")}E(Dt,"throwIfClosedOrDisposed");function vt(){if(Ee())throw new x(v.AlreadyListening,"Connection is already listening")}E(vt,"throwIfListening");function ut(){if(!Ee())throw new Error("Call listen() first.")}E(ut,"throwIfNotListening");function le(me){return me===void 0?null:me}E(le,"undefinedToNull");function At(me){if(me!==null)return me}E(At,"nullToUndefined");function dt(me){return me!=null&&!Array.isArray(me)&&typeof me=="object"}E(dt,"isNamedParam");function ht(me,et){switch(me){case n.ParameterStructures.auto:return dt(et)?At(et):[le(et)];case n.ParameterStructures.byName:if(!dt(et))throw new Error("Received parameters by name but param is not an object literal.");return At(et);case n.ParameterStructures.byPosition:return[le(et)];default:throw new Error(`Unknown parameter structure ${me.toString()}`)}}E(ht,"computeSingleParam");function St(me,et){let lt;const Rt=me.numberOfParams;switch(Rt){case 0:lt=void 0;break;case 1:lt=ht(me.parameterStructures,et[0]);break;default:lt=[];for(let Ft=0;Ft{Dt();let lt,Rt;if(r.string(me)){lt=me;const or=et[0];let ir=0,xr=n.ParameterStructures.auto;n.ParameterStructures.is(or)&&(ir=1,xr=or);let sr=et.length;const Rr=sr-ir;switch(Rr){case 0:Rt=void 0;break;case 1:Rt=ht(xr,et[ir]);break;default:if(xr===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);Rt=et.slice(ir,sr).map(Jt=>le(Jt));break}}else{const or=et;lt=me.method,Rt=St(me,or)}const Ft={jsonrpc:V,method:lt,params:Rt};return Te(Ft),N.write(Ft).catch(or=>{throw $.error("Sending notification failed."),or})},"sendNotification"),onNotification:E((me,et)=>{Dt();let lt;return r.func(me)?ie=me:et&&(r.string(me)?(lt=me,K.set(me,{type:void 0,handler:et})):(lt=me.method,K.set(me.method,{type:me,handler:et}))),{dispose:E(()=>{lt!==void 0?K.delete(lt):ie=void 0},"dispose")}},"onNotification"),onProgress:E((me,et,lt)=>{if(se.has(et))throw new Error(`Progress handler for token ${et} already registered`);return se.set(et,lt),{dispose:E(()=>{se.delete(et)},"dispose")}},"onProgress"),sendProgress:E((me,et,lt)=>Nr.sendNotification(u.type,{token:et,value:lt}),"sendProgress"),onUnhandledProgress:ye.event,sendRequest:E((me,...et)=>{Dt(),ut();let lt,Rt,Ft;if(r.string(me)){lt=me;const sr=et[0],Rr=et[et.length-1];let Jt=0,Ir=n.ParameterStructures.auto;n.ParameterStructures.is(sr)&&(Jt=1,Ir=sr);let ln=et.length;s.CancellationToken.is(Rr)&&(ln=ln-1,Ft=Rr);const Or=ln-Jt;switch(Or){case 0:Rt=void 0;break;case 1:Rt=ht(Ir,et[Jt]);break;default:if(Ir===n.ParameterStructures.byName)throw new Error(`Received ${Or} parameters for 'by Name' request parameter structure.`);Rt=et.slice(Jt,ln).map(Ca=>le(Ca));break}}else{const sr=et;lt=me.method,Rt=St(me,sr);const Rr=me.numberOfParams;Ft=s.CancellationToken.is(sr[Rr])?sr[Rr]:void 0}const or=P++;let ir;Ft&&(ir=Ft.onCancellationRequested(()=>{const sr=xe.sender.sendCancellation(Nr,or);return sr===void 0?($.log(`Received no promise from cancellation strategy when cancelling id ${or}`),Promise.resolve()):sr.catch(()=>{$.log(`Sending cancellation messages for id ${or} failed`)})}));const xr={jsonrpc:V,id:or,method:lt,params:Rt};return it(xr),typeof xe.sender.enableCancellation=="function"&&xe.sender.enableCancellation(xr),new Promise(async(sr,Rr)=>{const Jt=E(Or=>{sr(Or),xe.sender.cleanup(or),ir==null||ir.dispose()},"resolveWithCleanup"),Ir=E(Or=>{Rr(Or),xe.sender.cleanup(or),ir==null||ir.dispose()},"rejectWithCleanup"),ln={method:lt,timerStart:Date.now(),resolve:Jt,reject:Ir};try{await N.write(xr),ee.set(or,ln)}catch(Or){throw $.error("Sending request failed."),ln.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Or.message?Or.message:"Unknown reason")),Or}})},"sendRequest"),onRequest:E((me,et)=>{Dt();let lt=null;return d.is(me)?(lt=void 0,X=me):r.string(me)?(lt=null,et!==void 0&&(lt=me,W.set(me,{handler:et,type:void 0}))):et!==void 0&&(lt=me.method,W.set(me.method,{type:me,handler:et})),{dispose:E(()=>{lt!==null&&(lt!==void 0?W.delete(lt):X=void 0)},"dispose")}},"onRequest"),hasPendingResponse:E(()=>ee.size>0,"hasPendingResponse"),trace:E(async(me,et,lt)=>{let Rt=!1,Ft=g.Text;lt!==void 0&&(r.boolean(lt)?Rt=lt:(Rt=lt.sendNotification||!1,Ft=lt.traceFormat||g.Text)),fe=me,Ae=Ft,fe===f.Off?Re=void 0:Re=et,Rt&&!Se()&&!Y()&&await Nr.sendNotification(m.type,{value:f.toString(me)})},"trace"),onError:Ce.event,onClose:be.event,onUnhandledNotification:Fe.event,onDispose:He.event,end:E(()=>{N.end()},"end"),dispose:E(()=>{if(Y())return;Ge=D.Disposed,He.fire(void 0);const me=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const et of ee.values())et.reject(me);ee=new Map,oe=new Map,ne=new Set,Z=new i.LinkedMap,r.func(N.dispose)&&N.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:E(()=>{Dt(),vt(),Ge=D.Listening,R.listen(Ue)},"listen"),inspect:E(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Nr.onNotification(y.type,me=>{if(fe===f.Off||!Re)return;const et=fe===f.Verbose||fe===f.Compact;Re.log(me.message,et?me.verbose:void 0)}),Nr.onNotification(u.type,me=>{const et=se.get(me.token);et?et(me.value):ye.fire(me)}),Nr}E(z,"createMessageConnection"),t.createMessageConnection=z}}),P9=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Zte();Object.defineProperty(t,"Message",{enumerable:!0,get:E(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:E(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:E(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:E(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:E(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:E(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:E(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:E(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:E(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:E(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:E(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:E(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:E(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:E(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:E(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:E(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:E(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:E(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:E(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:E(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:E(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:E(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:E(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:E(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:E(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:E(function(){return e.ParameterStructures},"get")});var r=Qte();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:E(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:E(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:E(function(){return r.Touch},"get")});var n=GUe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:E(function(){return n.Disposable},"get")});var i=rg();Object.defineProperty(t,"Event",{enumerable:!0,get:E(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:E(function(){return i.Emitter},"get")});var a=P3();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:E(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:E(function(){return a.CancellationToken},"get")});var s=qUe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:E(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:E(function(){return s.SharedArrayReceiverStrategy},"get")});var o=VUe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:E(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:E(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:E(function(){return o.ReadableStreamMessageReader},"get")});var l=WUe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:E(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:E(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:E(function(){return l.WriteableStreamMessageWriter},"get")});var u=UUe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:E(function(){return u.AbstractMessageBuffer},"get")});var h=HUe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:E(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:E(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:E(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:E(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:E(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:E(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:E(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:E(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:E(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:E(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:E(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:E(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:E(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:E(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:E(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:E(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:E(function(){return h.MessageStrategy},"get")});var d=Xd();t.RAL=d.default}}),YUe=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=P9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},E(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},E(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},E(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:E(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:E((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:E((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:E(d=>new n(d),"asReadableStream"),asWritableStream:E(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:E(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:E(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:E(()=>clearInterval(g),"dispose")}}})});function o(){return s}E(o,"RIL"),(function(d){function f(){e.RAL.install(s)}E(f,"install"),d.install=f})(o||(o={})),t.default=o}}),ng=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:E(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=YUe();n.default.install();var i=P9();r(P9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},E(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},E(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}E(o,"createMessageConnection"),t.createMessageConnection=o}}),ere=Mr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=ng()}}),Jn=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=ng(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},E(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},E(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},E(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},E(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},E(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),B9=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}E(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}E(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}E(n,"number"),t.number=n;function i(h){return h instanceof Error}E(i,"error"),t.error=i;function a(h){return typeof h=="function"}E(a,"func"),t.func=a;function s(h){return Array.isArray(h)}E(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}E(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}E(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}E(u,"objectLiteral"),t.objectLiteral=u}}),XUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Jn(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),KUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Jn(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),jUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Jn(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),ZUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Jn(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),QUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Jn(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),JUe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Jn(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),eHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Jn(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),tHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Jn(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),rHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=ng(),r=Jn(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}E(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),nHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Jn(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),iHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Jn(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),aHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Jn(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),sHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Jn(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),oHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Jn(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),lHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Jn(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),cHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Jn(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),uHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Jn(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),hHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Jn(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),dHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=ng(),r=B9(),n=Jn(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}E(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),fHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(_x(),OI(R3)),r=B9(),n=Jn(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}E(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(x,b){const w={executionOrder:x};return(b===!0||b===!1)&&(w.success=b),w}E(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}E(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}E(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}E(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}E(y,"is"),g.is=y;function v(b,w){const k=new Set;return b.document!==w.document&&k.add("document"),b.kind!==w.kind&&k.add("kind"),b.executionSummary!==w.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!x(b.metadata,w.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&k.add("executionSummary"),k}E(v,"diff"),g.diff=v;function x(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const k=Array.isArray(b),S=Array.isArray(w);if(k!==S)return!1;if(k&&S){if(b.length!==w.length)return!1;for(let C=0;C0}E(At,"hasId"),le.hasId=At})(I||(t.StaticRegistrationOptions=I={}));var $;(function(le){function At(dt){const ht=dt;return ht&&(ht.documentSelector===null||z.is(ht.documentSelector))}E(At,"is"),le.is=At})($||(t.TextDocumentRegistrationOptions=$={}));var P;(function(le){function At(ht){const St=ht;return n.objectLiteral(St)&&(St.workDoneProgress===void 0||n.boolean(St.workDoneProgress))}E(At,"is"),le.is=At;function dt(ht){const St=ht;return St&&n.boolean(St.workDoneProgress)}E(dt,"hasWorkDoneProgress"),le.hasWorkDoneProgress=dt})(P||(t.WorkDoneProgressOptions=P={}));var B;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(B||(t.InitializeRequest=B={}));var q;(function(le){le.unknownProtocolVersion=1})(q||(t.InitializeErrorCodes=q={}));var V;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(V||(t.InitializedNotification=V={}));var X;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(X||(t.ShutdownRequest=X={}));var W;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(W||(t.ExitNotification=W={}));var ie;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(ie||(t.DidChangeConfigurationNotification=ie={}));var K;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(K||(t.MessageType=K={}));var se;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(se||(t.ShowMessageNotification=se={}));var te;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(te||(t.ShowMessageRequest=te={}));var Z;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ee||(t.TelemetryEventNotification=ee={}));var ne;(function(le){le.None=0,le.Full=1,le.Incremental=2})(ne||(t.TextDocumentSyncKind=ne={}));var oe;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(oe||(t.DidOpenTextDocumentNotification=oe={}));var fe;(function(le){function At(ht){let St=ht;return St!=null&&typeof St.text=="string"&&St.range!==void 0&&(St.rangeLength===void 0||typeof St.rangeLength=="number")}E(At,"isIncremental"),le.isIncremental=At;function dt(ht){let St=ht;return St!=null&&typeof St.text=="string"&&St.range===void 0&&St.rangeLength===void 0}E(dt,"isFull"),le.isFull=dt})(fe||(t.TextDocumentContentChangeEvent=fe={}));var Ae;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ae||(t.DidChangeTextDocumentNotification=Ae={}));var Re;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Re||(t.DidCloseTextDocumentNotification=Re={}));var Ge;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ge||(t.DidSaveTextDocumentNotification=Ge={}));var Ce;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(Ce||(t.TextDocumentSaveReason=Ce={}));var be;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(be||(t.WillSaveTextDocumentNotification=be={}));var Fe;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Fe||(t.WillSaveTextDocumentWaitUntilRequest=Fe={}));var ye;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(ye||(t.DidChangeWatchedFilesNotification=ye={}));var He;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(He||(t.FileChangeType=He={}));var xe;(function(le){function At(dt){const ht=dt;return n.objectLiteral(ht)&&(r.URI.is(ht.baseUri)||r.WorkspaceFolder.is(ht.baseUri))&&n.string(ht.pattern)}E(At,"is"),le.is=At})(xe||(t.RelativePattern=xe={}));var Ve;(function(le){le.Create=1,le.Change=2,le.Delete=4})(Ve||(t.WatchKind=Ve={}));var Je;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Je||(t.PublishDiagnosticsNotification=Je={}));var nt;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(nt||(t.CompletionTriggerKind=nt={}));var tt;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(tt||(t.CompletionRequest=tt={}));var Ze;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ze||(t.CompletionResolveRequest=Ze={}));var Ee;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ee||(t.HoverRequest=Ee={}));var Se;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(Se||(t.SignatureHelpTriggerKind=Se={}));var Y;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Y||(t.SignatureHelpRequest=Y={}));var ce;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ce||(t.DefinitionRequest=ce={}));var j;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(j||(t.ReferencesRequest=j={}));var pe;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(pe||(t.DocumentHighlightRequest=pe={}));var re;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(re||(t.DocumentSymbolRequest=re={}));var Pe;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Pe||(t.CodeActionRequest=Pe={}));var ve;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ve||(t.CodeActionResolveRequest=ve={}));var Ue;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var Me;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Me||(t.WorkspaceSymbolResolveRequest=Me={}));var qe;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(qe||(t.CodeLensRequest=qe={}));var Le;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Le||(t.CodeLensResolveRequest=Le={}));var Ke;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Ke||(t.CodeLensRefreshRequest=Ke={}));var De;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(De||(t.DocumentLinkRequest=De={}));var it;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(it||(t.DocumentLinkResolveRequest=it={}));var Te;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Te||(t.DocumentFormattingRequest=Te={}));var ct;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ct||(t.DocumentRangeFormattingRequest=ct={}));var we;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(we||(t.DocumentRangesFormattingRequest=we={}));var Et;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Et||(t.DocumentOnTypeFormattingRequest=Et={}));var yt;(function(le){le.Identifier=1})(yt||(t.PrepareSupportDefaultBehavior=yt={}));var ot;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ot||(t.RenameRequest=ot={}));var Dt;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dt||(t.PrepareRenameRequest=Dt={}));var vt;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(vt||(t.ExecuteCommandRequest=vt={}));var ut;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(ut||(t.ApplyWorkspaceEditRequest=ut={}))}}),mHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=ng();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}E(r,"createProtocolConnection"),t.createProtocolConnection=r}}),yHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(ng(),t),r((_x(),OI(R3)),t),r(Jn(),t),r(gHe(),t);var n=mHe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:E(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),vHe=Mr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=ere();r(ere(),t),r(yHe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}E(i,"createProtocolConnection"),t.createProtocolConnection=i}}),tre={};ph(tre,{AbstractAstReflection:()=>G9,AbstractCstNode:()=>EN,AbstractLangiumParser:()=>AN,AbstractParserErrorMessageProvider:()=>lfe,AbstractThreadedAsyncParser:()=>Wnt,AstUtils:()=>q9,BiMap:()=>FE,Cancellation:()=>Rn,CompositeCstNodeImpl:()=>AE,ContextCache:()=>GE,CstNodeBuilder:()=>ife,CstUtils:()=>F9,DEFAULT_TOKENIZE_OPTIONS:()=>XN,DONE_RESULT:()=>rs,DatatypeSymbol:()=>_E,DefaultAstNodeDescriptionProvider:()=>Ffe,DefaultAstNodeLocator:()=>Gfe,DefaultAsyncParser:()=>ope,DefaultCommentProvider:()=>spe,DefaultConfigurationProvider:()=>qfe,DefaultDocumentBuilder:()=>Vfe,DefaultDocumentValidator:()=>Bfe,DefaultHydrator:()=>cpe,DefaultIndexManager:()=>Wfe,DefaultJsonSerializer:()=>Nfe,DefaultLangiumDocumentFactory:()=>Efe,DefaultLangiumDocuments:()=>Sfe,DefaultLangiumProfiler:()=>Knt,DefaultLexer:()=>KN,DefaultLexerErrorMessageProvider:()=>Hfe,DefaultLinker:()=>Afe,DefaultNameProvider:()=>_fe,DefaultReferenceDescriptionProvider:()=>zfe,DefaultReferences:()=>Rfe,DefaultScopeComputation:()=>Lfe,DefaultScopeProvider:()=>Mfe,DefaultServiceRegistry:()=>Ofe,DefaultTokenBuilder:()=>ME,DefaultValueConverter:()=>NN,DefaultWorkspaceLock:()=>lpe,DefaultWorkspaceManager:()=>Ufe,Deferred:()=>su,Disposable:()=>zf,DisposableCache:()=>zE,DocumentCache:()=>Dfe,DocumentState:()=>zr,DocumentValidator:()=>To,EMPTY_SCOPE:()=>znt,EMPTY_STREAM:()=>ig,EmptyFileSystem:()=>va,EmptyFileSystemProvider:()=>fpe,ErrorWithLocation:()=>ck,GrammarAST:()=>ire,GrammarUtils:()=>bD,IndentationAwareLexer:()=>Hnt,IndentationAwareTokenBuilder:()=>dpe,JSDocDocumentationProvider:()=>ape,LangiumCompletionParser:()=>cfe,LangiumParser:()=>ofe,LangiumParserErrorMessageProvider:()=>_N,LeafCstNodeImpl:()=>SE,LexingMode:()=>Gf,MapScope:()=>Fnt,Module:()=>aO,MultiMap:()=>ou,MultiMapScope:()=>Ife,OperationCancelled:()=>Ql,ParserWorker:()=>Unt,ProfilingTask:()=>gpe,Reduction:()=>Ix,RefResolving:()=>Bf,RegExpUtils:()=>TD,RootCstNodeImpl:()=>SN,SimpleCache:()=>qN,StreamImpl:()=>ql,StreamScope:()=>GN,TextDocument:()=>PE,TreeStreamImpl:()=>ag,URI:()=>Js,UriTrie:()=>FN,UriUtils:()=>cs,VALIDATE_EACH_NODE:()=>Pfe,ValidationCategory:()=>qE,ValidationRegistry:()=>$fe,ValueConverter:()=>Zl,WorkspaceCache:()=>VN,assertCondition:()=>xD,assertUnreachable:()=>Th,createCompletionParser:()=>IN,createDefaultCoreModule:()=>ta,createDefaultSharedCoreModule:()=>ra,createGrammarConfig:()=>zD,createLangiumParser:()=>DN,createParser:()=>LE,delayNextTick:()=>NE,diagnosticData:()=>Ff,eagerLoad:()=>sO,getDiagnosticRange:()=>HN,indentationBuilderDefaultOptions:()=>cO,inject:()=>Xr,interruptAndCheck:()=>ea,isAstNode:()=>Ai,isAstNodeDescription:()=>z9,isAstNodeWithComment:()=>WN,isCompositeCstNode:()=>Uc,isIMultiModeLexerDefinition:()=>HE,isJSDoc:()=>ZN,isLeafCstNode:()=>jd,isLinkingError:()=>Kd,isMultiReference:()=>Gl,isNamed:()=>zN,isOperationCancelled:()=>Pf,isReference:()=>ts,isRootCstNode:()=>B3,isTokenTypeArray:()=>UE,isTokenTypeDictionary:()=>YE,loadGrammarFromJson:()=>na,parseJSDoc:()=>jN,prepareLangiumParser:()=>MN,setInterruptionPeriod:()=>ON,startCancelableOperation:()=>$E,stream:()=>gn,toDiagnosticData:()=>YN,toDiagnosticSeverity:()=>MT});var F9={};ph(F9,{DefaultNameRegexp:()=>fD,RangeComparison:()=>Wl,compareRange:()=>hD,findCommentNode:()=>pD,findDeclarationNodeAtOffset:()=>Cre,findLeafNodeAtOffset:()=>lk,findLeafNodeBeforeOffset:()=>gD,flattenCst:()=>wre,getDatatypeNode:()=>Tre,getInteriorNodes:()=>Sre,getNextNode:()=>kre,getPreviousNode:()=>yD,getStartlineNode:()=>Ere,inRange:()=>dD,isChildNode:()=>uD,isCommentNode:()=>ok,streamCst:()=>yg,toDocumentSegment:()=>vg,tokenToRange:()=>qx});function Ai(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}E(Ai,"isAstNode");function ts(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}E(ts,"isReference");function Gl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}E(Gl,"isMultiReference");function z9(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}E(z9,"isAstNodeDescription");function Kd(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}E(Kd,"isLinkingError");var G9=(Pm=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Ai(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},E(Pm,"AbstractAstReflection"),Pm);function Uc(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}E(Uc,"isCompositeCstNode");function jd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}E(jd,"isLeafCstNode");function B3(t){return Uc(t)&&typeof t.fullText=="string"}E(B3,"isRootCstNode");var ql=(Ms=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Ms(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return rs})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=rre(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Ms(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?rs:{done:!1,value:e(i)}})}filter(e){return new Ms(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return rs})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Ms(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Lx(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return rs})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ms(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Lx(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return rs})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ms(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?rs:this.nextFn(r.state)))}distinct(e){return new Ms(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return rs})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},E(Ms,"StreamImpl"),Ms);function rre(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}E(rre,"toString");function Lx(t){return!!t&&typeof t[Symbol.iterator]=="function"}E(Lx,"isIterable");var ig=new ql(()=>{},()=>rs),rs=Object.freeze({done:!0,value:void 0});function gn(...t){if(t.length===1){const e=t[0];if(e instanceof ql)return e;if(Lx(e))return new ql(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ql(()=>({index:0}),r=>r.index1?new ql(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return rs})}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),prune:E(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},E(Bm,"TreeStreamImpl"),Bm),Ix;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}E(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}E(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}E(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}E(i,"max"),t.max=i})(Ix||(Ix={}));var q9={};ph(q9,{assignMandatoryProperties:()=>V9,copyAstNode:()=>G3,findRootNode:()=>og,getContainerOfType:()=>Zd,getDocument:()=>qo,getReferenceNodes:()=>F3,hasContainerOfType:()=>nre,linkContentToContainer:()=>sg,streamAllContents:()=>Hc,streamAst:()=>Vo,streamContents:()=>Dx,streamReferences:()=>lg});function sg(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ai(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&sg(i,e))}):Ai(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&sg(n,e)))}E(sg,"linkContentToContainer");function Zd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}E(Zd,"getContainerOfType");function nre(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}E(nre,"hasContainerOfType");function qo(t){const r=og(t).$document;if(!r)throw new Error("AST node has no document.");return r}E(qo,"getDocument");function og(t){for(;t.$container;)t=t.$container;return t}E(og,"findRootNode");function F3(t){return ts(t)?t.ref?[t.ref]:[]:Gl(t)?t.items.map(e=>e.ref):[]}E(F3,"getReferenceNodes");function Dx(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new ql(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexDx(r,e))}E(Hc,"streamAllContents");function Vo(t,e){if(t){if(e!=null&&e.range&&!z3(t,e.range))return new ag(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new ag(t,r=>Dx(r,e),{includeRoot:!0})}E(Vo,"streamAst");function z3(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?dD(r,e):!1}E(z3,"isAstNodeInRange");function lg(t){return new ql(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexCs,AbstractParserRule:()=>Mx,AbstractRule:()=>cg,AbstractType:()=>Ys,Action:()=>gh,Alternatives:()=>Nx,ArrayLiteral:()=>W3,ArrayType:()=>U3,Assignment:()=>yh,BooleanLiteral:()=>H3,CharacterRange:()=>vh,Condition:()=>bh,Conjunction:()=>Ox,CrossReference:()=>xh,Disjunction:()=>$x,EndOfFile:()=>Y3,Grammar:()=>Xc,GrammarImport:()=>X3,Group:()=>ef,InferredType:()=>K3,InfixRule:()=>Vl,InfixRuleOperatorList:()=>Bx,InfixRuleOperators:()=>j3,Interface:()=>hg,Keyword:()=>dg,LangiumGrammarAstReflection:()=>cD,LangiumGrammarTerminals:()=>bHe,NamedArgument:()=>fg,NegatedToken:()=>rf,Negation:()=>Z3,NumberLiteral:()=>Q3,Parameter:()=>pg,ParameterReference:()=>J3,ParserRule:()=>Wo,ReferenceType:()=>Fx,RegexToken:()=>nf,ReturnType:()=>ek,RuleCall:()=>af,SimpleType:()=>gg,StringLiteral:()=>rk,TerminalAlternatives:()=>sf,TerminalElement:()=>ks,TerminalGroup:()=>of,TerminalRule:()=>Zc,TerminalRuleCall:()=>lf,Type:()=>zx,TypeAttribute:()=>cf,TypeDefinition:()=>uf,UnionType:()=>ak,UnorderedGroup:()=>Gx,UntilToken:()=>hf,ValueLiteral:()=>df,Wildcard:()=>mg,isAbstractElement:()=>q3,isAbstractParserRule:()=>Qd,isAbstractRule:()=>are,isAbstractType:()=>sre,isAction:()=>mh,isAlternatives:()=>V3,isArrayLiteral:()=>ore,isArrayType:()=>U9,isAssignment:()=>Yc,isBooleanLiteral:()=>H9,isCharacterRange:()=>Y9,isCondition:()=>lre,isConjunction:()=>X9,isCrossReference:()=>Jd,isDisjunction:()=>K9,isEndOfFile:()=>j9,isGrammar:()=>cre,isGrammarImport:()=>ure,isGroup:()=>tf,isInferredType:()=>Px,isInfixRule:()=>ug,isInfixRuleOperatorList:()=>hre,isInfixRuleOperators:()=>dre,isInterface:()=>Z9,isKeyword:()=>Kc,isNamedArgument:()=>fre,isNegatedToken:()=>Q9,isNegation:()=>J9,isNumberLiteral:()=>pre,isParameter:()=>gre,isParameterReference:()=>eD,isParserRule:()=>ns,isReferenceType:()=>tD,isRegexToken:()=>rD,isReturnType:()=>nD,isRuleCall:()=>jc,isSimpleType:()=>tk,isStringLiteral:()=>mre,isTerminalAlternatives:()=>iD,isTerminalElement:()=>yre,isTerminalGroup:()=>aD,isTerminalRule:()=>mo,isTerminalRuleCall:()=>nk,isType:()=>ik,isTypeAttribute:()=>vre,isTypeDefinition:()=>bre,isUnionType:()=>sD,isUnorderedGroup:()=>sk,isUntilToken:()=>oD,isValueLiteral:()=>xre,isWildcard:()=>lD,reflection:()=>vr});var bHe={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Cs={$type:"AbstractElement",cardinality:"cardinality"};function q3(t){return vr.isInstance(t,Cs.$type)}E(q3,"isAbstractElement");var Mx={$type:"AbstractParserRule"};function Qd(t){return vr.isInstance(t,Mx.$type)}E(Qd,"isAbstractParserRule");var cg={$type:"AbstractRule"};function are(t){return vr.isInstance(t,cg.$type)}E(are,"isAbstractRule");var Ys={$type:"AbstractType"};function sre(t){return vr.isInstance(t,Ys.$type)}E(sre,"isAbstractType");var gh={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function mh(t){return vr.isInstance(t,gh.$type)}E(mh,"isAction");var Nx={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function V3(t){return vr.isInstance(t,Nx.$type)}E(V3,"isAlternatives");var W3={$type:"ArrayLiteral",elements:"elements"};function ore(t){return vr.isInstance(t,W3.$type)}E(ore,"isArrayLiteral");var U3={$type:"ArrayType",elementType:"elementType"};function U9(t){return vr.isInstance(t,U3.$type)}E(U9,"isArrayType");var yh={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Yc(t){return vr.isInstance(t,yh.$type)}E(Yc,"isAssignment");var H3={$type:"BooleanLiteral",true:"true"};function H9(t){return vr.isInstance(t,H3.$type)}E(H9,"isBooleanLiteral");var vh={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Y9(t){return vr.isInstance(t,vh.$type)}E(Y9,"isCharacterRange");var bh={$type:"Condition"};function lre(t){return vr.isInstance(t,bh.$type)}E(lre,"isCondition");var Ox={$type:"Conjunction",left:"left",right:"right"};function X9(t){return vr.isInstance(t,Ox.$type)}E(X9,"isConjunction");var xh={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Jd(t){return vr.isInstance(t,xh.$type)}E(Jd,"isCrossReference");var $x={$type:"Disjunction",left:"left",right:"right"};function K9(t){return vr.isInstance(t,$x.$type)}E(K9,"isDisjunction");var Y3={$type:"EndOfFile",cardinality:"cardinality"};function j9(t){return vr.isInstance(t,Y3.$type)}E(j9,"isEndOfFile");var Xc={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function cre(t){return vr.isInstance(t,Xc.$type)}E(cre,"isGrammar");var X3={$type:"GrammarImport",path:"path"};function ure(t){return vr.isInstance(t,X3.$type)}E(ure,"isGrammarImport");var ef={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function tf(t){return vr.isInstance(t,ef.$type)}E(tf,"isGroup");var K3={$type:"InferredType",name:"name"};function Px(t){return vr.isInstance(t,K3.$type)}E(Px,"isInferredType");var Vl={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function ug(t){return vr.isInstance(t,Vl.$type)}E(ug,"isInfixRule");var Bx={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function hre(t){return vr.isInstance(t,Bx.$type)}E(hre,"isInfixRuleOperatorList");var j3={$type:"InfixRuleOperators",precedences:"precedences"};function dre(t){return vr.isInstance(t,j3.$type)}E(dre,"isInfixRuleOperators");var hg={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Z9(t){return vr.isInstance(t,hg.$type)}E(Z9,"isInterface");var dg={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Kc(t){return vr.isInstance(t,dg.$type)}E(Kc,"isKeyword");var fg={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function fre(t){return vr.isInstance(t,fg.$type)}E(fre,"isNamedArgument");var rf={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Q9(t){return vr.isInstance(t,rf.$type)}E(Q9,"isNegatedToken");var Z3={$type:"Negation",value:"value"};function J9(t){return vr.isInstance(t,Z3.$type)}E(J9,"isNegation");var Q3={$type:"NumberLiteral",value:"value"};function pre(t){return vr.isInstance(t,Q3.$type)}E(pre,"isNumberLiteral");var pg={$type:"Parameter",name:"name"};function gre(t){return vr.isInstance(t,pg.$type)}E(gre,"isParameter");var J3={$type:"ParameterReference",parameter:"parameter"};function eD(t){return vr.isInstance(t,J3.$type)}E(eD,"isParameterReference");var Wo={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ns(t){return vr.isInstance(t,Wo.$type)}E(ns,"isParserRule");var Fx={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function tD(t){return vr.isInstance(t,Fx.$type)}E(tD,"isReferenceType");var nf={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function rD(t){return vr.isInstance(t,nf.$type)}E(rD,"isRegexToken");var ek={$type:"ReturnType",name:"name"};function nD(t){return vr.isInstance(t,ek.$type)}E(nD,"isReturnType");var af={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function jc(t){return vr.isInstance(t,af.$type)}E(jc,"isRuleCall");var gg={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function tk(t){return vr.isInstance(t,gg.$type)}E(tk,"isSimpleType");var rk={$type:"StringLiteral",value:"value"};function mre(t){return vr.isInstance(t,rk.$type)}E(mre,"isStringLiteral");var sf={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function iD(t){return vr.isInstance(t,sf.$type)}E(iD,"isTerminalAlternatives");var ks={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function yre(t){return vr.isInstance(t,ks.$type)}E(yre,"isTerminalElement");var of={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function aD(t){return vr.isInstance(t,of.$type)}E(aD,"isTerminalGroup");var Zc={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function mo(t){return vr.isInstance(t,Zc.$type)}E(mo,"isTerminalRule");var lf={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function nk(t){return vr.isInstance(t,lf.$type)}E(nk,"isTerminalRuleCall");var zx={$type:"Type",name:"name",type:"type"};function ik(t){return vr.isInstance(t,zx.$type)}E(ik,"isType");var cf={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function vre(t){return vr.isInstance(t,cf.$type)}E(vre,"isTypeAttribute");var uf={$type:"TypeDefinition"};function bre(t){return vr.isInstance(t,uf.$type)}E(bre,"isTypeDefinition");var ak={$type:"UnionType",types:"types"};function sD(t){return vr.isInstance(t,ak.$type)}E(sD,"isUnionType");var Gx={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function sk(t){return vr.isInstance(t,Gx.$type)}E(sk,"isUnorderedGroup");var hf={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function oD(t){return vr.isInstance(t,hf.$type)}E(oD,"isUntilToken");var df={$type:"ValueLiteral"};function xre(t){return vr.isInstance(t,df.$type)}E(xre,"isValueLiteral");var mg={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lD(t){return vr.isInstance(t,mg.$type)}E(lD,"isWildcard");var cD=(Fm=class extends G9{constructor(){super(...arguments),this.types={AbstractElement:{name:Cs.$type,properties:{cardinality:{name:Cs.cardinality}},superTypes:[]},AbstractParserRule:{name:Mx.$type,properties:{},superTypes:[cg.$type,Ys.$type]},AbstractRule:{name:cg.$type,properties:{},superTypes:[]},AbstractType:{name:Ys.$type,properties:{},superTypes:[]},Action:{name:gh.$type,properties:{cardinality:{name:gh.cardinality},feature:{name:gh.feature},inferredType:{name:gh.inferredType},operator:{name:gh.operator},type:{name:gh.type,referenceType:Ys.$type}},superTypes:[Cs.$type]},Alternatives:{name:Nx.$type,properties:{cardinality:{name:Nx.cardinality},elements:{name:Nx.elements,defaultValue:[]}},superTypes:[Cs.$type]},ArrayLiteral:{name:W3.$type,properties:{elements:{name:W3.elements,defaultValue:[]}},superTypes:[df.$type]},ArrayType:{name:U3.$type,properties:{elementType:{name:U3.elementType}},superTypes:[uf.$type]},Assignment:{name:yh.$type,properties:{cardinality:{name:yh.cardinality},feature:{name:yh.feature},operator:{name:yh.operator},predicate:{name:yh.predicate},terminal:{name:yh.terminal}},superTypes:[Cs.$type]},BooleanLiteral:{name:H3.$type,properties:{true:{name:H3.true,defaultValue:!1}},superTypes:[bh.$type,df.$type]},CharacterRange:{name:vh.$type,properties:{cardinality:{name:vh.cardinality},left:{name:vh.left},lookahead:{name:vh.lookahead},parenthesized:{name:vh.parenthesized,defaultValue:!1},right:{name:vh.right}},superTypes:[ks.$type]},Condition:{name:bh.$type,properties:{},superTypes:[]},Conjunction:{name:Ox.$type,properties:{left:{name:Ox.left},right:{name:Ox.right}},superTypes:[bh.$type]},CrossReference:{name:xh.$type,properties:{cardinality:{name:xh.cardinality},deprecatedSyntax:{name:xh.deprecatedSyntax,defaultValue:!1},isMulti:{name:xh.isMulti,defaultValue:!1},terminal:{name:xh.terminal},type:{name:xh.type,referenceType:Ys.$type}},superTypes:[Cs.$type]},Disjunction:{name:$x.$type,properties:{left:{name:$x.left},right:{name:$x.right}},superTypes:[bh.$type]},EndOfFile:{name:Y3.$type,properties:{cardinality:{name:Y3.cardinality}},superTypes:[Cs.$type]},Grammar:{name:Xc.$type,properties:{imports:{name:Xc.imports,defaultValue:[]},interfaces:{name:Xc.interfaces,defaultValue:[]},isDeclared:{name:Xc.isDeclared,defaultValue:!1},name:{name:Xc.name},rules:{name:Xc.rules,defaultValue:[]},types:{name:Xc.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:X3.$type,properties:{path:{name:X3.path}},superTypes:[]},Group:{name:ef.$type,properties:{cardinality:{name:ef.cardinality},elements:{name:ef.elements,defaultValue:[]},guardCondition:{name:ef.guardCondition},predicate:{name:ef.predicate}},superTypes:[Cs.$type]},InferredType:{name:K3.$type,properties:{name:{name:K3.name}},superTypes:[Ys.$type]},InfixRule:{name:Vl.$type,properties:{call:{name:Vl.call},dataType:{name:Vl.dataType},inferredType:{name:Vl.inferredType},name:{name:Vl.name},operators:{name:Vl.operators},parameters:{name:Vl.parameters,defaultValue:[]},returnType:{name:Vl.returnType,referenceType:Ys.$type}},superTypes:[Mx.$type]},InfixRuleOperatorList:{name:Bx.$type,properties:{associativity:{name:Bx.associativity},operators:{name:Bx.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:j3.$type,properties:{precedences:{name:j3.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:hg.$type,properties:{attributes:{name:hg.attributes,defaultValue:[]},name:{name:hg.name},superTypes:{name:hg.superTypes,defaultValue:[],referenceType:Ys.$type}},superTypes:[Ys.$type]},Keyword:{name:dg.$type,properties:{cardinality:{name:dg.cardinality},predicate:{name:dg.predicate},value:{name:dg.value}},superTypes:[Cs.$type]},NamedArgument:{name:fg.$type,properties:{calledByName:{name:fg.calledByName,defaultValue:!1},parameter:{name:fg.parameter,referenceType:pg.$type},value:{name:fg.value}},superTypes:[]},NegatedToken:{name:rf.$type,properties:{cardinality:{name:rf.cardinality},lookahead:{name:rf.lookahead},parenthesized:{name:rf.parenthesized,defaultValue:!1},terminal:{name:rf.terminal}},superTypes:[ks.$type]},Negation:{name:Z3.$type,properties:{value:{name:Z3.value}},superTypes:[bh.$type]},NumberLiteral:{name:Q3.$type,properties:{value:{name:Q3.value}},superTypes:[df.$type]},Parameter:{name:pg.$type,properties:{name:{name:pg.name}},superTypes:[]},ParameterReference:{name:J3.$type,properties:{parameter:{name:J3.parameter,referenceType:pg.$type}},superTypes:[bh.$type]},ParserRule:{name:Wo.$type,properties:{dataType:{name:Wo.dataType},definition:{name:Wo.definition},entry:{name:Wo.entry,defaultValue:!1},fragment:{name:Wo.fragment,defaultValue:!1},inferredType:{name:Wo.inferredType},name:{name:Wo.name},parameters:{name:Wo.parameters,defaultValue:[]},returnType:{name:Wo.returnType,referenceType:Ys.$type}},superTypes:[Mx.$type]},ReferenceType:{name:Fx.$type,properties:{isMulti:{name:Fx.isMulti,defaultValue:!1},referenceType:{name:Fx.referenceType}},superTypes:[uf.$type]},RegexToken:{name:nf.$type,properties:{cardinality:{name:nf.cardinality},lookahead:{name:nf.lookahead},parenthesized:{name:nf.parenthesized,defaultValue:!1},regex:{name:nf.regex}},superTypes:[ks.$type]},ReturnType:{name:ek.$type,properties:{name:{name:ek.name}},superTypes:[]},RuleCall:{name:af.$type,properties:{arguments:{name:af.arguments,defaultValue:[]},cardinality:{name:af.cardinality},predicate:{name:af.predicate},rule:{name:af.rule,referenceType:cg.$type}},superTypes:[Cs.$type]},SimpleType:{name:gg.$type,properties:{primitiveType:{name:gg.primitiveType},stringType:{name:gg.stringType},typeRef:{name:gg.typeRef,referenceType:Ys.$type}},superTypes:[uf.$type]},StringLiteral:{name:rk.$type,properties:{value:{name:rk.value}},superTypes:[df.$type]},TerminalAlternatives:{name:sf.$type,properties:{cardinality:{name:sf.cardinality},elements:{name:sf.elements,defaultValue:[]},lookahead:{name:sf.lookahead},parenthesized:{name:sf.parenthesized,defaultValue:!1}},superTypes:[ks.$type]},TerminalElement:{name:ks.$type,properties:{cardinality:{name:ks.cardinality},lookahead:{name:ks.lookahead},parenthesized:{name:ks.parenthesized,defaultValue:!1}},superTypes:[Cs.$type]},TerminalGroup:{name:of.$type,properties:{cardinality:{name:of.cardinality},elements:{name:of.elements,defaultValue:[]},lookahead:{name:of.lookahead},parenthesized:{name:of.parenthesized,defaultValue:!1}},superTypes:[ks.$type]},TerminalRule:{name:Zc.$type,properties:{definition:{name:Zc.definition},fragment:{name:Zc.fragment,defaultValue:!1},hidden:{name:Zc.hidden,defaultValue:!1},name:{name:Zc.name},type:{name:Zc.type}},superTypes:[cg.$type]},TerminalRuleCall:{name:lf.$type,properties:{cardinality:{name:lf.cardinality},lookahead:{name:lf.lookahead},parenthesized:{name:lf.parenthesized,defaultValue:!1},rule:{name:lf.rule,referenceType:Zc.$type}},superTypes:[ks.$type]},Type:{name:zx.$type,properties:{name:{name:zx.name},type:{name:zx.type}},superTypes:[Ys.$type]},TypeAttribute:{name:cf.$type,properties:{defaultValue:{name:cf.defaultValue},isOptional:{name:cf.isOptional,defaultValue:!1},name:{name:cf.name},type:{name:cf.type}},superTypes:[]},TypeDefinition:{name:uf.$type,properties:{},superTypes:[]},UnionType:{name:ak.$type,properties:{types:{name:ak.types,defaultValue:[]}},superTypes:[uf.$type]},UnorderedGroup:{name:Gx.$type,properties:{cardinality:{name:Gx.cardinality},elements:{name:Gx.elements,defaultValue:[]}},superTypes:[Cs.$type]},UntilToken:{name:hf.$type,properties:{cardinality:{name:hf.cardinality},lookahead:{name:hf.lookahead},parenthesized:{name:hf.parenthesized,defaultValue:!1},terminal:{name:hf.terminal}},superTypes:[ks.$type]},ValueLiteral:{name:df.$type,properties:{},superTypes:[]},Wildcard:{name:mg.$type,properties:{cardinality:{name:mg.cardinality},lookahead:{name:mg.lookahead},parenthesized:{name:mg.parenthesized,defaultValue:!1}},superTypes:[ks.$type]}}}},E(Fm,"LangiumGrammarAstReflection"),Fm),vr=new cD;function Tre(t){let e=t,r=!1;for(;e;){const n=Zd(e.grammarSource,ns);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}E(Tre,"getDatatypeNode");function yg(t){return new ag(t,e=>Uc(e)?e.content:[],{includeRoot:!0})}E(yg,"streamCst");function wre(t){return yg(t).filter(jd)}E(wre,"flattenCst");function uD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}E(uD,"isChildNode");function qx(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}E(qx,"tokenToRange");function vg(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}E(vg,"toDocumentSegment");var Wl;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Wl||(Wl={}));function hD(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Wl.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineWl.After}E(dD,"inRange");var fD=/^[\w\p{L}]$/u;function Cre(t,e,r=fD){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return lk(t,e)}}E(Cre,"findDeclarationNodeAtOffset");function pD(t,e){if(t){const r=yD(t,!0);if(r&&ok(r,e))return r;if(B3(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(ok(a,e))return a}}}}E(pD,"findCommentNode");function ok(t,e){return jd(t)&&e.includes(t.tokenType.name)}E(ok,"isCommentNode");function lk(t,e){if(jd(t))return t;if(Uc(t)){const r=mD(t,e,!1);if(r)return lk(r,e)}}E(lk,"findLeafNodeAtOffset");function gD(t,e){if(jd(t))return t;if(Uc(t)){const r=mD(t,e,!0);if(r)return gD(r,e)}}E(gD,"findLeafNodeBeforeOffset");function mD(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}E(mD,"binarySearch");function yD(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}E(yD,"getPreviousNode");function kre(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nMD,findNameAssignment:()=>xk,findNodeForKeyword:()=>DD,findNodeForProperty:()=>yk,findNodesForKeyword:()=>$re,findNodesForKeywordInternal:()=>bk,findNodesForProperty:()=>ID,getActionAtElement:()=>OD,getActionType:()=>PD,getAllReachableRules:()=>mk,getAllRulesUsedForCrossReferences:()=>Ore,getCrossReferenceTerminal:()=>RD,getEntryRule:()=>SD,getExplicitRuleType:()=>Wx,getHiddenRules:()=>AD,getRuleType:()=>BD,getRuleTypeName:()=>Gre,getTypeName:()=>gf,isArrayCardinality:()=>Bre,isArrayOperator:()=>Fre,isCommentTerminal:()=>LD,isDataType:()=>zre,isDataTypeRule:()=>Vx,isOptionalCardinality:()=>Pre,terminalRegex:()=>Ux});var ck=(zm=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},E(zm,"ErrorWithLocation"),zm);function Th(t,e="Error: Got unexpected value."){throw new Error(e)}E(Th,"assertUnreachable");function xD(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}E(xD,"assertCondition");var TD={};ph(TD,{NEWLINE_REGEXP:()=>Ire,escapeRegExp:()=>xg,getTerminalParts:()=>Mre,isMultilineComment:()=>CD,isWhitespace:()=>gk,partialMatches:()=>kD,partialRegExp:()=>ED,whitespaceCharacters:()=>Nre});function kr(t){return t.charCodeAt(0)}E(kr,"cc");function uk(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}E(uk,"insertToSet");function bg(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}E(bg,"addFlag");function ff(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}E(ff,"ASSERT_EXISTS");function _re(){throw Error("Internal Error - Should never get here!")}E(_re,"ASSERT_NEVER_REACH_HERE");function wD(t){return t.type==="Character"}E(wD,"isCharacter");var hk=[];for(let t=kr("0");t<=kr("9");t++)hk.push(t);var dk=[kr("_")].concat(hk);for(let t=kr("a");t<=kr("z");t++)dk.push(t);for(let t=kr("A");t<=kr("Z");t++)dk.push(t);var Rre=[kr(" "),kr("\f"),kr(` -`),kr("\r"),kr(" "),kr("\v"),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr(" "),kr("\u2028"),kr("\u2029"),kr(" "),kr(" "),kr(" "),kr("\uFEFF")],xHe=/[0-9a-fA-F]/,fk=/[0-9]/,THe=/[1-9]/,Lre=(Gm=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":bg(n,"global");break;case"i":bg(n,"ignoreCase");break;case"m":bg(n,"multiLine");break;case"u":bg(n,"unicode");break;case"y":bg(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}ff(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return _re()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;ff(r);break}if(!(e===!0&&r===void 0)&&ff(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ff(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[kr(` -`),kr("\r"),kr("\u2028"),kr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=hk;break;case"D":e=hk,r=!0;break;case"s":e=Rre;break;case"S":e=Rre,r=!0;break;case"w":e=dk;break;case"W":e=dk,r=!0;break}if(ff(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=kr("\f");break;case"n":e=kr(` -`);break;case"r":e=kr("\r");break;case"t":e=kr(" ");break;case"v":e=kr("\v");break}if(ff(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:kr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:kr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:kr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,wD(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,wD(i)){if(i.value{Nt();let ct,Mt;if(r.string(Ae)){ct=Ae;const gr=tt[0];let lr=0,Tr=n.ParameterStructures.auto;n.ParameterStructures.is(gr)&&(lr=1,Tr=gr);let fr=tt.length;const Or=fr-lr;switch(Or){case 0:Mt=void 0;break;case 1:Mt=ft(Tr,tt[lr]);break;default:if(Tr===n.ParameterStructures.byName)throw new Error(`Received ${Or} parameters for 'by Name' notification parameter structure.`);Mt=tt.slice(lr,fr).map(ir=>ve(ir));break}}else{const gr=tt;ct=Ae.method,Mt=Et(Ae,gr)}const Wt={jsonrpc:W,method:ct,params:Mt};return Ie(Wt),O.write(Wt).catch(gr=>{throw B.error("Sending notification failed."),gr})},"sendNotification"),onNotification:A((Ae,tt)=>{Nt();let ct;return r.func(Ae)?te=Ae:tt&&(r.string(Ae)?(ct=Ae,Y.set(Ae,{type:void 0,handler:tt})):(ct=Ae.method,Y.set(Ae.method,{type:Ae,handler:tt}))),{dispose:A(()=>{ct!==void 0?Y.delete(ct):te=void 0},"dispose")}},"onNotification"),onProgress:A((Ae,tt,ct)=>{if(se.has(tt))throw new Error(`Progress handler for token ${tt} already registered`);return se.set(tt,ct),{dispose:A(()=>{se.delete(tt)},"dispose")}},"onProgress"),sendProgress:A((Ae,tt,ct)=>Nr.sendNotification(u.type,{token:tt,value:ct}),"sendProgress"),onUnhandledProgress:me.event,sendRequest:A((Ae,...tt)=>{Nt(),dt();let ct,Mt,Wt;if(r.string(Ae)){ct=Ae;const fr=tt[0],Or=tt[tt.length-1];let ir=0,cr=n.ParameterStructures.auto;n.ParameterStructures.is(fr)&&(ir=1,cr=fr);let Vr=tt.length;s.CancellationToken.is(Or)&&(Vr=Vr-1,Wt=Or);const at=Vr-ir;switch(at){case 0:Mt=void 0;break;case 1:Mt=ft(cr,tt[ir]);break;default:if(cr===n.ParameterStructures.byName)throw new Error(`Received ${at} parameters for 'by Name' request parameter structure.`);Mt=tt.slice(ir,Vr).map(vt=>ve(vt));break}}else{const fr=tt;ct=Ae.method,Mt=Et(Ae,fr);const Or=Ae.numberOfParams;Wt=s.CancellationToken.is(fr[Or])?fr[Or]:void 0}const gr=F++;let lr;Wt&&(lr=Wt.onCancellationRequested(()=>{const fr=we.sender.sendCancellation(Nr,gr);return fr===void 0?(B.log(`Received no promise from cancellation strategy when cancelling id ${gr}`),Promise.resolve()):fr.catch(()=>{B.log(`Sending cancellation messages for id ${gr} failed`)})}));const Tr={jsonrpc:W,id:gr,method:ct,params:Mt};return nt(Tr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(Tr),new Promise(async(fr,Or)=>{const ir=A(at=>{fr(at),we.sender.cleanup(gr),lr==null||lr.dispose()},"resolveWithCleanup"),cr=A(at=>{Or(at),we.sender.cleanup(gr),lr==null||lr.dispose()},"rejectWithCleanup"),Vr={method:ct,timerStart:Date.now(),resolve:ir,reject:cr};try{await O.write(Tr),ee.set(gr,Vr)}catch(at){throw B.error("Sending request failed."),Vr.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,at.message?at.message:"Unknown reason")),at}})},"sendRequest"),onRequest:A((Ae,tt)=>{Nt();let ct=null;return d.is(Ae)?(ct=void 0,V=Ae):r.string(Ae)?(ct=null,tt!==void 0&&(ct=Ae,H.set(Ae,{handler:tt,type:void 0}))):tt!==void 0&&(ct=Ae.method,H.set(Ae.method,{type:Ae,handler:tt})),{dispose:A(()=>{ct!==null&&(ct!==void 0?H.delete(ct):V=void 0)},"dispose")}},"onRequest"),hasPendingResponse:A(()=>ee.size>0,"hasPendingResponse"),trace:A(async(Ae,tt,ct)=>{let Mt=!1,Wt=g.Text;ct!==void 0&&(r.boolean(ct)?Mt=ct:(Mt=ct.sendNotification||!1,Wt=ct.traceFormat||g.Text)),ae=Ae,_e=Wt,ae===f.Off?Fe=void 0:Fe=tt,Mt&&!pe()&&!U()&&await Nr.sendNotification(m.type,{value:f.toString(Ae)})},"trace"),onError:ue.event,onClose:de.event,onUnhandledNotification:Ce.event,onDispose:$e.event,end:A(()=>{O.end()},"end"),dispose:A(()=>{if(U())return;qe=I.Disposed,$e.fire(void 0);const Ae=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const tt of ee.values())tt.reject(Ae);ee=new Map,ge=new Map,re=new Set,Z=new i.LinkedMap,r.func(O.dispose)&&O.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:A(()=>{Nt(),Ct(),qe=I.Listening,R.listen(He)},"listen"),inspect:A(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Nr.onNotification(y.type,Ae=>{if(ae===f.Off||!Fe)return;const tt=ae===f.Verbose||ae===f.Compact;Fe.log(Ae.message,tt?Ae.verbose:void 0)}),Nr.onNotification(u.type,Ae=>{const tt=se.get(Ae.token);tt?tt(Ae.value):me.fire(Ae)}),Nr}A(P,"createMessageConnection"),t.createMessageConnection=P}}),m9=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Gse();Object.defineProperty(t,"Message",{enumerable:!0,get:A(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:A(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:A(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:A(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:A(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:A(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:A(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:A(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:A(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:A(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:A(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:A(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:A(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:A(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:A(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:A(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:A(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:A(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:A(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:A(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:A(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:A(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:A(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:A(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:A(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:A(function(){return e.ParameterStructures},"get")});var r=Wse();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:A(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:A(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:A(function(){return r.Touch},"get")});var n=qZe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:A(function(){return n.Disposable},"get")});var i=Yg();Object.defineProperty(t,"Event",{enumerable:!0,get:A(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:A(function(){return i.Emitter},"get")});var a=i5();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:A(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:A(function(){return a.CancellationToken},"get")});var s=VZe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:A(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:A(function(){return s.SharedArrayReceiverStrategy},"get")});var o=UZe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:A(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:A(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:A(function(){return o.ReadableStreamMessageReader},"get")});var l=HZe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:A(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:A(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:A(function(){return l.WriteableStreamMessageWriter},"get")});var u=YZe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:A(function(){return u.AbstractMessageBuffer},"get")});var h=XZe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:A(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:A(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:A(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:A(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:A(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:A(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:A(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:A(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:A(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:A(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:A(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:A(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:A(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:A(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:A(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:A(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:A(function(){return h.MessageStrategy},"get")});var d=Pf();t.RAL=d.default}}),jZe=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=m9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},A(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},A(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},A(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:A(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:A((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:A((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:A(d=>new n(d),"asReadableStream"),asWritableStream:A(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:A(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:A(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:A(()=>clearInterval(g),"dispose")}}})});function o(){return s}A(o,"RIL"),(function(d){function f(){e.RAL.install(s)}A(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Xg=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:A(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=jZe();n.default.install();var i=m9();r(m9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},A(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},A(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}A(o,"createMessageConnection"),t.createMessageConnection=o}}),Vse=qr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Xg()}}),yi=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Xg(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},A(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},A(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},A(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},A(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},A(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),y9=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}A(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}A(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}A(n,"number"),t.number=n;function i(h){return h instanceof Error}A(i,"error"),t.error=i;function a(h){return typeof h=="function"}A(a,"func"),t.func=a;function s(h){return Array.isArray(h)}A(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}A(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}A(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}A(u,"objectLiteral"),t.objectLiteral=u}}),KZe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=yi(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),ZZe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=yi(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),QZe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=yi(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),JZe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=yi(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),eQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=yi(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),tQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=yi(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),rQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=yi(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),nQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=yi(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),iQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Xg(),r=yi(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}A(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),aQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=yi(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),sQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=yi(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),oQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=yi(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),lQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=yi(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),cQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=yi(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),uQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=yi(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),hQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=yi(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),dQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=yi(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),fQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=yi(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),pQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Xg(),r=y9(),n=yi(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}A(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),gQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(kT(),pN(KE)),r=y9(),n=yi(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}A(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,x){const w={executionOrder:T};return(x===!0||x===!1)&&(w.success=x),w}A(m,"create"),g.create=m;function y(T){const x=T;return r.objectLiteral(x)&&e.uinteger.is(x.executionOrder)&&(x.success===void 0||r.boolean(x.success))}A(y,"is"),g.is=y;function v(T,x){return T===x?!0:T==null||x===null||x===void 0?!1:T.executionOrder===x.executionOrder&&T.success===x.success}A(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(x,w){return{kind:x,document:w}}A(m,"create"),g.create=m;function y(x){const w=x;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}A(y,"is"),g.is=y;function v(x,w){const C=new Set;return x.document!==w.document&&C.add("document"),x.kind!==w.kind&&C.add("kind"),x.executionSummary!==w.executionSummary&&C.add("executionSummary"),(x.metadata!==void 0||w.metadata!==void 0)&&!T(x.metadata,w.metadata)&&C.add("metadata"),(x.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(x.executionSummary,w.executionSummary)&&C.add("executionSummary"),C}A(v,"diff"),g.diff=v;function T(x,w){if(x===w)return!0;if(x==null||w===null||w===void 0||typeof x!=typeof w||typeof x!="object")return!1;const C=Array.isArray(x),k=Array.isArray(w);if(C!==k)return!1;if(C&&k){if(x.length!==w.length)return!1;for(let S=0;S0}A(_t,"hasId"),ve.hasId=_t})(N||(t.StaticRegistrationOptions=N={}));var B;(function(ve){function _t(gt){const ft=gt;return ft&&(ft.documentSelector===null||P.is(ft.documentSelector))}A(_t,"is"),ve.is=_t})(B||(t.TextDocumentRegistrationOptions=B={}));var F;(function(ve){function _t(ft){const Et=ft;return n.objectLiteral(Et)&&(Et.workDoneProgress===void 0||n.boolean(Et.workDoneProgress))}A(_t,"is"),ve.is=_t;function gt(ft){const Et=ft;return Et&&n.boolean(Et.workDoneProgress)}A(gt,"hasWorkDoneProgress"),ve.hasWorkDoneProgress=gt})(F||(t.WorkDoneProgressOptions=F={}));var G;(function(ve){ve.method="initialize",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(G||(t.InitializeRequest=G={}));var z;(function(ve){ve.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var W;(function(ve){ve.method="initialized",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(W||(t.InitializedNotification=W={}));var V;(function(ve){ve.method="shutdown",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType0(ve.method)})(V||(t.ShutdownRequest=V={}));var H;(function(ve){ve.method="exit",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType0(ve.method)})(H||(t.ExitNotification=H={}));var te;(function(ve){ve.method="workspace/didChangeConfiguration",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(te||(t.DidChangeConfigurationNotification=te={}));var Y;(function(ve){ve.Error=1,ve.Warning=2,ve.Info=3,ve.Log=4,ve.Debug=5})(Y||(t.MessageType=Y={}));var se;(function(ve){ve.method="window/showMessage",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(se||(t.ShowMessageNotification=se={}));var J;(function(ve){ve.method="window/showMessageRequest",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType(ve.method)})(J||(t.ShowMessageRequest=J={}));var Z;(function(ve){ve.method="window/logMessage",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(ve){ve.method="telemetry/event",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(ee||(t.TelemetryEventNotification=ee={}));var re;(function(ve){ve.None=0,ve.Full=1,ve.Incremental=2})(re||(t.TextDocumentSyncKind=re={}));var ge;(function(ve){ve.method="textDocument/didOpen",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(ge||(t.DidOpenTextDocumentNotification=ge={}));var ae;(function(ve){function _t(ft){let Et=ft;return Et!=null&&typeof Et.text=="string"&&Et.range!==void 0&&(Et.rangeLength===void 0||typeof Et.rangeLength=="number")}A(_t,"isIncremental"),ve.isIncremental=_t;function gt(ft){let Et=ft;return Et!=null&&typeof Et.text=="string"&&Et.range===void 0&&Et.rangeLength===void 0}A(gt,"isFull"),ve.isFull=gt})(ae||(t.TextDocumentContentChangeEvent=ae={}));var _e;(function(ve){ve.method="textDocument/didChange",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var Fe;(function(ve){ve.method="textDocument/didClose",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(Fe||(t.DidCloseTextDocumentNotification=Fe={}));var qe;(function(ve){ve.method="textDocument/didSave",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(qe||(t.DidSaveTextDocumentNotification=qe={}));var ue;(function(ve){ve.Manual=1,ve.AfterDelay=2,ve.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var de;(function(ve){ve.method="textDocument/willSave",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(de||(t.WillSaveTextDocumentNotification=de={}));var Ce;(function(ve){ve.method="textDocument/willSaveWaitUntil",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ce||(t.WillSaveTextDocumentWaitUntilRequest=Ce={}));var me;(function(ve){ve.method="workspace/didChangeWatchedFiles",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(me||(t.DidChangeWatchedFilesNotification=me={}));var $e;(function(ve){ve.Created=1,ve.Changed=2,ve.Deleted=3})($e||(t.FileChangeType=$e={}));var we;(function(ve){function _t(gt){const ft=gt;return n.objectLiteral(ft)&&(r.URI.is(ft.baseUri)||r.WorkspaceFolder.is(ft.baseUri))&&n.string(ft.pattern)}A(_t,"is"),ve.is=_t})(we||(t.RelativePattern=we={}));var Le;(function(ve){ve.Create=1,ve.Change=2,ve.Delete=4})(Le||(t.WatchKind=Le={}));var Ye;(function(ve){ve.method="textDocument/publishDiagnostics",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(Ye||(t.PublishDiagnosticsNotification=Ye={}));var ce;(function(ve){ve.Invoked=1,ve.TriggerCharacter=2,ve.TriggerForIncompleteCompletions=3})(ce||(t.CompletionTriggerKind=ce={}));var ye;(function(ve){ve.method="textDocument/completion",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(ye||(t.CompletionRequest=ye={}));var ke;(function(ve){ve.method="completionItem/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(ke||(t.CompletionResolveRequest=ke={}));var le;(function(ve){ve.method="textDocument/hover",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(le||(t.HoverRequest=le={}));var pe;(function(ve){ve.Invoked=1,ve.TriggerCharacter=2,ve.ContentChange=3})(pe||(t.SignatureHelpTriggerKind=pe={}));var U;(function(ve){ve.method="textDocument/signatureHelp",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(U||(t.SignatureHelpRequest=U={}));var oe;(function(ve){ve.method="textDocument/definition",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(oe||(t.DefinitionRequest=oe={}));var Q;(function(ve){ve.method="textDocument/references",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Q||(t.ReferencesRequest=Q={}));var fe;(function(ve){ve.method="textDocument/documentHighlight",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(fe||(t.DocumentHighlightRequest=fe={}));var j;(function(ve){ve.method="textDocument/documentSymbol",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(j||(t.DocumentSymbolRequest=j={}));var Be;(function(ve){ve.method="textDocument/codeAction",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Be||(t.CodeActionRequest=Be={}));var Se;(function(ve){ve.method="codeAction/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Se||(t.CodeActionResolveRequest=Se={}));var He;(function(ve){ve.method="workspace/symbol",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(He||(t.WorkspaceSymbolRequest=He={}));var De;(function(ve){ve.method="workspaceSymbol/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(De||(t.WorkspaceSymbolResolveRequest=De={}));var We;(function(ve){ve.method="textDocument/codeLens",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(We||(t.CodeLensRequest=We={}));var Ne;(function(ve){ve.method="codeLens/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ne||(t.CodeLensResolveRequest=Ne={}));var Ze;(function(ve){ve.method="workspace/codeLens/refresh",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType0(ve.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var Pe;(function(ve){ve.method="textDocument/documentLink",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Pe||(t.DocumentLinkRequest=Pe={}));var nt;(function(ve){ve.method="documentLink/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(nt||(t.DocumentLinkResolveRequest=nt={}));var Ie;(function(ve){ve.method="textDocument/formatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ie||(t.DocumentFormattingRequest=Ie={}));var pt;(function(ve){ve.method="textDocument/rangeFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(pt||(t.DocumentRangeFormattingRequest=pt={}));var Re;(function(ve){ve.method="textDocument/rangesFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Re||(t.DocumentRangesFormattingRequest=Re={}));var kt;(function(ve){ve.method="textDocument/onTypeFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(kt||(t.DocumentOnTypeFormattingRequest=kt={}));var bt;(function(ve){ve.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var lt;(function(ve){ve.method="textDocument/rename",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(lt||(t.RenameRequest=lt={}));var Nt;(function(ve){ve.method="textDocument/prepareRename",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Nt||(t.PrepareRenameRequest=Nt={}));var Ct;(function(ve){ve.method="workspace/executeCommand",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ct||(t.ExecuteCommandRequest=Ct={}));var dt;(function(ve){ve.method="workspace/applyEdit",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType("workspace/applyEdit")})(dt||(t.ApplyWorkspaceEditRequest=dt={}))}}),vQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Xg();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}A(r,"createProtocolConnection"),t.createProtocolConnection=r}}),bQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Xg(),t),r((kT(),pN(KE)),t),r(yi(),t),r(yQe(),t);var n=vQe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:A(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),xQe=qr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Vse();r(Vse(),t),r(bQe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}A(i,"createProtocolConnection"),t.createProtocolConnection=i}}),Use={};Kh(Use,{AbstractAstReflection:()=>x9,AbstractCstNode:()=>iP,AbstractLangiumParser:()=>sP,AbstractParserErrorMessageProvider:()=>Qme,AbstractThreadedAsyncParser:()=>Hct,AstUtils:()=>T9,BiMap:()=>sA,Cancellation:()=>Kn,CompositeCstNodeImpl:()=>X3,ContextCache:()=>lA,CstNodeBuilder:()=>Xme,CstUtils:()=>v9,DEFAULT_TOKENIZE_OPTIONS:()=>AP,DONE_RESULT:()=>ks,DatatypeSymbol:()=>j3,DefaultAstNodeDescriptionProvider:()=>R1e,DefaultAstNodeLocator:()=>I1e,DefaultAsyncParser:()=>Z1e,DefaultCommentProvider:()=>K1e,DefaultConfigurationProvider:()=>M1e,DefaultDocumentBuilder:()=>D1e,DefaultDocumentValidator:()=>_1e,DefaultHydrator:()=>J1e,DefaultIndexManager:()=>N1e,DefaultJsonSerializer:()=>S1e,DefaultLangiumDocumentFactory:()=>g1e,DefaultLangiumDocuments:()=>m1e,DefaultLangiumProfiler:()=>Zct,DefaultLexer:()=>_P,DefaultLexerErrorMessageProvider:()=>$1e,DefaultLinker:()=>y1e,DefaultNameProvider:()=>v1e,DefaultReferenceDescriptionProvider:()=>L1e,DefaultReferences:()=>b1e,DefaultScopeComputation:()=>x1e,DefaultScopeProvider:()=>C1e,DefaultServiceRegistry:()=>k1e,DefaultTokenBuilder:()=>eA,DefaultValueConverter:()=>fP,DefaultWorkspaceLock:()=>Q1e,DefaultWorkspaceManager:()=>O1e,Deferred:()=>zu,Disposable:()=>_p,DisposableCache:()=>oA,DocumentCache:()=>w1e,DocumentState:()=>Jr,DocumentValidator:()=>Yo,EMPTY_SCOPE:()=>Wct,EMPTY_STREAM:()=>jg,EmptyFileSystem:()=>za,EmptyFileSystemProvider:()=>nye,ErrorWithLocation:()=>L5,GrammarAST:()=>Xse,GrammarUtils:()=>Q9,IndentationAwareLexer:()=>Xct,IndentationAwareTokenBuilder:()=>rye,JSDocDocumentationProvider:()=>j1e,LangiumCompletionParser:()=>Jme,LangiumParser:()=>Zme,LangiumParserErrorMessageProvider:()=>oP,LeafCstNodeImpl:()=>Y3,LexingMode:()=>Rp,MapScope:()=>Gct,Module:()=>BP,MultiMap:()=>Gu,MultiMapScope:()=>T1e,OperationCancelled:()=>Ac,ParserWorker:()=>Yct,ProfilingTask:()=>aye,Reduction:()=>_T,RefResolving:()=>Ep,RegExpUtils:()=>eO,RootCstNodeImpl:()=>aP,SimpleCache:()=>TP,StreamImpl:()=>yc,StreamScope:()=>xP,TextDocument:()=>iA,TreeStreamImpl:()=>Kg,URI:()=>ko,UriTrie:()=>vP,UriUtils:()=>Ms,VALIDATE_EACH_NODE:()=>A1e,ValidationCategory:()=>cA,ValidationRegistry:()=>E1e,ValueConverter:()=>Ec,WorkspaceCache:()=>wP,assertCondition:()=>J9,assertUnreachable:()=>nd,createCompletionParser:()=>uP,createDefaultCoreModule:()=>wa,createDefaultSharedCoreModule:()=>Ca,createGrammarConfig:()=>bO,createLangiumParser:()=>hP,createParser:()=>Z3,delayNextTick:()=>tA,diagnosticData:()=>Ap,eagerLoad:()=>FP,getDiagnosticRange:()=>kP,indentationBuilderDefaultOptions:()=>WP,inject:()=>dn,interruptAndCheck:()=>Ta,isAstNode:()=>Xi,isAstNodeDescription:()=>b9,isAstNodeWithComment:()=>CP,isCompositeCstNode:()=>ku,isIMultiModeLexerDefinition:()=>fA,isJSDoc:()=>LP,isLeafCstNode:()=>Ff,isLinkingError:()=>Bf,isMultiReference:()=>mc,isNamed:()=>bP,isOperationCancelled:()=>kp,isReference:()=>Ss,isRootCstNode:()=>a5,isTokenTypeArray:()=>dA,isTokenTypeDictionary:()=>pA,loadGrammarFromJson:()=>Sa,parseJSDoc:()=>RP,prepareLangiumParser:()=>dP,setInterruptionPeriod:()=>pP,startCancelableOperation:()=>nA,stream:()=>Mn,toDiagnosticData:()=>EP,toDiagnosticSeverity:()=>Lw});var v9={};Kh(v9,{DefaultNameRegexp:()=>H9,RangeComparison:()=>bc,compareRange:()=>V9,findCommentNode:()=>Y9,findDeclarationNodeAtOffset:()=>foe,findLeafNodeAtOffset:()=>R5,findLeafNodeBeforeOffset:()=>X9,flattenCst:()=>doe,getDatatypeNode:()=>hoe,getInteriorNodes:()=>moe,getNextNode:()=>poe,getPreviousNode:()=>K9,getStartlineNode:()=>goe,inRange:()=>U9,isChildNode:()=>q9,isCommentNode:()=>_5,streamCst:()=>lm,toDocumentSegment:()=>cm,tokenToRange:()=>FT});function Xi(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}A(Xi,"isAstNode");function Ss(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}A(Ss,"isReference");function mc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}A(mc,"isMultiReference");function b9(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}A(b9,"isAstNodeDescription");function Bf(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}A(Bf,"isLinkingError");var x9=(M1=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Xi(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},A(M1,"AbstractAstReflection"),M1);function ku(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}A(ku,"isCompositeCstNode");function Ff(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}A(Ff,"isLeafCstNode");function a5(t){return ku(t)&&typeof t.fullText=="string"}A(a5,"isRootCstNode");var yc=(no=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new no(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ks})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Hse(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new no(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ks:{done:!1,value:e(i)}})}filter(e){return new no(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ks})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new no(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(AT(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ks})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new no(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(AT(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ks})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new no(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ks:this.nextFn(r.state)))}distinct(e){return new no(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ks})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},A(no,"StreamImpl"),no);function Hse(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}A(Hse,"toString");function AT(t){return!!t&&typeof t[Symbol.iterator]=="function"}A(AT,"isIterable");var jg=new yc(()=>{},()=>ks),ks=Object.freeze({done:!0,value:void 0});function Mn(...t){if(t.length===1){const e=t[0];if(e instanceof yc)return e;if(AT(e))return new yc(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new yc(()=>({index:0}),r=>r.index1?new yc(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return ks})}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),prune:A(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},A(D1,"TreeStreamImpl"),D1),_T;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}A(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}A(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}A(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}A(i,"max"),t.max=i})(_T||(_T={}));var T9={};Kh(T9,{assignMandatoryProperties:()=>w9,copyAstNode:()=>l5,findRootNode:()=>Qg,getContainerOfType:()=>zf,getDocument:()=>vl,getReferenceNodes:()=>s5,hasContainerOfType:()=>Yse,linkContentToContainer:()=>Zg,streamAllContents:()=>Eu,streamAst:()=>bl,streamContents:()=>RT,streamReferences:()=>Jg});function Zg(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xi(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Zg(i,e))}):Xi(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Zg(n,e)))}A(Zg,"linkContentToContainer");function zf(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}A(zf,"getContainerOfType");function Yse(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}A(Yse,"hasContainerOfType");function vl(t){const r=Qg(t).$document;if(!r)throw new Error("AST node has no document.");return r}A(vl,"getDocument");function Qg(t){for(;t.$container;)t=t.$container;return t}A(Qg,"findRootNode");function s5(t){return Ss(t)?t.ref?[t.ref]:[]:mc(t)?t.items.map(e=>e.ref):[]}A(s5,"getReferenceNodes");function RT(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new yc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexRT(r,e))}A(Eu,"streamAllContents");function bl(t,e){if(t){if(e!=null&&e.range&&!o5(t,e.range))return new Kg(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Kg(t,r=>RT(r,e),{includeRoot:!0})}A(bl,"streamAst");function o5(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?U9(r,e):!1}A(o5,"isAstNodeInRange");function Jg(t){return new yc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexYs,AbstractParserRule:()=>LT,AbstractRule:()=>em,AbstractType:()=>bo,Action:()=>Zh,Alternatives:()=>IT,ArrayLiteral:()=>h5,ArrayType:()=>d5,Assignment:()=>Jh,BooleanLiteral:()=>f5,CharacterRange:()=>ed,Condition:()=>td,Conjunction:()=>MT,CrossReference:()=>rd,Disjunction:()=>DT,EndOfFile:()=>p5,Grammar:()=>_u,GrammarImport:()=>g5,Group:()=>qf,InferredType:()=>m5,InfixRule:()=>vc,InfixRuleOperatorList:()=>OT,InfixRuleOperators:()=>y5,Interface:()=>rm,Keyword:()=>nm,LangiumGrammarAstReflection:()=>W9,LangiumGrammarTerminals:()=>TQe,NamedArgument:()=>im,NegatedToken:()=>Uf,Negation:()=>v5,NumberLiteral:()=>b5,Parameter:()=>am,ParameterReference:()=>x5,ParserRule:()=>xl,ReferenceType:()=>$T,RegexToken:()=>Hf,ReturnType:()=>T5,RuleCall:()=>Yf,SimpleType:()=>sm,StringLiteral:()=>C5,TerminalAlternatives:()=>Xf,TerminalElement:()=>Xs,TerminalGroup:()=>jf,TerminalRule:()=>Iu,TerminalRuleCall:()=>Kf,Type:()=>PT,TypeAttribute:()=>Zf,TypeDefinition:()=>Qf,UnionType:()=>E5,UnorderedGroup:()=>BT,UntilToken:()=>Jf,ValueLiteral:()=>ep,Wildcard:()=>om,isAbstractElement:()=>c5,isAbstractParserRule:()=>Gf,isAbstractRule:()=>jse,isAbstractType:()=>Kse,isAction:()=>Qh,isAlternatives:()=>u5,isArrayLiteral:()=>Zse,isArrayType:()=>S9,isAssignment:()=>Au,isBooleanLiteral:()=>k9,isCharacterRange:()=>E9,isCondition:()=>Qse,isConjunction:()=>A9,isCrossReference:()=>Wf,isDisjunction:()=>_9,isEndOfFile:()=>R9,isGrammar:()=>Jse,isGrammarImport:()=>eoe,isGroup:()=>Vf,isInferredType:()=>NT,isInfixRule:()=>tm,isInfixRuleOperatorList:()=>toe,isInfixRuleOperators:()=>roe,isInterface:()=>L9,isKeyword:()=>Ru,isNamedArgument:()=>noe,isNegatedToken:()=>I9,isNegation:()=>M9,isNumberLiteral:()=>ioe,isParameter:()=>aoe,isParameterReference:()=>D9,isParserRule:()=>Es,isReferenceType:()=>N9,isRegexToken:()=>O9,isReturnType:()=>$9,isRuleCall:()=>Lu,isSimpleType:()=>w5,isStringLiteral:()=>soe,isTerminalAlternatives:()=>P9,isTerminalElement:()=>ooe,isTerminalGroup:()=>B9,isTerminalRule:()=>Wo,isTerminalRuleCall:()=>S5,isType:()=>k5,isTypeAttribute:()=>loe,isTypeDefinition:()=>coe,isUnionType:()=>F9,isUnorderedGroup:()=>A5,isUntilToken:()=>z9,isValueLiteral:()=>uoe,isWildcard:()=>G9,reflection:()=>kr});var TQe={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Ys={$type:"AbstractElement",cardinality:"cardinality"};function c5(t){return kr.isInstance(t,Ys.$type)}A(c5,"isAbstractElement");var LT={$type:"AbstractParserRule"};function Gf(t){return kr.isInstance(t,LT.$type)}A(Gf,"isAbstractParserRule");var em={$type:"AbstractRule"};function jse(t){return kr.isInstance(t,em.$type)}A(jse,"isAbstractRule");var bo={$type:"AbstractType"};function Kse(t){return kr.isInstance(t,bo.$type)}A(Kse,"isAbstractType");var Zh={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Qh(t){return kr.isInstance(t,Zh.$type)}A(Qh,"isAction");var IT={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function u5(t){return kr.isInstance(t,IT.$type)}A(u5,"isAlternatives");var h5={$type:"ArrayLiteral",elements:"elements"};function Zse(t){return kr.isInstance(t,h5.$type)}A(Zse,"isArrayLiteral");var d5={$type:"ArrayType",elementType:"elementType"};function S9(t){return kr.isInstance(t,d5.$type)}A(S9,"isArrayType");var Jh={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Au(t){return kr.isInstance(t,Jh.$type)}A(Au,"isAssignment");var f5={$type:"BooleanLiteral",true:"true"};function k9(t){return kr.isInstance(t,f5.$type)}A(k9,"isBooleanLiteral");var ed={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function E9(t){return kr.isInstance(t,ed.$type)}A(E9,"isCharacterRange");var td={$type:"Condition"};function Qse(t){return kr.isInstance(t,td.$type)}A(Qse,"isCondition");var MT={$type:"Conjunction",left:"left",right:"right"};function A9(t){return kr.isInstance(t,MT.$type)}A(A9,"isConjunction");var rd={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Wf(t){return kr.isInstance(t,rd.$type)}A(Wf,"isCrossReference");var DT={$type:"Disjunction",left:"left",right:"right"};function _9(t){return kr.isInstance(t,DT.$type)}A(_9,"isDisjunction");var p5={$type:"EndOfFile",cardinality:"cardinality"};function R9(t){return kr.isInstance(t,p5.$type)}A(R9,"isEndOfFile");var _u={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function Jse(t){return kr.isInstance(t,_u.$type)}A(Jse,"isGrammar");var g5={$type:"GrammarImport",path:"path"};function eoe(t){return kr.isInstance(t,g5.$type)}A(eoe,"isGrammarImport");var qf={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Vf(t){return kr.isInstance(t,qf.$type)}A(Vf,"isGroup");var m5={$type:"InferredType",name:"name"};function NT(t){return kr.isInstance(t,m5.$type)}A(NT,"isInferredType");var vc={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function tm(t){return kr.isInstance(t,vc.$type)}A(tm,"isInfixRule");var OT={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function toe(t){return kr.isInstance(t,OT.$type)}A(toe,"isInfixRuleOperatorList");var y5={$type:"InfixRuleOperators",precedences:"precedences"};function roe(t){return kr.isInstance(t,y5.$type)}A(roe,"isInfixRuleOperators");var rm={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function L9(t){return kr.isInstance(t,rm.$type)}A(L9,"isInterface");var nm={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ru(t){return kr.isInstance(t,nm.$type)}A(Ru,"isKeyword");var im={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function noe(t){return kr.isInstance(t,im.$type)}A(noe,"isNamedArgument");var Uf={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function I9(t){return kr.isInstance(t,Uf.$type)}A(I9,"isNegatedToken");var v5={$type:"Negation",value:"value"};function M9(t){return kr.isInstance(t,v5.$type)}A(M9,"isNegation");var b5={$type:"NumberLiteral",value:"value"};function ioe(t){return kr.isInstance(t,b5.$type)}A(ioe,"isNumberLiteral");var am={$type:"Parameter",name:"name"};function aoe(t){return kr.isInstance(t,am.$type)}A(aoe,"isParameter");var x5={$type:"ParameterReference",parameter:"parameter"};function D9(t){return kr.isInstance(t,x5.$type)}A(D9,"isParameterReference");var xl={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Es(t){return kr.isInstance(t,xl.$type)}A(Es,"isParserRule");var $T={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function N9(t){return kr.isInstance(t,$T.$type)}A(N9,"isReferenceType");var Hf={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function O9(t){return kr.isInstance(t,Hf.$type)}A(O9,"isRegexToken");var T5={$type:"ReturnType",name:"name"};function $9(t){return kr.isInstance(t,T5.$type)}A($9,"isReturnType");var Yf={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Lu(t){return kr.isInstance(t,Yf.$type)}A(Lu,"isRuleCall");var sm={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function w5(t){return kr.isInstance(t,sm.$type)}A(w5,"isSimpleType");var C5={$type:"StringLiteral",value:"value"};function soe(t){return kr.isInstance(t,C5.$type)}A(soe,"isStringLiteral");var Xf={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function P9(t){return kr.isInstance(t,Xf.$type)}A(P9,"isTerminalAlternatives");var Xs={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ooe(t){return kr.isInstance(t,Xs.$type)}A(ooe,"isTerminalElement");var jf={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function B9(t){return kr.isInstance(t,jf.$type)}A(B9,"isTerminalGroup");var Iu={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Wo(t){return kr.isInstance(t,Iu.$type)}A(Wo,"isTerminalRule");var Kf={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function S5(t){return kr.isInstance(t,Kf.$type)}A(S5,"isTerminalRuleCall");var PT={$type:"Type",name:"name",type:"type"};function k5(t){return kr.isInstance(t,PT.$type)}A(k5,"isType");var Zf={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function loe(t){return kr.isInstance(t,Zf.$type)}A(loe,"isTypeAttribute");var Qf={$type:"TypeDefinition"};function coe(t){return kr.isInstance(t,Qf.$type)}A(coe,"isTypeDefinition");var E5={$type:"UnionType",types:"types"};function F9(t){return kr.isInstance(t,E5.$type)}A(F9,"isUnionType");var BT={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function A5(t){return kr.isInstance(t,BT.$type)}A(A5,"isUnorderedGroup");var Jf={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function z9(t){return kr.isInstance(t,Jf.$type)}A(z9,"isUntilToken");var ep={$type:"ValueLiteral"};function uoe(t){return kr.isInstance(t,ep.$type)}A(uoe,"isValueLiteral");var om={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function G9(t){return kr.isInstance(t,om.$type)}A(G9,"isWildcard");var W9=(N1=class extends x9{constructor(){super(...arguments),this.types={AbstractElement:{name:Ys.$type,properties:{cardinality:{name:Ys.cardinality}},superTypes:[]},AbstractParserRule:{name:LT.$type,properties:{},superTypes:[em.$type,bo.$type]},AbstractRule:{name:em.$type,properties:{},superTypes:[]},AbstractType:{name:bo.$type,properties:{},superTypes:[]},Action:{name:Zh.$type,properties:{cardinality:{name:Zh.cardinality},feature:{name:Zh.feature},inferredType:{name:Zh.inferredType},operator:{name:Zh.operator},type:{name:Zh.type,referenceType:bo.$type}},superTypes:[Ys.$type]},Alternatives:{name:IT.$type,properties:{cardinality:{name:IT.cardinality},elements:{name:IT.elements,defaultValue:[]}},superTypes:[Ys.$type]},ArrayLiteral:{name:h5.$type,properties:{elements:{name:h5.elements,defaultValue:[]}},superTypes:[ep.$type]},ArrayType:{name:d5.$type,properties:{elementType:{name:d5.elementType}},superTypes:[Qf.$type]},Assignment:{name:Jh.$type,properties:{cardinality:{name:Jh.cardinality},feature:{name:Jh.feature},operator:{name:Jh.operator},predicate:{name:Jh.predicate},terminal:{name:Jh.terminal}},superTypes:[Ys.$type]},BooleanLiteral:{name:f5.$type,properties:{true:{name:f5.true,defaultValue:!1}},superTypes:[td.$type,ep.$type]},CharacterRange:{name:ed.$type,properties:{cardinality:{name:ed.cardinality},left:{name:ed.left},lookahead:{name:ed.lookahead},parenthesized:{name:ed.parenthesized,defaultValue:!1},right:{name:ed.right}},superTypes:[Xs.$type]},Condition:{name:td.$type,properties:{},superTypes:[]},Conjunction:{name:MT.$type,properties:{left:{name:MT.left},right:{name:MT.right}},superTypes:[td.$type]},CrossReference:{name:rd.$type,properties:{cardinality:{name:rd.cardinality},deprecatedSyntax:{name:rd.deprecatedSyntax,defaultValue:!1},isMulti:{name:rd.isMulti,defaultValue:!1},terminal:{name:rd.terminal},type:{name:rd.type,referenceType:bo.$type}},superTypes:[Ys.$type]},Disjunction:{name:DT.$type,properties:{left:{name:DT.left},right:{name:DT.right}},superTypes:[td.$type]},EndOfFile:{name:p5.$type,properties:{cardinality:{name:p5.cardinality}},superTypes:[Ys.$type]},Grammar:{name:_u.$type,properties:{imports:{name:_u.imports,defaultValue:[]},interfaces:{name:_u.interfaces,defaultValue:[]},isDeclared:{name:_u.isDeclared,defaultValue:!1},name:{name:_u.name},rules:{name:_u.rules,defaultValue:[]},types:{name:_u.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:g5.$type,properties:{path:{name:g5.path}},superTypes:[]},Group:{name:qf.$type,properties:{cardinality:{name:qf.cardinality},elements:{name:qf.elements,defaultValue:[]},guardCondition:{name:qf.guardCondition},predicate:{name:qf.predicate}},superTypes:[Ys.$type]},InferredType:{name:m5.$type,properties:{name:{name:m5.name}},superTypes:[bo.$type]},InfixRule:{name:vc.$type,properties:{call:{name:vc.call},dataType:{name:vc.dataType},inferredType:{name:vc.inferredType},name:{name:vc.name},operators:{name:vc.operators},parameters:{name:vc.parameters,defaultValue:[]},returnType:{name:vc.returnType,referenceType:bo.$type}},superTypes:[LT.$type]},InfixRuleOperatorList:{name:OT.$type,properties:{associativity:{name:OT.associativity},operators:{name:OT.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:y5.$type,properties:{precedences:{name:y5.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:rm.$type,properties:{attributes:{name:rm.attributes,defaultValue:[]},name:{name:rm.name},superTypes:{name:rm.superTypes,defaultValue:[],referenceType:bo.$type}},superTypes:[bo.$type]},Keyword:{name:nm.$type,properties:{cardinality:{name:nm.cardinality},predicate:{name:nm.predicate},value:{name:nm.value}},superTypes:[Ys.$type]},NamedArgument:{name:im.$type,properties:{calledByName:{name:im.calledByName,defaultValue:!1},parameter:{name:im.parameter,referenceType:am.$type},value:{name:im.value}},superTypes:[]},NegatedToken:{name:Uf.$type,properties:{cardinality:{name:Uf.cardinality},lookahead:{name:Uf.lookahead},parenthesized:{name:Uf.parenthesized,defaultValue:!1},terminal:{name:Uf.terminal}},superTypes:[Xs.$type]},Negation:{name:v5.$type,properties:{value:{name:v5.value}},superTypes:[td.$type]},NumberLiteral:{name:b5.$type,properties:{value:{name:b5.value}},superTypes:[ep.$type]},Parameter:{name:am.$type,properties:{name:{name:am.name}},superTypes:[]},ParameterReference:{name:x5.$type,properties:{parameter:{name:x5.parameter,referenceType:am.$type}},superTypes:[td.$type]},ParserRule:{name:xl.$type,properties:{dataType:{name:xl.dataType},definition:{name:xl.definition},entry:{name:xl.entry,defaultValue:!1},fragment:{name:xl.fragment,defaultValue:!1},inferredType:{name:xl.inferredType},name:{name:xl.name},parameters:{name:xl.parameters,defaultValue:[]},returnType:{name:xl.returnType,referenceType:bo.$type}},superTypes:[LT.$type]},ReferenceType:{name:$T.$type,properties:{isMulti:{name:$T.isMulti,defaultValue:!1},referenceType:{name:$T.referenceType}},superTypes:[Qf.$type]},RegexToken:{name:Hf.$type,properties:{cardinality:{name:Hf.cardinality},lookahead:{name:Hf.lookahead},parenthesized:{name:Hf.parenthesized,defaultValue:!1},regex:{name:Hf.regex}},superTypes:[Xs.$type]},ReturnType:{name:T5.$type,properties:{name:{name:T5.name}},superTypes:[]},RuleCall:{name:Yf.$type,properties:{arguments:{name:Yf.arguments,defaultValue:[]},cardinality:{name:Yf.cardinality},predicate:{name:Yf.predicate},rule:{name:Yf.rule,referenceType:em.$type}},superTypes:[Ys.$type]},SimpleType:{name:sm.$type,properties:{primitiveType:{name:sm.primitiveType},stringType:{name:sm.stringType},typeRef:{name:sm.typeRef,referenceType:bo.$type}},superTypes:[Qf.$type]},StringLiteral:{name:C5.$type,properties:{value:{name:C5.value}},superTypes:[ep.$type]},TerminalAlternatives:{name:Xf.$type,properties:{cardinality:{name:Xf.cardinality},elements:{name:Xf.elements,defaultValue:[]},lookahead:{name:Xf.lookahead},parenthesized:{name:Xf.parenthesized,defaultValue:!1}},superTypes:[Xs.$type]},TerminalElement:{name:Xs.$type,properties:{cardinality:{name:Xs.cardinality},lookahead:{name:Xs.lookahead},parenthesized:{name:Xs.parenthesized,defaultValue:!1}},superTypes:[Ys.$type]},TerminalGroup:{name:jf.$type,properties:{cardinality:{name:jf.cardinality},elements:{name:jf.elements,defaultValue:[]},lookahead:{name:jf.lookahead},parenthesized:{name:jf.parenthesized,defaultValue:!1}},superTypes:[Xs.$type]},TerminalRule:{name:Iu.$type,properties:{definition:{name:Iu.definition},fragment:{name:Iu.fragment,defaultValue:!1},hidden:{name:Iu.hidden,defaultValue:!1},name:{name:Iu.name},type:{name:Iu.type}},superTypes:[em.$type]},TerminalRuleCall:{name:Kf.$type,properties:{cardinality:{name:Kf.cardinality},lookahead:{name:Kf.lookahead},parenthesized:{name:Kf.parenthesized,defaultValue:!1},rule:{name:Kf.rule,referenceType:Iu.$type}},superTypes:[Xs.$type]},Type:{name:PT.$type,properties:{name:{name:PT.name},type:{name:PT.type}},superTypes:[bo.$type]},TypeAttribute:{name:Zf.$type,properties:{defaultValue:{name:Zf.defaultValue},isOptional:{name:Zf.isOptional,defaultValue:!1},name:{name:Zf.name},type:{name:Zf.type}},superTypes:[]},TypeDefinition:{name:Qf.$type,properties:{},superTypes:[]},UnionType:{name:E5.$type,properties:{types:{name:E5.types,defaultValue:[]}},superTypes:[Qf.$type]},UnorderedGroup:{name:BT.$type,properties:{cardinality:{name:BT.cardinality},elements:{name:BT.elements,defaultValue:[]}},superTypes:[Ys.$type]},UntilToken:{name:Jf.$type,properties:{cardinality:{name:Jf.cardinality},lookahead:{name:Jf.lookahead},parenthesized:{name:Jf.parenthesized,defaultValue:!1},terminal:{name:Jf.terminal}},superTypes:[Xs.$type]},ValueLiteral:{name:ep.$type,properties:{},superTypes:[]},Wildcard:{name:om.$type,properties:{cardinality:{name:om.cardinality},lookahead:{name:om.lookahead},parenthesized:{name:om.parenthesized,defaultValue:!1}},superTypes:[Xs.$type]}}}},A(N1,"LangiumGrammarAstReflection"),N1),kr=new W9;function hoe(t){let e=t,r=!1;for(;e;){const n=zf(e.grammarSource,Es);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}A(hoe,"getDatatypeNode");function lm(t){return new Kg(t,e=>ku(e)?e.content:[],{includeRoot:!0})}A(lm,"streamCst");function doe(t){return lm(t).filter(Ff)}A(doe,"flattenCst");function q9(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}A(q9,"isChildNode");function FT(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}A(FT,"tokenToRange");function cm(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}A(cm,"toDocumentSegment");var bc;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(bc||(bc={}));function V9(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return bc.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linebc.After}A(U9,"inRange");var H9=/^[\w\p{L}]$/u;function foe(t,e,r=H9){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return R5(t,e)}}A(foe,"findDeclarationNodeAtOffset");function Y9(t,e){if(t){const r=K9(t,!0);if(r&&_5(r,e))return r;if(a5(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(_5(a,e))return a}}}}A(Y9,"findCommentNode");function _5(t,e){return Ff(t)&&e.includes(t.tokenType.name)}A(_5,"isCommentNode");function R5(t,e){if(Ff(t))return t;if(ku(t)){const r=j9(t,e,!1);if(r)return R5(r,e)}}A(R5,"findLeafNodeAtOffset");function X9(t,e){if(Ff(t))return t;if(ku(t)){const r=j9(t,e,!0);if(r)return X9(r,e)}}A(X9,"findLeafNodeBeforeOffset");function j9(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}A(j9,"binarySearch");function K9(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}A(K9,"getPreviousNode");function poe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;ndO,findNameAssignment:()=>G5,findNodeForKeyword:()=>hO,findNodeForProperty:()=>B5,findNodesForKeyword:()=>Eoe,findNodesForKeywordInternal:()=>z5,findNodesForProperty:()=>uO,getActionAtElement:()=>pO,getActionType:()=>mO,getAllReachableRules:()=>P5,getAllRulesUsedForCrossReferences:()=>koe,getCrossReferenceTerminal:()=>lO,getEntryRule:()=>aO,getExplicitRuleType:()=>GT,getHiddenRules:()=>sO,getRuleType:()=>yO,getRuleTypeName:()=>Ioe,getTypeName:()=>np,isArrayCardinality:()=>_oe,isArrayOperator:()=>Roe,isCommentTerminal:()=>cO,isDataType:()=>Loe,isDataTypeRule:()=>zT,isOptionalCardinality:()=>Aoe,terminalRegex:()=>WT});var L5=(O1=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},A(O1,"ErrorWithLocation"),O1);function nd(t,e="Error: Got unexpected value."){throw new Error(e)}A(nd,"assertUnreachable");function J9(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}A(J9,"assertCondition");var eO={};Kh(eO,{NEWLINE_REGEXP:()=>Toe,escapeRegExp:()=>hm,getTerminalParts:()=>Coe,isMultilineComment:()=>rO,isWhitespace:()=>$5,partialMatches:()=>nO,partialRegExp:()=>iO,whitespaceCharacters:()=>Soe});function Mr(t){return t.charCodeAt(0)}A(Mr,"cc");function I5(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}A(I5,"insertToSet");function um(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}A(um,"addFlag");function tp(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}A(tp,"ASSERT_EXISTS");function voe(){throw Error("Internal Error - Should never get here!")}A(voe,"ASSERT_NEVER_REACH_HERE");function tO(t){return t.type==="Character"}A(tO,"isCharacter");var M5=[];for(let t=Mr("0");t<=Mr("9");t++)M5.push(t);var D5=[Mr("_")].concat(M5);for(let t=Mr("a");t<=Mr("z");t++)D5.push(t);for(let t=Mr("A");t<=Mr("Z");t++)D5.push(t);var boe=[Mr(" "),Mr("\f"),Mr(` +`),Mr("\r"),Mr(" "),Mr("\v"),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr(" "),Mr("\u2028"),Mr("\u2029"),Mr(" "),Mr(" "),Mr(" "),Mr("\uFEFF")],wQe=/[0-9a-fA-F]/,N5=/[0-9]/,CQe=/[1-9]/,xoe=($1=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":um(n,"global");break;case"i":um(n,"ignoreCase");break;case"m":um(n,"multiLine");break;case"u":um(n,"unicode");break;case"y":um(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}tp(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return voe()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;tp(r);break}if(!(e===!0&&r===void 0)&&tp(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),tp(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Mr(` +`),Mr("\r"),Mr("\u2028"),Mr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=M5;break;case"D":e=M5,r=!0;break;case"s":e=boe;break;case"S":e=boe,r=!0;break;case"w":e=D5;break;case"W":e=D5,r=!0;break}if(tp(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Mr("\f");break;case"n":e=Mr(` +`);break;case"r":e=Mr("\r");break;case"t":e=Mr(" ");break;case"v":e=Mr("\v");break}if(tp(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Mr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Mr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Mr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,tO(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,tO(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},E(Gm,"RegExpParser"),Gm),pk=(qm=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},E(qm,"BaseRegExpVisitor"),qm),Ire=/\r?\n/gm,Dre=new Lre,wHe=(Vm=class extends pk{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` -`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=xg(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` -`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},E(Vm,"TerminalRegExpVisitor"),Vm),pf=new wHe;function Mre(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=Dre.pattern(t),r=[];for(const n of e.value.value)pf.reset(t),pf.visit(n),r.push({start:pf.startRegexp,end:pf.endRegex});return r}catch{return[]}}E(Mre,"getTerminalParts");function CD(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),pf.reset(t),pf.visit(Dre.pattern(t)),pf.multiline}catch{return!1}}E(CD,"isMultilineComment");var Nre=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function gk(t){const e=typeof t=="string"?new RegExp(t):t;return Nre.some(r=>e.test(r))}E(gk,"isWhitespace");function xg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}E(xg,"escapeRegExp");function kD(t,e){const r=ED(t),n=e.match(r);return!!n&&n[0].length>0}E(kD,"partialMatches");function ED(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}E(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(E(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return E(i,"process"),new RegExp(i(),t.flags)}E(ED,"partialRegExp");function SD(t){return t.rules.find(e=>ns(e)&&e.entry)}E(SD,"getEntryRule");function AD(t){return t.rules.filter(e=>mo(e)&&e.hidden)}E(AD,"getHiddenRules");function mk(t,e){const r=new Set,n=SD(t);if(!n)return new Set(t.rules);const i=[n].concat(AD(t));for(const s of i)_D(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||mo(s)&&s.hidden)&&a.add(s);return a}E(mk,"getAllReachableRules");function _D(t,e,r){e.add(t.name),Hc(t).forEach(n=>{if(jc(n)||r&&nk(n)){const i=n.rule.ref;i&&!e.has(i.name)&&_D(i,e,r)}})}E(_D,"ruleDfs");function Ore(t){const e=new Set;return Hc(t).forEach(r=>{Jd(r)&&(ns(r.type.ref)&&e.add(r.type.ref),Px(r.type.ref)&&ns(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}E(Ore,"getAllRulesUsedForCrossReferences");function RD(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=xk(t.type.ref);return e==null?void 0:e.terminal}}E(RD,"getCrossReferenceTerminal");function LD(t){return t.hidden&&!gk(Ux(t))}E(LD,"isCommentTerminal");function ID(t,e){return!t||!e?[]:vk(t,e,t.astNode,!0)}E(ID,"findNodesForProperty");function yk(t,e,r){if(!t||!e)return;const n=vk(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(yk,"findNodeForProperty");function vk(t,e,r,n){if(!n){const i=Zd(t.grammarSource,Yc);if(i&&i.feature===e)return[t]}return Uc(t)&&t.astNode===r?t.content.flatMap(i=>vk(i,e,r,!1)):[]}E(vk,"findNodesForPropertyInternal");function $re(t,e){return t?bk(t,e,t==null?void 0:t.astNode):[]}E($re,"findNodesForKeyword");function DD(t,e,r){if(!t)return;const n=bk(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(DD,"findNodeForKeyword");function bk(t,e,r){if(t.astNode!==r)return[];if(Kc(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=yg(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Kc(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}E(bk,"findNodesForKeywordInternal");function MD(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=Zd(t.grammarSource,Yc);if(n)return n;t=t.container}}E(MD,"findAssignment");function xk(t){let e=t;return Px(e)&&(mh(e.$container)?e=e.$container.$container:Qd(e.$container)?e=e.$container:Th(e.$container)),ND(t,e,new Map)}E(xk,"findNameAssignment");function ND(t,e,r){var i;function n(a,s){let o;return Zd(a,Yc)||(o=ND(s,s,r)),r.set(t,o),o}if(E(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Hc(e)){if(Yc(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(jc(a)&&ns(a.rule.ref))return n(a,a.rule.ref);if(tk(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}E(ND,"findNameAssignmentInternal");function OD(t){const e=t.$container;if(tf(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(mh(a))return a;{const s=Hc(r[i]).find(mh);if(s)return s}}}if(q3(e))return OD(e)}E(OD,"getActionAtElement");function Pre(t,e){return t==="?"||t==="*"||tf(e)&&!!e.guardCondition}E(Pre,"isOptionalCardinality");function Bre(t){return t==="*"||t==="+"}E(Bre,"isArrayCardinality");function Fre(t){return t==="+="}E(Fre,"isArrayOperator");function Vx(t){return $D(t,new Set)}E(Vx,"isDataTypeRule");function $D(t,e){if(e.has(t))return!0;e.add(t);for(const r of Hc(t))if(jc(r)){if(!r.rule.ref||ns(r.rule.ref)&&!$D(r.rule.ref,e)||ug(r.rule.ref))return!1}else{if(Yc(r))return!1;if(mh(r))return!1}return!!t.definition}E($D,"isDataTypeRuleInternal");function zre(t){return Tk(t.type,new Set)}E(zre,"isDataType");function Tk(t,e){if(e.has(t))return!0;if(e.add(t),U9(t))return!1;if(tD(t))return!1;if(sD(t))return t.types.every(r=>Tk(r,e));if(tk(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return ik(r)?Tk(r.type,e):!1}else return!1}else return!1}E(Tk,"isDataTypeInternal");function Wx(t){if(!mo(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}E(Wx,"getExplicitRuleType");function gf(t){if(Qd(t))return ns(t)&&Vx(t)?t.name:Wx(t)??t.name;if(Z9(t)||ik(t)||nD(t))return t.name;if(mh(t)){const e=PD(t);if(e)return e}else if(Px(t))return t.name;throw new Error("Cannot get name of Unknown Type")}E(gf,"getTypeName");function PD(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return gf(t.type.ref)}E(PD,"getActionType");function Gre(t){var e;return mo(t)?((e=t.type)==null?void 0:e.name)??"string":ns(t)&&Vx(t)?t.name:Wx(t)??t.name}E(Gre,"getRuleTypeName");function BD(t){var e;return mo(t)?((e=t.type)==null?void 0:e.name)??"string":Wx(t)??t.name}E(BD,"getRuleType");function Ux(t){const e={s:!1,i:!1,u:!1},r=mf(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}E(Ux,"terminalRegex");var FD=/[\s\S]/.source;function mf(t,e){var r;if(iD(t))return qre(t);if(aD(t))return Vre(t);if(Y9(t))return Hre(t);if(nk(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Ul(mf(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Q9(t))return Ure(t);if(oD(t))return Wre(t);if(rD(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Ul(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(lD(t))return Ul(FD,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}E(mf,"abstractElementToRegex");function qre(t){return Ul(t.elements.map(e=>mf(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(qre,"terminalAlternativesToRegex");function Vre(t){return Ul(t.elements.map(e=>mf(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Vre,"terminalGroupToRegex");function Wre(t){return Ul(`${FD}*?${mf(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Wre,"untilTokenToRegex");function Ure(t){return Ul(`(?!${mf(t.terminal)})${FD}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Ure,"negateTokenToRegex");function Hre(t){return t.right?Ul(`[${wk(t.left)}-${wk(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Ul(wk(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Hre,"characterRangeToRegex");function wk(t){return xg(t.value)}E(wk,"keywordToRegex");function Ul(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}E(Ul,"withCardinality");function zD(t){const e=[],r=t.Grammar;for(const n of r.rules)mo(n)&&LD(n)&&CD(Ux(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:fD}}E(zD,"createGrammarConfig");var CHe=typeof global=="object"&&global&&global.Object===Object&&global,Yre=CHe,kHe=typeof self=="object"&&self&&self.Object===Object&&self,EHe=Yre||kHe||Function("return this")(),Hl=EHe,SHe=Hl.Symbol,yo=SHe,Xre=Object.prototype,AHe=Xre.hasOwnProperty,_He=Xre.toString,Hx=yo?yo.toStringTag:void 0;function Kre(t){var e=AHe.call(t,Hx),r=t[Hx];try{t[Hx]=void 0;var n=!0}catch{}var i=_He.call(t);return n&&(e?t[Hx]=r:delete t[Hx]),i}E(Kre,"getRawTag");var RHe=Kre,LHe=Object.prototype,IHe=LHe.toString;function jre(t){return IHe.call(t)}E(jre,"objectToString");var DHe=jre,MHe="[object Null]",NHe="[object Undefined]",Zre=yo?yo.toStringTag:void 0;function Qre(t){return t==null?t===void 0?NHe:MHe:Zre&&Zre in Object(t)?RHe(t):DHe(t)}E(Qre,"baseGetTag");var wh=Qre;function Jre(t){return t!=null&&typeof t=="object"}E(Jre,"isObjectLike");var Uo=Jre,OHe="[object Symbol]";function ene(t){return typeof t=="symbol"||Uo(t)&&wh(t)==OHe}E(ene,"isSymbol");var Ck=ene;function tne(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=yYe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}E(kne,"shortOut");var xYe=kne;function Ene(t){return function(){return t}}E(Ene,"constant");var TYe=Ene,wYe=(function(){try{var t=vf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),kk=wYe,CYe=kk?function(t,e){return kk(t,"toString",{configurable:!0,enumerable:!1,value:TYe(e),writable:!0})}:Kx,kYe=CYe,EYe=xYe(kYe),SYe=EYe;function Sne(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}E(Mne,"arrayIncludes");var Nne=Mne,RYe=9007199254740991,LYe=/^(?:0|[1-9]\d*)$/;function One(t,e){var r=typeof t;return e=e??RYe,!!e&&(r=="number"||r!="symbol"&&LYe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=NYe}E(Vne,"isLength");var YD=Vne;function Wne(t){return t!=null&&YD(t.length)&&!Qc(t)}E(Wne,"isArrayLike");var Yl=Wne;function Une(t,e,r){if(!vo(r))return!1;var n=typeof e;return(n=="number"?Yl(r)&&Ek(e,r.length):n=="string"&&e in r)?jx(r[e],t):!1}E(Une,"isIterateeCall");var Ak=Une;function Hne(t){return HD(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Ak(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}E(Aie,"listCacheHas");var QXe=Aie;function _ie(t,e){var r=this.__data__,n=Lk(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(_ie,"listCacheSet");var JXe=_ie;function xf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?JD(o,e-1,r,n,i):QD(i,o):n||(i[i.length]=o)}return i}E(JD,"baseFlatten");var eM=JD;function Uie(t){var e=t==null?0:t.length;return e?eM(t,1):[]}E(Uie,"flatten");var Ho=Uie,vKe=cie(Object.getPrototypeOf,Object),Hie=vKe;function Yie(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&lZe?new oM:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Ak(e[0],e[1],i)&&(n=1);++r=tQe&&(a=lM,s=!1,e=new oM(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}E(Hse,"createFind");var oQe=Hse,lQe=Math.max;function Yse(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Xx(r);return i<0&&(i=lQe(n+i,0)),Rne(t,Xl(e),i)}E(Yse,"findIndex");var cQe=Yse,uQe=oQe(cQe),Cg=uQe;function Xse(t){return t&&t.length?t[0]:void 0}E(Xse,"head");var Xo=Xse;function Kse(t,e){var r=-1,n=Yl(t)?Array(t.length):[];return kf(t,function(i,a,s){n[++r]=e(i,a,s)}),n}E(Kse,"baseMap");var hQe=Kse;function jse(t,e){var r=Qr(t)?Yx:hQe;return r(t,Xl(e))}E(jse,"map");var ur=jse;function Zse(t,e){return eM(ur(t,e),1)}E(Zse,"flatMap");var xo=Zse,dQe=Object.prototype,fQe=dQe.hasOwnProperty,pQe=QZe(function(t,e,r){fQe.call(t,r)?t[r].push(e):UD(t,r,[e])}),gQe=pQe,mQe=Object.prototype,yQe=mQe.hasOwnProperty;function Qse(t,e){return t!=null&&yQe.call(t,e)}E(Qse,"baseHas");var vQe=Qse;function Jse(t,e){return t!=null&&mse(t,e,vQe)}E(Jse,"has");var br=Jse,bQe="[object String]";function eoe(t){return typeof t=="string"||!Qr(t)&&Uo(t)&&wh(t)==bQe}E(eoe,"isString");var Es=eoe;function toe(t,e){return Yx(e,function(r){return t[r]})}E(toe,"baseValues");var xQe=toe;function roe(t){return t==null?[]:xQe(t,Xs(t))}E(roe,"values");var zi=roe,TQe=Math.max;function noe(t,e,r,n){t=Yl(t)?t:zi(t),r=r&&!n?Xx(r):0;var i=t.length;return r<0&&(r=TQe(i+r,0)),Es(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&WD(t,e,r)>-1}E(noe,"includes");var is=noe,wQe=Math.max;function ioe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Xx(r);return i<0&&(i=wQe(n+i,0)),WD(t,e,i)}E(ioe,"indexOf");var aoe=ioe,CQe="[object Map]",kQe="[object Set]",EQe=Object.prototype,SQe=EQe.hasOwnProperty;function soe(t){if(t==null)return!0;if(Yl(t)&&(Qr(t)||typeof t=="string"||typeof t.splice=="function"||Jx(t)||KD(t)||_k(t)))return!t.length;var e=wg(t);if(e==CQe||e==kQe)return!t.size;if(Qx(t))return!hie(t).length;for(var r in t)if(SQe.call(t,r))return!1;return!0}E(soe,"isEmpty");var _n=soe,AQe="[object RegExp]";function ooe(t){return Uo(t)&&wh(t)==AQe}E(ooe,"baseIsRegExp");var _Qe=ooe,loe=Ch&&Ch.isRegExp,RQe=loe?eT(loe):_Qe,Jc=RQe;function coe(t){return t===void 0}E(coe,"isUndefined");var eu=coe,LQe="Expected a function";function uoe(t){if(typeof t!="function")throw new TypeError(LQe);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}E(uoe,"negate");var IQe=uoe;function hoe(t,e,r,n){if(!vo(t))return t;e=Ok(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=FQe){var u=e?null:BQe(t);if(u)return cM(u);s=!1,i=lM,l=new oM}else l=e?[]:o;e:for(;++n{r.accept(e)})}},E(Wm,"AbstractProduction"),Wm),as=(Um=class extends Kl{constructor(e){super([]),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},E(Um,"NonTerminal"),Um),kg=(Hm=class extends Kl{constructor(e){super(e.definition),this.orgText="",Ks(this,Ko(e,r=>r!==void 0))}},E(Hm,"Rule"),Hm),Ss=(Ym=class extends Kl{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Ks(this,Ko(e,r=>r!==void 0))}},E(Ym,"Alternative"),Ym),ya=(Xm=class extends Kl{constructor(e){super(e.definition),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}},E(Xm,"Option"),Xm),Zs=(Km=class extends Kl{constructor(e){super(e.definition),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}},E(Km,"RepetitionMandatory"),Km),Qs=(jm=class extends Kl{constructor(e){super(e.definition),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}},E(jm,"RepetitionMandatoryWithSeparator"),jm),ai=(Zm=class extends Kl{constructor(e){super(e.definition),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}},E(Zm,"Repetition"),Zm),As=(Qm=class extends Kl{constructor(e){super(e.definition),this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}},E(Qm,"RepetitionWithSeparator"),Qm),_s=(Jm=class extends Kl{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Ks(this,Ko(e,r=>r!==void 0))}},E(Jm,"Alternation"),Jm),Bn=(e1=class{constructor(e){this.idx=1,Ks(this,Ko(e,r=>r!==void 0))}accept(e){e.visit(this)}},E(e1,"Terminal"),e1);function koe(t){return ur(t,uT)}E(koe,"serializeGrammar");function uT(t){function e(r){return ur(r,uT)}if(E(e,"convertDefinition"),t instanceof as){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Es(t.label)&&(r.label=t.label),r}else{if(t instanceof Ss)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ya)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Zs)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Qs)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:uT(new Bn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof As)return{type:"RepetitionWithSeparator",idx:t.idx,separator:uT(new Bn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ai)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof _s)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Bn){const r={type:"Terminal",name:t.terminalType.name,label:woe(t.terminalType),idx:t.idx};Es(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Jc(n)?n.source:n),r}else{if(t instanceof kg)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}E(uT,"serializeProduction");var Eg=(t1=class{visit(e){const r=e;switch(r.constructor){case as:return this.visitNonTerminal(r);case Ss:return this.visitAlternative(r);case ya:return this.visitOption(r);case Zs:return this.visitRepetitionMandatory(r);case Qs:return this.visitRepetitionMandatoryWithSeparator(r);case As:return this.visitRepetitionWithSeparator(r);case ai:return this.visitRepetition(r);case _s:return this.visitAlternation(r);case Bn:return this.visitTerminal(r);case kg:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},E(t1,"GAstVisitor"),t1);function Eoe(t){return t instanceof Ss||t instanceof ya||t instanceof ai||t instanceof Zs||t instanceof Qs||t instanceof As||t instanceof Bn||t instanceof kg}E(Eoe,"isSequenceProd");function hT(t,e=[]){return t instanceof ya||t instanceof ai||t instanceof As?!0:t instanceof _s?boe(t.definition,n=>hT(n,e)):t instanceof as&&is(e,t)?!1:t instanceof Kl?(t instanceof as&&e.push(t),Yo(t.definition,n=>hT(n,e))):!1}E(hT,"isOptionalProd");function Soe(t){return t instanceof _s}E(Soe,"isBranchingProd");function jo(t){if(t instanceof as)return"SUBRULE";if(t instanceof ya)return"OPTION";if(t instanceof _s)return"OR";if(t instanceof Zs)return"AT_LEAST_ONE";if(t instanceof Qs)return"AT_LEAST_ONE_SEP";if(t instanceof As)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Bn)return"CONSUME";throw Error("non exhaustive match")}E(jo,"getProductionDslName");var Gk=(r1=class{walk(e,r=[]){Er(e.definition,(n,i)=>{const a=ma(e.definition,i+1);if(n instanceof as)this.walkProdRef(n,a,r);else if(n instanceof Bn)this.walkTerminal(n,a,r);else if(n instanceof Ss)this.walkFlat(n,a,r);else if(n instanceof ya)this.walkOption(n,a,r);else if(n instanceof Zs)this.walkAtLeastOne(n,a,r);else if(n instanceof Qs)this.walkAtLeastOneSep(n,a,r);else if(n instanceof As)this.walkManySep(n,a,r);else if(n instanceof ai)this.walkMany(n,a,r);else if(n instanceof _s)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new ya({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=yM(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ya({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=yM(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Er(e.definition,a=>{const s=new Ss({definition:[a]});this.walk(s,i)})}},E(r1,"RestWalker"),r1);function yM(t,e,r){return[new ya({definition:[new Bn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}E(yM,"restForRepetitionWithSeparator");function Sg(t){if(t instanceof as)return Sg(t.referencedRule);if(t instanceof Bn)return Roe(t);if(Eoe(t))return Aoe(t);if(Soe(t))return _oe(t);throw Error("non exhaustive match")}E(Sg,"first");function Aoe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=hT(a),e=e.concat(Sg(a)),n=n+1,i=r.length>n;return fM(e)}E(Aoe,"firstForSequence");function _oe(t){const e=ur(t.definition,r=>Sg(r));return fM(Ho(e))}E(_oe,"firstForBranching");function Roe(t){return[t.terminalType]}E(Roe,"firstForTerminal");var Loe="_~IN~_",GQe=(n1=class extends Gk{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Doe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ss({definition:a}),o=Sg(s);this.follows[i]=o}},E(n1,"ResyncFollowsWalker"),n1);function Ioe(t){const e={};return Er(t,r=>{const n=new GQe(r).startWalking();Ks(e,n)}),e}E(Ioe,"computeAllProdsFollows");function Doe(t,e){return t.name+e+Loe}E(Doe,"buildBetweenProdsFollowPrefix");var qk={},qQe=new Lre;function dT(t){const e=t.toString();if(qk.hasOwnProperty(e))return qk[e];{const r=qQe.pattern(e);return qk[e]=r,r}}E(dT,"getRegExpAst");function Moe(){qk={}}E(Moe,"clearRegExpParserCache");var Noe="Complement Sets are not supported for first char optimization",Vk=`Unable to use "first char" lexer optimizations: -`;function Ooe(t,e=!1){try{const r=dT(t);return Wk(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Noe)e&&pM(`${Vk} Unable to optimize: < ${t.toString()} > +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},A($1,"RegExpParser"),$1),O5=(P1=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},A(P1,"BaseRegExpVisitor"),P1),Toe=/\r?\n/gm,woe=new xoe,SQe=(B1=class extends O5{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=hm(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},A(B1,"TerminalRegExpVisitor"),B1),rp=new SQe;function Coe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=woe.pattern(t),r=[];for(const n of e.value.value)rp.reset(t),rp.visit(n),r.push({start:rp.startRegexp,end:rp.endRegex});return r}catch{return[]}}A(Coe,"getTerminalParts");function rO(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),rp.reset(t),rp.visit(woe.pattern(t)),rp.multiline}catch{return!1}}A(rO,"isMultilineComment");var Soe=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function $5(t){const e=typeof t=="string"?new RegExp(t):t;return Soe.some(r=>e.test(r))}A($5,"isWhitespace");function hm(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}A(hm,"escapeRegExp");function nO(t,e){const r=iO(t),n=e.match(r);return!!n&&n[0].length>0}A(nO,"partialMatches");function iO(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}A(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(A(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return A(i,"process"),new RegExp(i(),t.flags)}A(iO,"partialRegExp");function aO(t){return t.rules.find(e=>Es(e)&&e.entry)}A(aO,"getEntryRule");function sO(t){return t.rules.filter(e=>Wo(e)&&e.hidden)}A(sO,"getHiddenRules");function P5(t,e){const r=new Set,n=aO(t);if(!n)return new Set(t.rules);const i=[n].concat(sO(t));for(const s of i)oO(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Wo(s)&&s.hidden)&&a.add(s);return a}A(P5,"getAllReachableRules");function oO(t,e,r){e.add(t.name),Eu(t).forEach(n=>{if(Lu(n)||r&&S5(n)){const i=n.rule.ref;i&&!e.has(i.name)&&oO(i,e,r)}})}A(oO,"ruleDfs");function koe(t){const e=new Set;return Eu(t).forEach(r=>{Wf(r)&&(Es(r.type.ref)&&e.add(r.type.ref),NT(r.type.ref)&&Es(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}A(koe,"getAllRulesUsedForCrossReferences");function lO(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=G5(t.type.ref);return e==null?void 0:e.terminal}}A(lO,"getCrossReferenceTerminal");function cO(t){return t.hidden&&!$5(WT(t))}A(cO,"isCommentTerminal");function uO(t,e){return!t||!e?[]:F5(t,e,t.astNode,!0)}A(uO,"findNodesForProperty");function B5(t,e,r){if(!t||!e)return;const n=F5(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A(B5,"findNodeForProperty");function F5(t,e,r,n){if(!n){const i=zf(t.grammarSource,Au);if(i&&i.feature===e)return[t]}return ku(t)&&t.astNode===r?t.content.flatMap(i=>F5(i,e,r,!1)):[]}A(F5,"findNodesForPropertyInternal");function Eoe(t,e){return t?z5(t,e,t==null?void 0:t.astNode):[]}A(Eoe,"findNodesForKeyword");function hO(t,e,r){if(!t)return;const n=z5(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A(hO,"findNodeForKeyword");function z5(t,e,r){if(t.astNode!==r)return[];if(Ru(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=lm(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Ru(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}A(z5,"findNodesForKeywordInternal");function dO(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=zf(t.grammarSource,Au);if(n)return n;t=t.container}}A(dO,"findAssignment");function G5(t){let e=t;return NT(e)&&(Qh(e.$container)?e=e.$container.$container:Gf(e.$container)?e=e.$container:nd(e.$container)),fO(t,e,new Map)}A(G5,"findNameAssignment");function fO(t,e,r){var i;function n(a,s){let o;return zf(a,Au)||(o=fO(s,s,r)),r.set(t,o),o}if(A(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Eu(e)){if(Au(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Lu(a)&&Es(a.rule.ref))return n(a,a.rule.ref);if(w5(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}A(fO,"findNameAssignmentInternal");function pO(t){const e=t.$container;if(Vf(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Qh(a))return a;{const s=Eu(r[i]).find(Qh);if(s)return s}}}if(c5(e))return pO(e)}A(pO,"getActionAtElement");function Aoe(t,e){return t==="?"||t==="*"||Vf(e)&&!!e.guardCondition}A(Aoe,"isOptionalCardinality");function _oe(t){return t==="*"||t==="+"}A(_oe,"isArrayCardinality");function Roe(t){return t==="+="}A(Roe,"isArrayOperator");function zT(t){return gO(t,new Set)}A(zT,"isDataTypeRule");function gO(t,e){if(e.has(t))return!0;e.add(t);for(const r of Eu(t))if(Lu(r)){if(!r.rule.ref||Es(r.rule.ref)&&!gO(r.rule.ref,e)||tm(r.rule.ref))return!1}else{if(Au(r))return!1;if(Qh(r))return!1}return!!t.definition}A(gO,"isDataTypeRuleInternal");function Loe(t){return W5(t.type,new Set)}A(Loe,"isDataType");function W5(t,e){if(e.has(t))return!0;if(e.add(t),S9(t))return!1;if(N9(t))return!1;if(F9(t))return t.types.every(r=>W5(r,e));if(w5(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return k5(r)?W5(r.type,e):!1}else return!1}else return!1}A(W5,"isDataTypeInternal");function GT(t){if(!Wo(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}A(GT,"getExplicitRuleType");function np(t){if(Gf(t))return Es(t)&&zT(t)?t.name:GT(t)??t.name;if(L9(t)||k5(t)||$9(t))return t.name;if(Qh(t)){const e=mO(t);if(e)return e}else if(NT(t))return t.name;throw new Error("Cannot get name of Unknown Type")}A(np,"getTypeName");function mO(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return np(t.type.ref)}A(mO,"getActionType");function Ioe(t){var e;return Wo(t)?((e=t.type)==null?void 0:e.name)??"string":Es(t)&&zT(t)?t.name:GT(t)??t.name}A(Ioe,"getRuleTypeName");function yO(t){var e;return Wo(t)?((e=t.type)==null?void 0:e.name)??"string":GT(t)??t.name}A(yO,"getRuleType");function WT(t){const e={s:!1,i:!1,u:!1},r=ip(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}A(WT,"terminalRegex");var vO=/[\s\S]/.source;function ip(t,e){var r;if(P9(t))return Moe(t);if(B9(t))return Doe(t);if(E9(t))return $oe(t);if(S5(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return xc(ip(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(I9(t))return Ooe(t);if(z9(t))return Noe(t);if(O9(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),xc(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(G9(t))return xc(vO,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}A(ip,"abstractElementToRegex");function Moe(t){return xc(t.elements.map(e=>ip(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Moe,"terminalAlternativesToRegex");function Doe(t){return xc(t.elements.map(e=>ip(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Doe,"terminalGroupToRegex");function Noe(t){return xc(`${vO}*?${ip(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Noe,"untilTokenToRegex");function Ooe(t){return xc(`(?!${ip(t.terminal)})${vO}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Ooe,"negateTokenToRegex");function $oe(t){return t.right?xc(`[${q5(t.left)}-${q5(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):xc(q5(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A($oe,"characterRangeToRegex");function q5(t){return hm(t.value)}A(q5,"keywordToRegex");function xc(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}A(xc,"withCardinality");function bO(t){const e=[],r=t.Grammar;for(const n of r.rules)Wo(n)&&cO(n)&&rO(WT(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:H9}}A(bO,"createGrammarConfig");var kQe=typeof global=="object"&&global&&global.Object===Object&&global,Poe=kQe,EQe=typeof self=="object"&&self&&self.Object===Object&&self,AQe=Poe||EQe||Function("return this")(),Tc=AQe,_Qe=Tc.Symbol,qo=_Qe,Boe=Object.prototype,RQe=Boe.hasOwnProperty,LQe=Boe.toString,qT=qo?qo.toStringTag:void 0;function Foe(t){var e=RQe.call(t,qT),r=t[qT];try{t[qT]=void 0;var n=!0}catch{}var i=LQe.call(t);return n&&(e?t[qT]=r:delete t[qT]),i}A(Foe,"getRawTag");var IQe=Foe,MQe=Object.prototype,DQe=MQe.toString;function zoe(t){return DQe.call(t)}A(zoe,"objectToString");var NQe=zoe,OQe="[object Null]",$Qe="[object Undefined]",Goe=qo?qo.toStringTag:void 0;function Woe(t){return t==null?t===void 0?$Qe:OQe:Goe&&Goe in Object(t)?IQe(t):NQe(t)}A(Woe,"baseGetTag");var id=Woe;function qoe(t){return t!=null&&typeof t=="object"}A(qoe,"isObjectLike");var Tl=qoe,PQe="[object Symbol]";function Voe(t){return typeof t=="symbol"||Tl(t)&&id(t)==PQe}A(Voe,"isSymbol");var V5=Voe;function Uoe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=bJe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}A(ple,"shortOut");var wJe=ple;function gle(t){return function(){return t}}A(gle,"constant");var CJe=gle,SJe=(function(){try{var t=sp(Object,"defineProperty");return t({},"",{}),t}catch{}})(),U5=SJe,kJe=U5?function(t,e){return U5(t,"toString",{configurable:!0,enumerable:!1,value:CJe(e),writable:!0})}:HT,EJe=kJe,AJe=wJe(EJe),_Je=AJe;function mle(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}A(Cle,"arrayIncludes");var Sle=Cle,IJe=9007199254740991,MJe=/^(?:0|[1-9]\d*)$/;function kle(t,e){var r=typeof t;return e=e??IJe,!!e&&(r=="number"||r!="symbol"&&MJe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=$Je}A(Dle,"isLength");var EO=Dle;function Nle(t){return t!=null&&EO(t.length)&&!Mu(t)}A(Nle,"isArrayLike");var wc=Nle;function Ole(t,e,r){if(!Vo(r))return!1;var n=typeof e;return(n=="number"?wc(r)&&H5(e,r.length):n=="string"&&e in r)?YT(r[e],t):!1}A(Ole,"isIterateeCall");var X5=Ole;function $le(t){return kO(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&X5(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}A(yce,"listCacheHas");var rtt=yce;function vce(t,e){var r=this.__data__,n=Z5(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(vce,"listCacheSet");var ntt=vce;function lp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?MO(o,e-1,r,n,i):IO(i,o):n||(i[i.length]=o)}return i}A(MO,"baseFlatten");var DO=MO;function Oce(t){var e=t==null?0:t.length;return e?DO(t,1):[]}A(Oce,"flatten");var wl=Oce,wtt=Jle(Object.getPrototypeOf,Object),$ce=wtt;function Pce(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&dnt?new zO:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&X5(e[0],e[1],i)&&(n=1);++r=ait&&(a=GO,s=!1,e=new zO(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}A($he,"createFind");var hit=$he,dit=Math.max;function Phe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:UT(r);return i<0&&(i=dit(n+i,0)),ble(t,Cc(e),i)}A(Phe,"findIndex");var fit=Phe,pit=hit(fit),pm=pit;function Bhe(t){return t&&t.length?t[0]:void 0}A(Bhe,"head");var Sl=Bhe;function Fhe(t,e){var r=-1,n=wc(t)?Array(t.length):[];return dp(t,function(i,a,s){n[++r]=e(i,a,s)}),n}A(Fhe,"baseMap");var git=Fhe;function zhe(t,e){var r=yn(t)?VT:git;return r(t,Cc(e))}A(zhe,"map");var yr=zhe;function Ghe(t,e){return DO(yr(t,e),1)}A(Ghe,"flatMap");var Ho=Ghe,mit=Object.prototype,yit=mit.hasOwnProperty,vit=rit(function(t,e,r){yit.call(t,r)?t[r].push(e):SO(t,r,[e])}),bit=vit,xit=Object.prototype,Tit=xit.hasOwnProperty;function Whe(t,e){return t!=null&&Tit.call(t,e)}A(Whe,"baseHas");var wit=Whe;function qhe(t,e){return t!=null&&she(t,e,wit)}A(qhe,"has");var Ar=qhe,Cit="[object String]";function Vhe(t){return typeof t=="string"||!yn(t)&&Tl(t)&&id(t)==Cit}A(Vhe,"isString");var js=Vhe;function Uhe(t,e){return VT(e,function(r){return t[r]})}A(Uhe,"baseValues");var Sit=Uhe;function Hhe(t){return t==null?[]:Sit(t,xo(t))}A(Hhe,"values");var aa=Hhe,kit=Math.max;function Yhe(t,e,r,n){t=wc(t)?t:aa(t),r=r&&!n?UT(r):0;var i=t.length;return r<0&&(r=kit(i+r,0)),js(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&CO(t,e,r)>-1}A(Yhe,"includes");var As=Yhe,Eit=Math.max;function Xhe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:UT(r);return i<0&&(i=Eit(n+i,0)),CO(t,e,i)}A(Xhe,"indexOf");var jhe=Xhe,Ait="[object Map]",_it="[object Set]",Rit=Object.prototype,Lit=Rit.hasOwnProperty;function Khe(t){if(t==null)return!0;if(wc(t)&&(yn(t)||typeof t=="string"||typeof t.splice=="function"||KT(t)||_O(t)||j5(t)))return!t.length;var e=fm(t);if(e==Ait||e==_it)return!t.size;if(jT(t))return!tce(t).length;for(var r in t)if(Lit.call(t,r))return!1;return!0}A(Khe,"isEmpty");var jn=Khe,Iit="[object RegExp]";function Zhe(t){return Tl(t)&&id(t)==Iit}A(Zhe,"baseIsRegExp");var Mit=Zhe,Qhe=ad&&ad.isRegExp,Dit=Qhe?ZT(Qhe):Mit,Du=Dit;function Jhe(t){return t===void 0}A(Jhe,"isUndefined");var Nu=Jhe,Nit="Expected a function";function ede(t){if(typeof t!="function")throw new TypeError(Nit);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}A(ede,"negate");var Oit=ede;function tde(t,e,r,n){if(!Vo(t))return t;e=r3(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=qit){var u=e?null:Wit(t);if(u)return WO(u);s=!1,i=GO,l=new zO}else l=e?[]:o;e:for(;++n{r.accept(e)})}},A(F1,"AbstractProduction"),F1),_s=(z1=class extends Sc{constructor(e){super([]),this.idx=1,To(this,kl(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},A(z1,"NonTerminal"),z1),gm=(G1=class extends Sc{constructor(e){super(e.definition),this.orgText="",To(this,kl(e,r=>r!==void 0))}},A(G1,"Rule"),G1),Ks=(W1=class extends Sc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,To(this,kl(e,r=>r!==void 0))}},A(W1,"Alternative"),W1),Fa=(q1=class extends Sc{constructor(e){super(e.definition),this.idx=1,To(this,kl(e,r=>r!==void 0))}},A(q1,"Option"),q1),Co=(V1=class extends Sc{constructor(e){super(e.definition),this.idx=1,To(this,kl(e,r=>r!==void 0))}},A(V1,"RepetitionMandatory"),V1),So=(U1=class extends Sc{constructor(e){super(e.definition),this.idx=1,To(this,kl(e,r=>r!==void 0))}},A(U1,"RepetitionMandatoryWithSeparator"),U1),ki=(H1=class extends Sc{constructor(e){super(e.definition),this.idx=1,To(this,kl(e,r=>r!==void 0))}},A(H1,"Repetition"),H1),Zs=(Y1=class extends Sc{constructor(e){super(e.definition),this.idx=1,To(this,kl(e,r=>r!==void 0))}},A(Y1,"RepetitionWithSeparator"),Y1),Qs=(X1=class extends Sc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,To(this,kl(e,r=>r!==void 0))}},A(X1,"Alternation"),X1),si=(j1=class{constructor(e){this.idx=1,To(this,kl(e,r=>r!==void 0))}accept(e){e.visit(this)}},A(j1,"Terminal"),j1);function pde(t){return yr(t,ow)}A(pde,"serializeGrammar");function ow(t){function e(r){return yr(r,ow)}if(A(e,"convertDefinition"),t instanceof _s){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return js(t.label)&&(r.label=t.label),r}else{if(t instanceof Ks)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Fa)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Co)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof So)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ow(new si({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Zs)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ow(new si({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ki)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Qs)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof si){const r={type:"Terminal",name:t.terminalType.name,label:dde(t.terminalType),idx:t.idx};js(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Du(n)?n.source:n),r}else{if(t instanceof gm)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}A(ow,"serializeProduction");var mm=(K1=class{visit(e){const r=e;switch(r.constructor){case _s:return this.visitNonTerminal(r);case Ks:return this.visitAlternative(r);case Fa:return this.visitOption(r);case Co:return this.visitRepetitionMandatory(r);case So:return this.visitRepetitionMandatoryWithSeparator(r);case Zs:return this.visitRepetitionWithSeparator(r);case ki:return this.visitRepetition(r);case Qs:return this.visitAlternation(r);case si:return this.visitTerminal(r);case gm:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},A(K1,"GAstVisitor"),K1);function gde(t){return t instanceof Ks||t instanceof Fa||t instanceof ki||t instanceof Co||t instanceof So||t instanceof Zs||t instanceof si||t instanceof gm}A(gde,"isSequenceProd");function lw(t,e=[]){return t instanceof Fa||t instanceof ki||t instanceof Zs?!0:t instanceof Qs?cde(t.definition,n=>lw(n,e)):t instanceof _s&&As(e,t)?!1:t instanceof Sc?(t instanceof _s&&e.push(t),Cl(t.definition,n=>lw(n,e))):!1}A(lw,"isOptionalProd");function mde(t){return t instanceof Qs}A(mde,"isBranchingProd");function El(t){if(t instanceof _s)return"SUBRULE";if(t instanceof Fa)return"OPTION";if(t instanceof Qs)return"OR";if(t instanceof Co)return"AT_LEAST_ONE";if(t instanceof So)return"AT_LEAST_ONE_SEP";if(t instanceof Zs)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof si)return"CONSUME";throw Error("non exhaustive match")}A(El,"getProductionDslName");var l3=(Z1=class{walk(e,r=[]){Dr(e.definition,(n,i)=>{const a=Ba(e.definition,i+1);if(n instanceof _s)this.walkProdRef(n,a,r);else if(n instanceof si)this.walkTerminal(n,a,r);else if(n instanceof Ks)this.walkFlat(n,a,r);else if(n instanceof Fa)this.walkOption(n,a,r);else if(n instanceof Co)this.walkAtLeastOne(n,a,r);else if(n instanceof So)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Zs)this.walkManySep(n,a,r);else if(n instanceof ki)this.walkMany(n,a,r);else if(n instanceof Qs)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Fa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=KO(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Fa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=KO(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Dr(e.definition,a=>{const s=new Ks({definition:[a]});this.walk(s,i)})}},A(Z1,"RestWalker"),Z1);function KO(t,e,r){return[new Fa({definition:[new si({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}A(KO,"restForRepetitionWithSeparator");function ym(t){if(t instanceof _s)return ym(t.referencedRule);if(t instanceof si)return bde(t);if(gde(t))return yde(t);if(mde(t))return vde(t);throw Error("non exhaustive match")}A(ym,"first");function yde(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=lw(a),e=e.concat(ym(a)),n=n+1,i=r.length>n;return HO(e)}A(yde,"firstForSequence");function vde(t){const e=yr(t.definition,r=>ym(r));return HO(wl(e))}A(vde,"firstForBranching");function bde(t){return[t.terminalType]}A(bde,"firstForTerminal");var xde="_~IN~_",Uit=(Q1=class extends l3{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=wde(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ks({definition:a}),o=ym(s);this.follows[i]=o}},A(Q1,"ResyncFollowsWalker"),Q1);function Tde(t){const e={};return Dr(t,r=>{const n=new Uit(r).startWalking();To(e,n)}),e}A(Tde,"computeAllProdsFollows");function wde(t,e){return t.name+e+xde}A(wde,"buildBetweenProdsFollowPrefix");var c3={},Hit=new xoe;function cw(t){const e=t.toString();if(c3.hasOwnProperty(e))return c3[e];{const r=Hit.pattern(e);return c3[e]=r,r}}A(cw,"getRegExpAst");function Cde(){c3={}}A(Cde,"clearRegExpParserCache");var Sde="Complement Sets are not supported for first char optimization",u3=`Unable to use "first char" lexer optimizations: +`;function kde(t,e=!1){try{const r=cw(t);return h3(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Sde)e&&YO(`${u3} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),zk(`${Vk} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),o3(`${u3} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}E(Ooe,"getOptimizedStartCodesIndices");function Wk(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")fT(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)fT(h,e,r);else{for(let h=u.from;h<=u.to&&h=gT){const h=u.from>=gT?u.from:gT,d=u.to,f=tu(h),p=tu(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Wk(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Uk(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return zi(e)}E(Wk,"firstCharOptimizedIndices");function fT(t,e,r){const n=tu(t);e[n]=n,r===!0&&$oe(t,e)}E(fT,"addOptimizedIdxToResult");function $oe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=tu(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=tu(i.charCodeAt(0));e[a]=a}}}E($oe,"handleIgnoreCase");function vM(t,e){return Cg(t.value,r=>{if(typeof r=="number")return is(e,r);{const n=r;return Cg(e,i=>n.from<=i&&i<=n.to)!==void 0}})}E(vM,"findCode");function Uk(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Qr(t.value)?Yo(t.value,Uk):Uk(t.value):!1}E(Uk,"isWholeOptional");var VQe=(i1=class extends pk{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){is(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?vM(e,this.targetCharCodes)===void 0&&(this.found=!0):vM(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},E(i1,"CharCodeFinder"),i1);function Hk(t,e){if(e instanceof RegExp){const r=dT(e),n=new VQe(t);return n.visit(r),n.found}else return Cg(e,r=>is(t,r.charCodeAt(0)))!==void 0}E(Hk,"canMatchCharCode");var Sf="PATTERN",pT="defaultMode",Yk="modes";function Poe(t,e){e=dM(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:E((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{ile()});let n;r("Reject Lexer.NA",()=>{n=Fk(t,x=>x[Sf]===ss.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ur(n,x=>{const b=x[Sf];if(Jc(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!is(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:bM(b)}else{if(Qc(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(w);return bM(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ur(n,x=>x.tokenTypeIdx),o=ur(n,x=>{const b=x.GROUP;if(b!==ss.SKIPPED){if(Es(b))return b;if(eu(b))return!1;throw Error("non exhaustive match")}}),l=ur(n,x=>{const b=x.LONGER_ALT;if(b)return Qr(b)?ur(b,k=>aoe(n,k)):[aoe(n,b)]}),u=ur(n,x=>x.PUSH_MODE),h=ur(n,x=>br(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=wM(e.lineTerminatorCharacters);d=ur(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ur(n,b=>br(b,"LINE_BREAKS")?!!b.LINE_BREAKS:TM(b,x)===!1&&Hk(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ur(n,xM),p=ur(a,rle),g=js(n,(x,b)=>{const w=b.GROUP;return Es(w)&&w!==ss.SKIPPED&&(x[w]=[]),x},{}),m=ur(a,(x,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=js(n,(x,b,w)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),S=tu(k);Xk(x,S,m[w])}else if(Qr(b.START_CHARS_HINT)){let k;Er(b.START_CHARS_HINT,S=>{const C=typeof S=="string"?S.charCodeAt(0):S,_=tu(C);k!==_&&(k=_,Xk(x,_,m[w]))})}else if(Jc(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&zk(`${Vk} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}A(kde,"getOptimizedStartCodesIndices");function h3(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")uw(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)uw(h,e,r);else{for(let h=u.from;h<=u.to&&h=dw){const h=u.from>=dw?u.from:dw,d=u.to,f=Ou(h),p=Ou(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":h3(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&d3(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return aa(e)}A(h3,"firstCharOptimizedIndices");function uw(t,e,r){const n=Ou(t);e[n]=n,r===!0&&Ede(t,e)}A(uw,"addOptimizedIdxToResult");function Ede(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Ou(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Ou(i.charCodeAt(0));e[a]=a}}}A(Ede,"handleIgnoreCase");function ZO(t,e){return pm(t.value,r=>{if(typeof r=="number")return As(e,r);{const n=r;return pm(e,i=>n.from<=i&&i<=n.to)!==void 0}})}A(ZO,"findCode");function d3(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?yn(t.value)?Cl(t.value,d3):d3(t.value):!1}A(d3,"isWholeOptional");var Yit=(J1=class extends O5{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){As(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?ZO(e,this.targetCharCodes)===void 0&&(this.found=!0):ZO(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},A(J1,"CharCodeFinder"),J1);function f3(t,e){if(e instanceof RegExp){const r=cw(e),n=new Yit(t);return n.visit(r),n.found}else return pm(e,r=>As(t,r.charCodeAt(0)))!==void 0}A(f3,"canMatchCharCode");var pp="PATTERN",hw="defaultMode",p3="modes";function Ade(t,e){e=UO(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:A((T,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Xde()});let n;r("Reject Lexer.NA",()=>{n=s3(t,T=>T[pp]===Rs.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=yr(n,T=>{const x=T[pp];if(Du(x)){const w=x.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!x.ignoreCase?w:w.length===2&&w[0]==="\\"&&!As(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:QO(x)}else{if(Mu(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{const w=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(w);return QO(C)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=yr(n,T=>T.tokenTypeIdx),o=yr(n,T=>{const x=T.GROUP;if(x!==Rs.SKIPPED){if(js(x))return x;if(Nu(x))return!1;throw Error("non exhaustive match")}}),l=yr(n,T=>{const x=T.LONGER_ALT;if(x)return yn(x)?yr(x,C=>jhe(n,C)):[jhe(n,x)]}),u=yr(n,T=>T.PUSH_MODE),h=yr(n,T=>Ar(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=t$(e.lineTerminatorCharacters);d=yr(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=yr(n,x=>Ar(x,"LINE_BREAKS")?!!x.LINE_BREAKS:e$(x,T)===!1&&f3(T,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=yr(n,JO),p=yr(a,Hde),g=wo(n,(T,x)=>{const w=x.GROUP;return js(w)&&w!==Rs.SKIPPED&&(T[w]=[]),T},{}),m=yr(a,(T,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:o[x],push:u[x],pop:h[x],tokenTypeIdx:s[x],tokenType:n[x]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=wo(n,(T,x,w)=>{if(typeof x.PATTERN=="string"){const C=x.PATTERN.charCodeAt(0),k=Ou(C);g3(T,k,m[w])}else if(yn(x.START_CHARS_HINT)){let C;Dr(x.START_CHARS_HINT,k=>{const S=typeof k=="string"?k.charCodeAt(0):k,E=Ou(S);C!==E&&(C=E,g3(T,E,m[w]))})}else if(Du(x.PATTERN))if(x.PATTERN.unicode)y=!1,e.ensureOptimizations&&o3(`${u3} Unable to analyze < ${x.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const k=Ooe(b.PATTERN,e.ensureOptimizations);_n(k)&&(y=!1),Er(k,S=>{Xk(x,S,m[w])})}else e.ensureOptimizations&&zk(`${Vk} TokenType: <${b.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=kde(x.PATTERN,e.ensureOptimizations);jn(C)&&(y=!1),Dr(C,k=>{g3(T,k,m[w])})}else e.ensureOptimizations&&o3(`${u3} TokenType: <${x.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}E(Poe,"analyzeTokenTypes");function Boe(t,e){let r=[];const n=zoe(t);r=r.concat(n.errors);const i=Goe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Foe(a)),r=r.concat(Yoe(a)),r=r.concat(Xoe(a,e)),r=r.concat(Koe(a)),r}E(Boe,"validatePatterns");function Foe(t){let e=[];const r=bo(t,n=>Jc(n[Sf]));return e=e.concat(qoe(r)),e=e.concat(Woe(r)),e=e.concat(Uoe(r)),e=e.concat(Hoe(r)),e=e.concat(Voe(r)),e}E(Foe,"validateRegExpPattern");function zoe(t){const e=bo(t,i=>!br(i,Sf)),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:si.MISSING_PATTERN,tokenTypes:[i]})),n=Bk(t,e);return{errors:r,valid:n}}E(zoe,"findMissingPatterns");function Goe(t){const e=bo(t,i=>{const a=i[Sf];return!Jc(a)&&!Qc(a)&&!br(a,"exec")&&!Es(a)}),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:si.INVALID_PATTERN,tokenTypes:[i]})),n=Bk(t,e);return{errors:r,valid:n}}E(Goe,"findInvalidPatterns");var WQe=/[^\\][$]/;function qoe(t){const i=class i extends pk{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};E(i,"EndAnchorFinder");let e=i;const r=bo(t,a=>{const s=a.PATTERN;try{const o=dT(s),l=new e;return l.visit(o),l.found}catch{return WQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}A(Ade,"analyzeTokenTypes");function _de(t,e){let r=[];const n=Lde(t);r=r.concat(n.errors);const i=Ide(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Rde(a)),r=r.concat(Pde(a)),r=r.concat(Bde(a,e)),r=r.concat(Fde(a)),r}A(_de,"validatePatterns");function Rde(t){let e=[];const r=Uo(t,n=>Du(n[pp]));return e=e.concat(Mde(r)),e=e.concat(Nde(r)),e=e.concat(Ode(r)),e=e.concat($de(r)),e=e.concat(Dde(r)),e}A(Rde,"validateRegExpPattern");function Lde(t){const e=Uo(t,i=>!Ar(i,pp)),r=yr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ei.MISSING_PATTERN,tokenTypes:[i]})),n=a3(t,e);return{errors:r,valid:n}}A(Lde,"findMissingPatterns");function Ide(t){const e=Uo(t,i=>{const a=i[pp];return!Du(a)&&!Mu(a)&&!Ar(a,"exec")&&!js(a)}),r=yr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ei.INVALID_PATTERN,tokenTypes:[i]})),n=a3(t,e);return{errors:r,valid:n}}A(Ide,"findInvalidPatterns");var Xit=/[^\\][$]/;function Mde(t){const i=class i extends O5{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};A(i,"EndAnchorFinder");let e=i;const r=Uo(t,a=>{const s=a.PATTERN;try{const o=cw(s),l=new e;return l.visit(o),l.found}catch{return Xit.test(s.source)}});return yr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(qoe,"findEndOfInputAnchor");function Voe(t){const e=bo(t,n=>n.PATTERN.test(""));return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}E(Voe,"findEmptyMatchRegExps");var UQe=/[^\\[][\^]|^\^/;function Woe(t){const i=class i extends pk{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};E(i,"StartAnchorFinder");let e=i;const r=bo(t,a=>{const s=a.PATTERN;try{const o=dT(s),l=new e;return l.visit(o),l.found}catch{return UQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ei.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(Mde,"findEndOfInputAnchor");function Dde(t){const e=Uo(t,n=>n.PATTERN.test(""));return yr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ei.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}A(Dde,"findEmptyMatchRegExps");var jit=/[^\\[][\^]|^\^/;function Nde(t){const i=class i extends O5{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};A(i,"StartAnchorFinder");let e=i;const r=Uo(t,a=>{const s=a.PATTERN;try{const o=cw(s),l=new e;return l.visit(o),l.found}catch{return jit.test(s.source)}});return yr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Woe,"findStartOfInputAnchor");function Uoe(t){const e=bo(t,n=>{const i=n[Sf];return i instanceof RegExp&&(i.multiline||i.global)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}E(Uoe,"findUnsupportedFlags");function Hoe(t){const e=[];let r=ur(t,a=>js(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!is(e,o)&&o.PATTERN!==ss.NA&&(e.push(o),s.push(o)),s),[]));r=oT(r);const n=bo(r,a=>a.length>1);return ur(n,a=>{const s=ur(a,l=>l.name);return{message:`The same RegExp pattern ->${Xo(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}E(Hoe,"findDuplicatePatterns");function Yoe(t){const e=bo(t,n=>{if(!br(n,"GROUP"))return!1;const i=n.GROUP;return i!==ss.SKIPPED&&i!==ss.NA&&!Es(i)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}E(Yoe,"findInvalidGroupType");function Xoe(t,e){const r=bo(t,i=>i.PUSH_MODE!==void 0&&!is(e,i.PUSH_MODE));return ur(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}E(Xoe,"findModesThatDoNotExist");function Koe(t){const e=[],r=js(t,(n,i,a)=>{const s=i.PATTERN;return s===ss.NA||(Es(s)?n.push({str:s,idx:a,tokenType:i}):Jc(s)&&Zoe(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Er(t,(n,i)=>{Er(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ei.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(Nde,"findStartOfInputAnchor");function Ode(t){const e=Uo(t,n=>{const i=n[pp];return i instanceof RegExp&&(i.multiline||i.global)});return yr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ei.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}A(Ode,"findUnsupportedFlags");function $de(t){const e=[];let r=yr(t,a=>wo(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!As(e,o)&&o.PATTERN!==Rs.NA&&(e.push(o),s.push(o)),s),[]));r=iw(r);const n=Uo(r,a=>a.length>1);return yr(n,a=>{const s=yr(a,l=>l.name);return{message:`The same RegExp pattern ->${Sl(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Ei.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}A($de,"findDuplicatePatterns");function Pde(t){const e=Uo(t,n=>{if(!Ar(n,"GROUP"))return!1;const i=n.GROUP;return i!==Rs.SKIPPED&&i!==Rs.NA&&!js(i)});return yr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ei.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}A(Pde,"findInvalidGroupType");function Bde(t,e){const r=Uo(t,i=>i.PUSH_MODE!==void 0&&!As(e,i.PUSH_MODE));return yr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ei.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}A(Bde,"findModesThatDoNotExist");function Fde(t){const e=[],r=wo(t,(n,i,a)=>{const s=i.PATTERN;return s===Rs.NA||(js(s)?n.push({str:s,idx:a,tokenType:i}):Du(s)&&Gde(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Dr(t,(n,i)=>{Dr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}E(Koe,"findUnreachablePatterns");function joe(t,e){if(Jc(e)){if(Qoe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Qc(e))return e(t,0,[],{});if(br(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}E(joe,"tryToMatchStrToPattern");function Zoe(t){return Cg([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}E(Zoe,"noMetaChar");function Qoe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),br(t,Yk)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Yk+`> property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),br(t,Yk)&&br(t,pT)&&!br(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${pT}: <${t.defaultMode}>which does not exist -`,type:si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),br(t,Yk)&&Er(t.modes,(i,a)=>{Er(i,(s,o)=>{if(eu(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> -`,type:si.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(br(s,"LONGER_ALT")){const l=Qr(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Er(l,u=>{!eu(u)&&!is(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> -`,type:si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E(Joe,"performRuntimeChecks");function ele(t,e,r){const n=[];let i=!1;const a=oT(Ho(zi(t.modes))),s=Fk(a,l=>l[Sf]===ss.NA),o=wM(r);return e&&Er(s,l=>{const u=TM(l,o);if(u!==!1){const d={message:nle(l,u),type:u.issue,tokenType:l};n.push(d)}else br(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Hk(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Ei.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}A(Fde,"findUnreachablePatterns");function zde(t,e){if(Du(e)){if(Wde(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Mu(e))return e(t,0,[],{});if(Ar(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}A(zde,"tryToMatchStrToPattern");function Gde(t){return pm([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}A(Gde,"noMetaChar");function Wde(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Ei.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Ar(t,p3)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+p3+`> property in its definition +`,type:Ei.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Ar(t,p3)&&Ar(t,hw)&&!Ar(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${hw}: <${t.defaultMode}>which does not exist +`,type:Ei.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Ar(t,p3)&&Dr(t.modes,(i,a)=>{Dr(i,(s,o)=>{if(Nu(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> +`,type:Ei.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Ar(s,"LONGER_ALT")){const l=yn(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Dr(l,u=>{!Nu(u)&&!As(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> +`,type:Ei.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}A(qde,"performRuntimeChecks");function Vde(t,e,r){const n=[];let i=!1;const a=iw(wl(aa(t.modes))),s=s3(a,l=>l[pp]===Rs.NA),o=t$(r);return e&&Dr(s,l=>{const u=e$(l,o);if(u!==!1){const d={message:Yde(l,u),type:u.issue,tokenType:l};n.push(d)}else Ar(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):f3(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:si.NO_LINE_BREAKS_FLAGS}),n}E(ele,"performWarningRuntimeChecks");function tle(t){const e={},r=Xs(t);return Er(r,n=>{const i=t[n];if(Qr(i))e[n]=[];else throw Error("non exhaustive match")}),e}E(tle,"cloneEmptyGroups");function xM(t){const e=t.PATTERN;if(Jc(e))return!1;if(Qc(e))return!0;if(br(e,"exec"))return!0;if(Es(e))return!1;throw Error("non exhaustive match")}E(xM,"isCustomPattern");function rle(t){return Es(t)&&t.length===1?t.charCodeAt(0):!1}E(rle,"isShortPattern");var HQe={test:E(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(yn(i))e[n]=[];else throw Error("non exhaustive match")}),e}A(Ude,"cloneEmptyGroups");function JO(t){const e=t.PATTERN;if(Du(e))return!1;if(Mu(e))return!0;if(Ar(e,"exec"))return!0;if(js(e))return!1;throw Error("non exhaustive match")}A(JO,"isCustomPattern");function Hde(t){return js(t)&&t.length===1?t.charCodeAt(0):!1}A(Hde,"isShortPattern");var Kit={test:A(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===si.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Ei.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}E(nle,"buildLineBreakIssueMessage");function wM(t){return ur(t,r=>Es(r)?r.charCodeAt(0):r)}E(wM,"getCharCodes");function Xk(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}E(Xk,"addToMapOfArrays");var gT=256,Kk=[];function tu(t){return t255?255+~~(t/255):t}}E(ile,"initCharCodeToOptimizedIndexMap");function Ag(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}E(Ag,"tokenStructuredMatcher");function mT(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}E(mT,"tokenStructuredMatcherNoCategories");var ale=1,sle={};function _g(t){const e=ole(t);lle(e),ule(e),cle(e),Er(e,r=>{r.isParent=r.categoryMatches.length>0})}E(_g,"augmentTokenTypes");function ole(t){let e=ga(t),r=t,n=!0;for(;n;){r=oT(Ho(ur(r,a=>a.CATEGORIES)));const i=Bk(r,e);e=e.concat(i),_n(i)?n=!1:r=i}return e}E(ole,"expandCategories");function lle(t){Er(t,e=>{kM(e)||(sle[ale]=e,e.tokenTypeIdx=ale++),EM(e)&&!Qr(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),EM(e)||(e.CATEGORIES=[]),hle(e)||(e.categoryMatches=[]),dle(e)||(e.categoryMatchesMap={})})}E(lle,"assignTokenDefaultProps");function cle(t){Er(t,e=>{e.categoryMatches=[],Er(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(sle[n].tokenTypeIdx)})})}E(cle,"assignCategoriesTokensProp");function ule(t){Er(t,e=>{CM([],e)})}E(ule,"assignCategoriesMapProp");function CM(t,e){Er(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Er(e.CATEGORIES,r=>{const n=t.concat(e);is(n,r)||CM(n,r)})}E(CM,"singleAssignCategoriesToksMap");function kM(t){return br(t,"tokenTypeIdx")}E(kM,"hasShortKeyProperty");function EM(t){return br(t,"CATEGORIES")}E(EM,"hasCategoriesProperty");function hle(t){return br(t,"categoryMatches")}E(hle,"hasExtendingTokensTypesProperty");function dle(t){return br(t,"categoryMatchesMap")}E(dle,"hasExtendingTokensTypesMapProperty");function fle(t){return br(t,"tokenTypeIdx")}E(fle,"isTokenType");var SM={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(si||(si={}));var yT={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:SM,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(yT);var ss=(a1=class{constructor(e,r=yT){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=gM(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=Ks({},yT,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===yT.lineTerminatorsPattern)this.config.lineTerminatorsPattern=HQe;else if(this.config.lineTerminatorCharacters===yT.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Qr(e)?i={modes:{defaultMode:ga(e)},defaultMode:pT}:(a=!1,i=ga(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Joe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ele(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Er(i.modes,(o,l)=>{i.modes[l]=Fk(o,u=>eu(u))});const s=Xs(i.modes);if(Er(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Boe(o,s))}),_n(this.lexerDefinitionErrors)){_g(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Poe(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Ks({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!_n(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ur(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}A(Yde,"buildLineBreakIssueMessage");function t$(t){return yr(t,r=>js(r)?r.charCodeAt(0):r)}A(t$,"getCharCodes");function g3(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}A(g3,"addToMapOfArrays");var dw=256,m3=[];function Ou(t){return t255?255+~~(t/255):t}}A(Xde,"initCharCodeToOptimizedIndexMap");function vm(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}A(vm,"tokenStructuredMatcher");function fw(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}A(fw,"tokenStructuredMatcherNoCategories");var jde=1,Kde={};function bm(t){const e=Zde(t);Qde(e),efe(e),Jde(e),Dr(e,r=>{r.isParent=r.categoryMatches.length>0})}A(bm,"augmentTokenTypes");function Zde(t){let e=Pa(t),r=t,n=!0;for(;n;){r=iw(wl(yr(r,a=>a.CATEGORIES)));const i=a3(r,e);e=e.concat(i),jn(i)?n=!1:r=i}return e}A(Zde,"expandCategories");function Qde(t){Dr(t,e=>{n$(e)||(Kde[jde]=e,e.tokenTypeIdx=jde++),i$(e)&&!yn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),i$(e)||(e.CATEGORIES=[]),tfe(e)||(e.categoryMatches=[]),rfe(e)||(e.categoryMatchesMap={})})}A(Qde,"assignTokenDefaultProps");function Jde(t){Dr(t,e=>{e.categoryMatches=[],Dr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Kde[n].tokenTypeIdx)})})}A(Jde,"assignCategoriesTokensProp");function efe(t){Dr(t,e=>{r$([],e)})}A(efe,"assignCategoriesMapProp");function r$(t,e){Dr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Dr(e.CATEGORIES,r=>{const n=t.concat(e);As(n,r)||r$(n,r)})}A(r$,"singleAssignCategoriesToksMap");function n$(t){return Ar(t,"tokenTypeIdx")}A(n$,"hasShortKeyProperty");function i$(t){return Ar(t,"CATEGORIES")}A(i$,"hasCategoriesProperty");function tfe(t){return Ar(t,"categoryMatches")}A(tfe,"hasExtendingTokensTypesProperty");function rfe(t){return Ar(t,"categoryMatchesMap")}A(rfe,"hasExtendingTokensTypesMapProperty");function nfe(t){return Ar(t,"tokenTypeIdx")}A(nfe,"isTokenType");var a$={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Ei;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ei||(Ei={}));var pw={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:a$,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(pw);var Rs=(ey=class{constructor(e,r=pw){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=XO(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=To({},pw,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===pw.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Kit;else if(this.config.lineTerminatorCharacters===pw.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),yn(e)?i={modes:{defaultMode:Pa(e)},defaultMode:hw}:(a=!1,i=Pa(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(qde(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Vde(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Dr(i.modes,(o,l)=>{i.modes[l]=s3(o,u=>Nu(u))});const s=xo(i.modes);if(Dr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(_de(o,s))}),jn(this.lexerDefinitionErrors)){bm(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Ade(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=To({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!jn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=yr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}Er(this.lexerDefinitionWarning,o=>{pM(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Ji),this.trackStartLines===!1&&(this.computeNewColumn=Kx),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ji),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=js(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!_n(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}Dr(this.lexerDefinitionWarning,o=>{YO(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=xa),this.trackStartLines===!1&&(this.computeNewColumn=HT),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=xa),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=wo(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!jn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Moe()}),this.TRACE_INIT("toFastProperties",()=>{mM(this)})})}tokenize(e,r=this.defaultMode){if(!_n(this.lexerDefinitionErrors)){const i=ur(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Cde()}),this.TRACE_INIT("toFastProperties",()=>{jO(this)})})}tokenize(e,r=this.defaultMode){if(!jn(this.lexerDefinitionErrors)){const i=yr(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const x=e,b=x.length;let w=0,k=0;const S=this.hasCustom?0:Math.floor(e.length/10),C=new Array(S),_=[];let L=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const D=tle(this.emptyGroups),z=this.trackStartLines,F=this.config.lineTerminatorsPattern;let A=0,R=[],N=[];const M=[],I=[];Object.freeze(I);let $=!1;const P=E(X=>{if(M.length===1&&X.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(X);_.push({offset:X.startOffset,line:X.startLine,column:X.startColumn,length:X.image.length,message:W})}else{M.pop();const W=Ef(M);R=this.patternIdxToConfig[W],N=this.charCodeToPatternIdxToConfig[W],A=R.length;const ie=this.canModeBeOptimized[W]&&this.config.safeMode===!1;N&&ie?$=!0:$=!1}},"pop_mode");function B(X){M.push(X),N=this.charCodeToPatternIdxToConfig[X],R=this.patternIdxToConfig[X],A=R.length,A=R.length;const W=this.canModeBeOptimized[X]&&this.config.safeMode===!1;N&&W?$=!0:$=!1}E(B,"push_mode"),B.call(this,r);let q;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,q=Z;break}}}break}}if(d!==-1){if(f=q.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=q.tokenTypeIdx,g=this.createTokenInstance(l,w,p,q.tokenType,L,O,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):D[f].push(g)),z===!0&&q.canLineTerminator===!0){let K=0,se,te;F.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),se=F.test(l),se===!0&&(te=F.lastIndex-1,K++);while(se===!0);K!==0?(L=L+K,O=d-te,this.updateTokenEndLineColumnLocation(g,f,te,K,L,O,d)):O=this.computeNewColumn(O,d)}else O=this.computeNewColumn(O,d);w=w+d,this.handleModes(q,P,B,g)}else{const K=w,se=L,te=O;let Z=V===!1;for(;Z===!1&&w ${Af(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` -but found: '`+Xo(e).image+"'";if(n)return a+n+o;{const l=js(t,(f,p)=>f.concat(p),[]),u=ur(l,f=>`[${ur(f,p=>Af(p)).join(", ")}]`),d=`one of these possible Token sequences: -${ur(u,(f,p)=>` ${p+1}. ${f}`).join(` +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,x=T.length;let w=0,C=0;const k=this.hasCustom?0:Math.floor(e.length/10),S=new Array(k),E=[];let L=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const I=Ude(this.emptyGroups),P=this.trackStartLines,$=this.config.lineTerminatorsPattern;let _=0,R=[],O=[];const D=[],N=[];Object.freeze(N);let B=!1;const F=A(V=>{if(D.length===1&&V.tokenType.PUSH_MODE===void 0){const H=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(V);E.push({offset:V.startOffset,line:V.startLine,column:V.startColumn,length:V.image.length,message:H})}else{D.pop();const H=fp(D);R=this.patternIdxToConfig[H],O=this.charCodeToPatternIdxToConfig[H],_=R.length;const te=this.canModeBeOptimized[H]&&this.config.safeMode===!1;O&&te?B=!0:B=!1}},"pop_mode");function G(V){D.push(V),O=this.charCodeToPatternIdxToConfig[V],R=this.patternIdxToConfig[V],_=R.length,_=R.length;const H=this.canModeBeOptimized[V]&&this.config.safeMode===!1;O&&H?B=!0:B=!1}A(G,"push_mode"),G.call(this,r);let z;const W=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,z=Z;break}}}break}}if(d!==-1){if(f=z.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=z.tokenTypeIdx,g=this.createTokenInstance(l,w,p,z.tokenType,L,M,d),this.handlePayload(g,u),f===!1?C=this.addToken(S,C,g):I[f].push(g)),P===!0&&z.canLineTerminator===!0){let Y=0,se,J;$.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),se=$.test(l),se===!0&&(J=$.lastIndex-1,Y++);while(se===!0);Y!==0?(L=L+Y,M=d-J,this.updateTokenEndLineColumnLocation(g,f,J,Y,L,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);w=w+d,this.handleModes(z,F,G,g)}else{const Y=w,se=L,J=M;let Z=W===!1;for(;Z===!1&&w ${gp(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` +but found: '`+Sl(e).image+"'";if(n)return a+n+o;{const l=wo(t,(f,p)=>f.concat(p),[]),u=yr(l,f=>`[${yr(f,p=>gp(p)).join(", ")}]`),d=`one of these possible Token sequences: +${yr(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=` -but found: '`+Xo(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${ur(t,u=>`[${ur(u,h=>Af(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Lg);var XQe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+t.name+"<-"}},_f={buildDuplicateFoundError(t,e){function r(h){return h instanceof Bn?h.terminalType.name:h instanceof as?h.nonTerminalName:""}E(r,"getExtraProductionArgument");const n=t.name,i=Xo(e),a=i.idx,s=jo(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} +but found: '`+Sl(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${yr(t,u=>`[${yr(u,h=>gp(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Tm);var Qit={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},mp={buildDuplicateFoundError(t,e){function r(h){return h instanceof si?h.terminalType.name:h instanceof _s?h.nonTerminalName:""}A(r,"getExtraProductionArgument");const n=t.name,i=Sl(e),a=i.idx,s=El(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} appears more than once (${e.length} times) in the top level rule: ->${n}<-. For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` @@ -1266,63 +1272,63 @@ inside top level rule: ->`+t.name+"<-"}},_f={buildDuplicateFoundError(t,e){funct The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. To resolve this make sure each Terminal and Non-Terminal names are unique This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ur(t.prefixPath,i=>Af(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=yr(t.prefixPath,i=>gp(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. Only the last alternative may be empty. -`;else{const i=ur(t.prefixPath,a=>Af(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. +`;else{const i=yr(t.prefixPath,a=>gp(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n},buildEmptyRepetitionError(t){let e=jo(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. +For Further details.`,n},buildEmptyRepetitionError(t){let e=El(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: inside <${t.topLevelRule.name}> Rule. - has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=ur(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. + has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=yr(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof kg?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Cle(t,e){const r=new KQe(t,e);return r.resolveRefs(),r.errors}E(Cle,"resolveGrammar");var KQe=(s1=class extends Eg{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Er(zi(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:os.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},E(s1,"GastRefResolverVisitor"),s1),jQe=(o1=class extends Gk{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=ga(this.path.ruleStack).reverse(),this.occurrenceStack=ga(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){_n(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},E(o1,"AbstractNextPossibleTokensWalker"),o1),ZQe=(l1=class extends jQe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new Ss({definition:i});this.possibleTokTypes=Sg(a),this.found=!0}}},E(l1,"NextAfterTokenWalker"),l1),jk=(c1=class extends Gk{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},E(c1,"AbstractNextTerminalAfterProductionWalker"),c1),QQe=(u1=class extends jk{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Bn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},E(u1,"NextTerminalAfterManyWalker"),u1),kle=(h1=class extends jk{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Bn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},E(h1,"NextTerminalAfterManySepWalker"),h1),JQe=(d1=class extends jk{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Bn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},E(d1,"NextTerminalAfterAtLeastOneWalker"),d1),Ele=(f1=class extends jk{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Bn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},E(f1,"NextTerminalAfterAtLeastOneSepWalker"),f1);function Zk(t,e,r=[]){r=ga(r);let n=[],i=0;function a(o){return o.concat(ma(t,i+1))}E(a,"remainingPathWith");function s(o){const l=Zk(a(o),e,r);return n.concat(l)}for(E(s,"getAlternativesForProd");r.length{_n(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Bn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ma(t,i)}),n}E(Zk,"possiblePathsFrom");function RM(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!_n(d);){const f=d.pop();if(f===s){o&&Ef(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(_n(p))continue;const v=p[0];if(v===i){const x={idx:g,def:ma(p),ruleStack:cT(m),occurrenceStack:cT(y)};d.push(x)}else if(v instanceof Bn)if(g=0;x--){const b=v.definition[x],w={idx:g,def:b.definition.concat(ma(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof Ss)d.push({idx:g,def:v.definition.concat(ma(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof kg)d.push(Sle(v,g,m,y));else throw Error("non exhaustive match")}return h}E(RM,"nextPossibleTokensAfter");function Sle(t,e,r,n){const i=ga(r);i.push(t.name);const a=ga(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}E(Sle,"expandTopLevelRule");var ei;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ei||(ei={}));function Qk(t){if(t instanceof ya||t==="Option")return ei.OPTION;if(t instanceof ai||t==="Repetition")return ei.REPETITION;if(t instanceof Zs||t==="RepetitionMandatory")return ei.REPETITION_MANDATORY;if(t instanceof Qs||t==="RepetitionMandatoryWithSeparator")return ei.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof As||t==="RepetitionWithSeparator")return ei.REPETITION_WITH_SEPARATOR;if(t instanceof _s||t==="Alternation")return ei.ALTERNATION;throw Error("non exhaustive match")}E(Qk,"getProdType");function LM(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Qk(n);return a===ei.ALTERNATION?bT(e,r,i):xT(e,r,a,i)}E(LM,"getLookaheadPaths");function Ale(t,e,r,n,i,a){const s=bT(t,e,r),o=MM(s)?mT:Ag;return a(s,n,o,i)}E(Ale,"buildLookaheadFuncForOr");function _le(t,e,r,n,i,a){const s=xT(t,e,i,r),o=MM(s)?mT:Ag;return a(s[0],o,n)}E(_le,"buildLookaheadFuncForOptionalProd");function Rle(t,e,r,n){const i=t.length,a=Yo(t,s=>Yo(s,o=>o.length===1));if(e)return function(s){const o=ur(s,l=>l.GATE);for(let l=0;lHo(l)),o=js(s,(l,u,h)=>(Er(u,d=>{br(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Er(d.categoryMatches,f=>{br(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Ho(t);if(a.length===1&&_n(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=js(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,Er(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aZk([s],1)),n=IM(r.length),i=ur(r,s=>{const o={};return Er(s,l=>{const u=Jk(l.partialPath);Er(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=IM(o.length);for(let l=0;l{const v=Jk(y.partialPath);Er(v,x=>{i[l][x]=!0})})}}}}return n}E(DM,"lookAheadSequenceFromAlternatives");function bT(t,e,r,n){const i=new Ile(t,ei.ALTERNATION,n);return e.accept(i),DM(i.result,r)}E(bT,"getLookaheadPathsForOr");function xT(t,e,r,n){const i=new Ile(t,r);e.accept(i);const a=i.result,o=new eJe(e,t,r).startWalking(),l=new Ss({definition:a}),u=new Ss({definition:o});return DM([l,u],n)}E(xT,"getLookaheadPathsForOptionalProd");function eE(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}E(Mle,"isStrictPrefixOfPath");function MM(t){return Yo(t,e=>Yo(e,r=>Yo(r,n=>_n(n.categoryMatches))))}E(MM,"areTokenCategoriesNotUsed");function Nle(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ur(e,r=>Object.assign({type:os.CUSTOM_LOOKAHEAD_VALIDATION},r))}E(Nle,"validateLookahead");function Ole(t,e,r,n){const i=xo(t,l=>$le(l,r)),a=Hle(t,e,r),s=xo(t,l=>qle(l,r)),o=xo(t,l=>Ble(l,t,n,r));return i.concat(a,s,o)}E(Ole,"validateGrammar");function $le(t,e){const r=new tJe;t.accept(r);const n=r.allProductions,i=gQe(n,Ple),a=Ko(i,o=>o.length>1);return ur(zi(a),o=>{const l=Xo(o),u=e.buildDuplicateFoundError(t,o),h=jo(l),d={message:u,type:os.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=NM(l);return f&&(d.parameter=f),d})}E($le,"validateDuplicateProductions");function Ple(t){return`${jo(t)}_#_${t.idx}_#_${NM(t)}`}E(Ple,"identifyProductionForDuplicates");function NM(t){return t instanceof Bn?t.terminalType.name:t instanceof as?t.nonTerminalName:""}E(NM,"getExtraProductionArgument");var tJe=(m1=class extends Eg{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},E(m1,"OccurrenceValidationCollector"),m1);function Ble(t,e,r,n){const i=[];if(js(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:os.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}E(Ble,"validateRuleDoesNotAlreadyExist");function Fle(t,e,r){const n=[];let i;return is(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:os.INVALID_RULE_OVERRIDE,ruleName:t})),n}E(Fle,"validateRuleIsOverridden");function OM(t,e,r,n=[]){const i=[],a=TT(e.definition);if(_n(a))return[];{const s=t.name;is(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:os.LEFT_RECURSION,ruleName:s});const l=Bk(a,n.concat([t])),u=xo(l,h=>{const d=ga(n);return d.push(h),OM(t,h,r,d)});return i.concat(u)}}E(OM,"validateNoLeftRecursion");function TT(t){let e=[];if(_n(t))return e;const r=Xo(t);if(r instanceof as)e.push(r.referencedRule);else if(r instanceof Ss||r instanceof ya||r instanceof Zs||r instanceof Qs||r instanceof As||r instanceof ai)e=e.concat(TT(r.definition));else if(r instanceof _s)e=Ho(ur(r.definition,a=>TT(a.definition)));else if(!(r instanceof Bn))throw Error("non exhaustive match");const n=hT(r),i=t.length>1;if(n&&i){const a=ma(t);return e.concat(TT(a))}else return e}E(TT,"getFirstNoneTerminal");var $M=(y1=class extends Eg{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},E(y1,"OrCollector"),y1);function zle(t,e){const r=new $M;t.accept(r);const n=r.alternations;return xo(n,a=>{const s=cT(a.definition);return xo(s,(o,l)=>{const u=RM([o],[],Ag,1);return _n(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:os.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}E(zle,"validateEmptyOrAlternative");function Gle(t,e,r){const n=new $M;t.accept(n);let i=n.alternations;return i=Fk(i,s=>s.ignoreAmbiguities===!0),xo(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=bT(o,t,l,s),h=Wle(u,s,t,r),d=Ule(u,s,t,r);return h.concat(d)})}E(Gle,"validateAmbiguousAlternationAlternatives");var rJe=(v1=class extends Eg{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},E(v1,"RepetitionCollector"),v1);function qle(t,e){const r=new $M;t.accept(r);const n=r.alternations;return xo(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:os.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}E(qle,"validateTooManyAlts");function Vle(t,e,r){const n=[];return Er(t,i=>{const a=new rJe;i.accept(a);const s=a.allProductions;Er(s,o=>{const l=Qk(o),u=o.maxLookahead||e,h=o.idx,f=xT(h,i,l,u)[0];if(_n(Ho(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:os.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}E(Vle,"validateSomeNonEmptyLookaheadPath");function Wle(t,e,r,n){const i=[],a=js(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Er(l,h=>{const d=[u];Er(t,(f,p)=>{u!==p&&eE(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!eE(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ur(a,o=>{const l=ur(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:os.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}E(Wle,"checkAlternativesAmbiguities");function Ule(t,e,r,n){const i=js(t,(s,o,l)=>{const u=ur(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return oT(xo(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=bo(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:os.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}E(Ule,"checkPrefixAlternativesAmbiguities");function Hle(t,e,r){const n=[],i=ur(e,a=>a.name);return Er(t,a=>{const s=a.name;if(is(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:os.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}E(Hle,"checkTerminalAndNoneTerminalsNameSpace");function Yle(t){const e=dM(t,{errMsgProvider:XQe}),r={};return Er(t.rules,n=>{r[n.name]=n}),Cle(r,e.errMsgProvider)}E(Yle,"resolveGrammar");function Xle(t){return t=dM(t,{errMsgProvider:_f}),Ole(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}E(Xle,"validateGrammar");var Kle="MismatchedTokenException",jle="NoViableAltException",Zle="EarlyExitException",Qle="NotAllInputParsedException",Jle=[Kle,jle,Zle,Qle];Object.freeze(Jle);function wT(t){return is(Jle,t.name)}E(wT,"isRecognitionException");var tE=(b1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},E(b1,"RecognitionException"),b1),ece=(x1=class extends tE{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Kle}},E(x1,"MismatchedTokenException"),x1),nJe=(T1=class extends tE{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=jle}},E(T1,"NoViableAltException"),T1),iJe=(w1=class extends tE{constructor(e,r){super(e,r),this.name=Qle}},E(w1,"NotAllInputParsedException"),w1),aJe=(C1=class extends tE{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Zle}},E(C1,"EarlyExitException"),C1),PM={},tce="InRuleRecoveryException",sJe=(k1=class extends Error{constructor(e){super(e),this.name=tce}},E(k1,"InRuleRecoveryException"),k1),oJe=(E1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=br(e,"recoveryEnabled")?e.recoveryEnabled:ru.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=rce)}getTokenToInsert(e){const r=vT(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=E(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new ece(p,u,this.LA(0));g.resyncedTokens=cT(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new sJe("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||_n(r))return!1;const n=this.LA(1);return Cg(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return is(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Cg(e,a=>_M(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return PM;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ur(e,(n,i)=>i===0?PM:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ur(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ho(e)}getFollowSetFromFollowKey(e){if(e===PM)return[kh];const r=e.ruleName+e.idxInCallingRule+Loe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,kh)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return cT(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=ga(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ur(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},E(E1,"Recoverable"),E1);function rce(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=kh,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}E(rce,"attemptInRepetitionRecovery");var lJe=4,Eh=8,nce=1<OM(r,r,_f))}validateEmptyOrAlternatives(e){return xo(e,r=>zle(r,_f))}validateAmbiguousAlternationAlternatives(e,r){return xo(e,n=>Gle(n,r,_f))}validateSomeNonEmptyLookaheadPath(e,r){return Vle(e,r,_f)}buildLookaheadForAlternation(e){return Ale(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Rle)}buildLookaheadForOptional(e){return _le(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Qk(e.prodType),Lle)}},E(S1,"LLkLookaheadStrategy"),S1),cJe=(A1=class{initLooksAhead(e){this.dynamicTokensEnabled=br(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ru.dynamicTokensEnabled,this.maxLookahead=br(e,"maxLookahead")?e.maxLookahead:ru.maxLookahead,this.lookaheadStrategy=br(e,"lookaheadStrategy")?e.lookaheadStrategy:new GM({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Er(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=ace(r);Er(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${jo(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=nE(this.fullRuleNameToShort[r.name],nce,u.idx);this.setLaFuncCache(f,d)})}),Er(i,u=>{this.computeLookaheadFunc(r,u.idx,BM,"Repetition",u.maxLookahead,jo(u))}),Er(a,u=>{this.computeLookaheadFunc(r,u.idx,ice,"Option",u.maxLookahead,jo(u))}),Er(s,u=>{this.computeLookaheadFunc(r,u.idx,FM,"RepetitionMandatory",u.maxLookahead,jo(u))}),Er(o,u=>{this.computeLookaheadFunc(r,u.idx,rE,"RepetitionMandatoryWithSeparator",u.maxLookahead,jo(u))}),Er(l,u=>{this.computeLookaheadFunc(r,u.idx,zM,"RepetitionWithSeparator",u.maxLookahead,jo(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=nE(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return nE(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},E(A1,"LooksAhead"),A1),uJe=(_1=class extends Eg{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},E(_1,"DslMethodsCollectorVisitor"),_1),iE=new uJe;function ace(t){iE.reset(),t.accept(iE);const e=iE.dslMethods;return iE.reset(),e}E(ace,"collectMethods");function qM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof gm?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function ffe(t,e){const r=new Jit(t,e);return r.resolveRefs(),r.errors}A(ffe,"resolveGrammar");var Jit=(ty=class extends mm{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Dr(aa(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Ls.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},A(ty,"GastRefResolverVisitor"),ty),eat=(ry=class extends l3{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Pa(this.path.ruleStack).reverse(),this.occurrenceStack=Pa(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){jn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},A(ry,"AbstractNextPossibleTokensWalker"),ry),tat=(ny=class extends eat{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new Ks({definition:i});this.possibleTokTypes=ym(a),this.found=!0}}},A(ny,"NextAfterTokenWalker"),ny),y3=(iy=class extends l3{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},A(iy,"AbstractNextTerminalAfterProductionWalker"),iy),rat=(ay=class extends y3{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Sl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof si&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},A(ay,"NextTerminalAfterManyWalker"),ay),pfe=(sy=class extends y3{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Sl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof si&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},A(sy,"NextTerminalAfterManySepWalker"),sy),nat=(oy=class extends y3{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Sl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof si&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},A(oy,"NextTerminalAfterAtLeastOneWalker"),oy),gfe=(ly=class extends y3{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Sl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof si&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},A(ly,"NextTerminalAfterAtLeastOneSepWalker"),ly);function v3(t,e,r=[]){r=Pa(r);let n=[],i=0;function a(o){return o.concat(Ba(t,i+1))}A(a,"remainingPathWith");function s(o){const l=v3(a(o),e,r);return n.concat(l)}for(A(s,"getAlternativesForProd");r.length{jn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof si)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ba(t,i)}),n}A(v3,"possiblePathsFrom");function l$(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!jn(d);){const f=d.pop();if(f===s){o&&fp(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(jn(p))continue;const v=p[0];if(v===i){const T={idx:g,def:Ba(p),ruleStack:sw(m),occurrenceStack:sw(y)};d.push(T)}else if(v instanceof si)if(g=0;T--){const x=v.definition[T],w={idx:g,def:x.definition.concat(Ba(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof Ks)d.push({idx:g,def:v.definition.concat(Ba(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof gm)d.push(mfe(v,g,m,y));else throw Error("non exhaustive match")}return h}A(l$,"nextPossibleTokensAfter");function mfe(t,e,r,n){const i=Pa(r);i.push(t.name);const a=Pa(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}A(mfe,"expandTopLevelRule");var vi;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(vi||(vi={}));function b3(t){if(t instanceof Fa||t==="Option")return vi.OPTION;if(t instanceof ki||t==="Repetition")return vi.REPETITION;if(t instanceof Co||t==="RepetitionMandatory")return vi.REPETITION_MANDATORY;if(t instanceof So||t==="RepetitionMandatoryWithSeparator")return vi.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Zs||t==="RepetitionWithSeparator")return vi.REPETITION_WITH_SEPARATOR;if(t instanceof Qs||t==="Alternation")return vi.ALTERNATION;throw Error("non exhaustive match")}A(b3,"getProdType");function c$(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=b3(n);return a===vi.ALTERNATION?mw(e,r,i):yw(e,r,a,i)}A(c$,"getLookaheadPaths");function yfe(t,e,r,n,i,a){const s=mw(t,e,r),o=d$(s)?fw:vm;return a(s,n,o,i)}A(yfe,"buildLookaheadFuncForOr");function vfe(t,e,r,n,i,a){const s=yw(t,e,i,r),o=d$(s)?fw:vm;return a(s[0],o,n)}A(vfe,"buildLookaheadFuncForOptionalProd");function bfe(t,e,r,n){const i=t.length,a=Cl(t,s=>Cl(s,o=>o.length===1));if(e)return function(s){const o=yr(s,l=>l.GATE);for(let l=0;lwl(l)),o=wo(s,(l,u,h)=>(Dr(u,d=>{Ar(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Dr(d.categoryMatches,f=>{Ar(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=wl(t);if(a.length===1&&jn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=wo(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,Dr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;av3([s],1)),n=u$(r.length),i=yr(r,s=>{const o={};return Dr(s,l=>{const u=x3(l.partialPath);Dr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=u$(o.length);for(let l=0;l{const v=x3(y.partialPath);Dr(v,T=>{i[l][T]=!0})})}}}}return n}A(h$,"lookAheadSequenceFromAlternatives");function mw(t,e,r,n){const i=new Tfe(t,vi.ALTERNATION,n);return e.accept(i),h$(i.result,r)}A(mw,"getLookaheadPathsForOr");function yw(t,e,r,n){const i=new Tfe(t,r);e.accept(i);const a=i.result,o=new iat(e,t,r).startWalking(),l=new Ks({definition:a}),u=new Ks({definition:o});return h$([l,u],n)}A(yw,"getLookaheadPathsForOptionalProd");function T3(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}A(Cfe,"isStrictPrefixOfPath");function d$(t){return Cl(t,e=>Cl(e,r=>Cl(r,n=>jn(n.categoryMatches))))}A(d$,"areTokenCategoriesNotUsed");function Sfe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return yr(e,r=>Object.assign({type:Ls.CUSTOM_LOOKAHEAD_VALIDATION},r))}A(Sfe,"validateLookahead");function kfe(t,e,r,n){const i=Ho(t,l=>Efe(l,r)),a=$fe(t,e,r),s=Ho(t,l=>Mfe(l,r)),o=Ho(t,l=>_fe(l,t,n,r));return i.concat(a,s,o)}A(kfe,"validateGrammar");function Efe(t,e){const r=new aat;t.accept(r);const n=r.allProductions,i=bit(n,Afe),a=kl(i,o=>o.length>1);return yr(aa(a),o=>{const l=Sl(o),u=e.buildDuplicateFoundError(t,o),h=El(l),d={message:u,type:Ls.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=f$(l);return f&&(d.parameter=f),d})}A(Efe,"validateDuplicateProductions");function Afe(t){return`${El(t)}_#_${t.idx}_#_${f$(t)}`}A(Afe,"identifyProductionForDuplicates");function f$(t){return t instanceof si?t.terminalType.name:t instanceof _s?t.nonTerminalName:""}A(f$,"getExtraProductionArgument");var aat=(hy=class extends mm{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},A(hy,"OccurrenceValidationCollector"),hy);function _fe(t,e,r,n){const i=[];if(wo(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Ls.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}A(_fe,"validateRuleDoesNotAlreadyExist");function Rfe(t,e,r){const n=[];let i;return As(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Ls.INVALID_RULE_OVERRIDE,ruleName:t})),n}A(Rfe,"validateRuleIsOverridden");function p$(t,e,r,n=[]){const i=[],a=vw(e.definition);if(jn(a))return[];{const s=t.name;As(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ls.LEFT_RECURSION,ruleName:s});const l=a3(a,n.concat([t])),u=Ho(l,h=>{const d=Pa(n);return d.push(h),p$(t,h,r,d)});return i.concat(u)}}A(p$,"validateNoLeftRecursion");function vw(t){let e=[];if(jn(t))return e;const r=Sl(t);if(r instanceof _s)e.push(r.referencedRule);else if(r instanceof Ks||r instanceof Fa||r instanceof Co||r instanceof So||r instanceof Zs||r instanceof ki)e=e.concat(vw(r.definition));else if(r instanceof Qs)e=wl(yr(r.definition,a=>vw(a.definition)));else if(!(r instanceof si))throw Error("non exhaustive match");const n=lw(r),i=t.length>1;if(n&&i){const a=Ba(t);return e.concat(vw(a))}else return e}A(vw,"getFirstNoneTerminal");var g$=(dy=class extends mm{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},A(dy,"OrCollector"),dy);function Lfe(t,e){const r=new g$;t.accept(r);const n=r.alternations;return Ho(n,a=>{const s=sw(a.definition);return Ho(s,(o,l)=>{const u=l$([o],[],vm,1);return jn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Ls.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}A(Lfe,"validateEmptyOrAlternative");function Ife(t,e,r){const n=new g$;t.accept(n);let i=n.alternations;return i=s3(i,s=>s.ignoreAmbiguities===!0),Ho(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=mw(o,t,l,s),h=Nfe(u,s,t,r),d=Ofe(u,s,t,r);return h.concat(d)})}A(Ife,"validateAmbiguousAlternationAlternatives");var sat=(fy=class extends mm{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},A(fy,"RepetitionCollector"),fy);function Mfe(t,e){const r=new g$;t.accept(r);const n=r.alternations;return Ho(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Ls.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}A(Mfe,"validateTooManyAlts");function Dfe(t,e,r){const n=[];return Dr(t,i=>{const a=new sat;i.accept(a);const s=a.allProductions;Dr(s,o=>{const l=b3(o),u=o.maxLookahead||e,h=o.idx,f=yw(h,i,l,u)[0];if(jn(wl(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Ls.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}A(Dfe,"validateSomeNonEmptyLookaheadPath");function Nfe(t,e,r,n){const i=[],a=wo(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Dr(l,h=>{const d=[u];Dr(t,(f,p)=>{u!==p&&T3(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!T3(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return yr(a,o=>{const l=yr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Ls.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}A(Nfe,"checkAlternativesAmbiguities");function Ofe(t,e,r,n){const i=wo(t,(s,o,l)=>{const u=yr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return iw(Ho(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=Uo(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Ls.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}A(Ofe,"checkPrefixAlternativesAmbiguities");function $fe(t,e,r){const n=[],i=yr(e,a=>a.name);return Dr(t,a=>{const s=a.name;if(As(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:Ls.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}A($fe,"checkTerminalAndNoneTerminalsNameSpace");function Pfe(t){const e=UO(t,{errMsgProvider:Qit}),r={};return Dr(t.rules,n=>{r[n.name]=n}),ffe(r,e.errMsgProvider)}A(Pfe,"resolveGrammar");function Bfe(t){return t=UO(t,{errMsgProvider:mp}),kfe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}A(Bfe,"validateGrammar");var Ffe="MismatchedTokenException",zfe="NoViableAltException",Gfe="EarlyExitException",Wfe="NotAllInputParsedException",qfe=[Ffe,zfe,Gfe,Wfe];Object.freeze(qfe);function bw(t){return As(qfe,t.name)}A(bw,"isRecognitionException");var w3=(py=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},A(py,"RecognitionException"),py),Vfe=(gy=class extends w3{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ffe}},A(gy,"MismatchedTokenException"),gy),oat=(my=class extends w3{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=zfe}},A(my,"NoViableAltException"),my),lat=(yy=class extends w3{constructor(e,r){super(e,r),this.name=Wfe}},A(yy,"NotAllInputParsedException"),yy),cat=(vy=class extends w3{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Gfe}},A(vy,"EarlyExitException"),vy),m$={},Ufe="InRuleRecoveryException",uat=(by=class extends Error{constructor(e){super(e),this.name=Ufe}},A(by,"InRuleRecoveryException"),by),hat=(xy=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ar(e,"recoveryEnabled")?e.recoveryEnabled:$u.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Hfe)}getTokenToInsert(e){const r=gw(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=A(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new Vfe(p,u,this.LA(0));g.resyncedTokens=sw(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new uat("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||jn(r))return!1;const n=this.LA(1);return pm(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return As(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=pm(e,a=>o$(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return m$;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return yr(e,(n,i)=>i===0?m$:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=yr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return wl(e)}getFollowSetFromFollowKey(e){if(e===m$)return[sd];const r=e.ruleName+e.idxInCallingRule+xde+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,sd)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return sw(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Pa(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return yr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},A(xy,"Recoverable"),xy);function Hfe(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=sd,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}A(Hfe,"attemptInRepetitionRecovery");var dat=4,od=8,Yfe=1<p$(r,r,mp))}validateEmptyOrAlternatives(e){return Ho(e,r=>Lfe(r,mp))}validateAmbiguousAlternationAlternatives(e,r){return Ho(e,n=>Ife(n,r,mp))}validateSomeNonEmptyLookaheadPath(e,r){return Dfe(e,r,mp)}buildLookaheadForAlternation(e){return yfe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,bfe)}buildLookaheadForOptional(e){return vfe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,b3(e.prodType),xfe)}},A(Ty,"LLkLookaheadStrategy"),Ty),fat=(wy=class{initLooksAhead(e){this.dynamicTokensEnabled=Ar(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:$u.dynamicTokensEnabled,this.maxLookahead=Ar(e,"maxLookahead")?e.maxLookahead:$u.maxLookahead,this.lookaheadStrategy=Ar(e,"lookaheadStrategy")?e.lookaheadStrategy:new x$({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Dr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=jfe(r);Dr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${El(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=S3(this.fullRuleNameToShort[r.name],Yfe,u.idx);this.setLaFuncCache(f,d)})}),Dr(i,u=>{this.computeLookaheadFunc(r,u.idx,y$,"Repetition",u.maxLookahead,El(u))}),Dr(a,u=>{this.computeLookaheadFunc(r,u.idx,Xfe,"Option",u.maxLookahead,El(u))}),Dr(s,u=>{this.computeLookaheadFunc(r,u.idx,v$,"RepetitionMandatory",u.maxLookahead,El(u))}),Dr(o,u=>{this.computeLookaheadFunc(r,u.idx,C3,"RepetitionMandatoryWithSeparator",u.maxLookahead,El(u))}),Dr(l,u=>{this.computeLookaheadFunc(r,u.idx,b$,"RepetitionWithSeparator",u.maxLookahead,El(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=S3(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return S3(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},A(wy,"LooksAhead"),wy),pat=(Cy=class extends mm{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},A(Cy,"DslMethodsCollectorVisitor"),Cy),k3=new pat;function jfe(t){k3.reset(),t.accept(k3);const e=k3.dslMethods;return k3.reset(),e}A(jfe,"collectMethods");function T$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}E(cce,"createBaseSemanticVisitorConstructor");function uce(t,e,r){const n=E(function(){},"derivedConstructor");WM(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Er(e,a=>{i[a]=lce}),n.prototype=i,n.prototype.constructor=n,n}E(uce,"createBaseVisitorConstructorWithDefaults");var UM;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(UM||(UM={}));function hce(t,e){return dce(t,e)}E(hce,"validateVisitor");function dce(t,e){const r=bo(e,i=>Qc(t[i])===!1),n=ur(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:UM.MISSING_METHOD,methodName:i}));return oT(n)}E(dce,"validateMissingCstMethods");var dJe=(R1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=br(e,"nodeLocationTracking")?e.nodeLocationTracking:ru.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ji,this.cstFinallyStateUpdate=Ji,this.cstPostTerminal=Ji,this.cstPostNonTerminal=Ji,this.cstPostRule=Ji;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=VM,this.setNodeLocationFromNode=VM,this.cstPostRule=Ji,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ji,this.setNodeLocationFromNode=Ji,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=qM,this.setNodeLocationFromNode=qM,this.cstPostRule=Ji,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ji,this.setNodeLocationFromNode=Ji,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ji,this.setNodeLocationFromNode=Ji,this.cstPostRule=Ji,this.setInitialNodeLocation=Ji;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];sce(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];oce(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(eu(this.baseCstVisitorConstructor)){const e=cce(this.className,Xs(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(eu(this.baseCstVisitorWithDefaultsConstructor)){const e=uce(this.className,Xs(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},E(R1,"TreeBuilder"),R1),fJe=(L1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):sE}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?sE:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},E(L1,"LexerAdapter"),L1),pJe=(I1=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=oE){if(is(this.definedRulesNames,e)){const s={message:_f.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:os.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=oE){const i=Fle(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(wT(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return koe(zi(this.gastProductionsCache))}},E(I1,"RecognizerApi"),I1),gJe=(D1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=mT,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},br(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}A(Jfe,"createBaseSemanticVisitorConstructor");function epe(t,e,r){const n=A(function(){},"derivedConstructor");C$(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Dr(e,a=>{i[a]=Qfe}),n.prototype=i,n.prototype.constructor=n,n}A(epe,"createBaseVisitorConstructorWithDefaults");var S$;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(S$||(S$={}));function tpe(t,e){return rpe(t,e)}A(tpe,"validateVisitor");function rpe(t,e){const r=Uo(e,i=>Mu(t[i])===!1),n=yr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:S$.MISSING_METHOD,methodName:i}));return iw(n)}A(rpe,"validateMissingCstMethods");var mat=(Sy=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Ar(e,"nodeLocationTracking")?e.nodeLocationTracking:$u.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=xa,this.cstFinallyStateUpdate=xa,this.cstPostTerminal=xa,this.cstPostNonTerminal=xa,this.cstPostRule=xa;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=w$,this.setNodeLocationFromNode=w$,this.cstPostRule=xa,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=xa,this.setNodeLocationFromNode=xa,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=T$,this.setNodeLocationFromNode=T$,this.cstPostRule=xa,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=xa,this.setNodeLocationFromNode=xa,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=xa,this.setNodeLocationFromNode=xa,this.cstPostRule=xa,this.setInitialNodeLocation=xa;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Kfe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Zfe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Nu(this.baseCstVisitorConstructor)){const e=Jfe(this.className,xo(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Nu(this.baseCstVisitorWithDefaultsConstructor)){const e=epe(this.className,xo(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},A(Sy,"TreeBuilder"),Sy),yat=(ky=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):A3}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?A3:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},A(ky,"LexerAdapter"),ky),vat=(Ey=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=_3){if(As(this.definedRulesNames,e)){const s={message:mp.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ls.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=_3){const i=Rfe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(bw(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return pde(aa(this.gastProductionsCache))}},A(Ey,"RecognizerApi"),Ey),bat=(Ay=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=fw,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ar(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if(Qr(e)){if(_n(e))throw Error(`A Token Vocabulary cannot be empty. + For Further details.`);if(yn(e)){if(jn(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(Qr(e))this.tokensMap=js(e,(a,s)=>(a[s.name]=s,a),{});else if(br(e,"modes")&&Yo(Ho(zi(e.modes)),fle)){const a=Ho(zi(e.modes)),s=fM(a);this.tokensMap=js(s,(o,l)=>(o[l.name]=l,o),{})}else if(vo(e))this.tokensMap=ga(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=kh;const n=br(e,"modes")?Ho(zi(e.modes)):zi(e),i=Yo(n,a=>_n(a.categoryMatches));this.tokenMatcher=i?mT:Ag,_g(zi(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=br(n,"resyncEnabled")?n.resyncEnabled:oE.resyncEnabled,a=br(n,"recoveryValueFunc")?n.recoveryValueFunc:oE.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(FM,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=E(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,ei.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,FM,e,JQe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(rE,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Ele],o,rE,e,Ele)}else throw this.raiseEarlyExitException(e,ei.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(BM,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=E(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,BM,e,QQe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(zM,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,kle],o,zM,e,kle)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,rE,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(nce,r),i=Qr(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new iJe(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw wT(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ece(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===tce?n:a}}else throw n}saveRecogState(){const e=this.errors,r=ga(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),kh)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},E(D1,"RecognizerEngine"),D1),mJe=(M1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=br(e,"errorMessageProvider")?e.errorMessageProvider:ru.errorMessageProvider}SAVE_ERROR(e){if(wT(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:ga(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return ga(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=xT(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new aJe(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=bT(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new nJe(l,this.LA(1),o))}},E(M1,"ErrorHandler"),M1),yJe=(N1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(eu(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return RM([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Xo(e.ruleStack),i=this.getGAstProductions()[r];return new ZQe(i,e).startWalking()}},E(N1,"ContentAssist"),N1),aE={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(aE);var fce=!0,pce=Math.pow(2,Eh)-1,gce=Rg({name:"RECORDING_PHASE_TOKEN",pattern:ss.NA});_g([gce]);var mce=vT(gce,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(mce);var vJe={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},bJe=(O1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return sE}topLevelRuleRecord(e,r){try{const n=new kg({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + For Further details.`)}if(yn(e))this.tokensMap=wo(e,(a,s)=>(a[s.name]=s,a),{});else if(Ar(e,"modes")&&Cl(wl(aa(e.modes)),nfe)){const a=wl(aa(e.modes)),s=HO(a);this.tokensMap=wo(s,(o,l)=>(o[l.name]=l,o),{})}else if(Vo(e))this.tokensMap=Pa(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=sd;const n=Ar(e,"modes")?wl(aa(e.modes)):aa(e),i=Cl(n,a=>jn(a.categoryMatches));this.tokenMatcher=i?fw:vm,bm(aa(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Ar(n,"resyncEnabled")?n.resyncEnabled:_3.resyncEnabled,a=Ar(n,"recoveryValueFunc")?n.recoveryValueFunc:_3.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(v$,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=A(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,vi.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,v$,e,nat)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(C3,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,gfe],o,C3,e,gfe)}else throw this.raiseEarlyExitException(e,vi.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(y$,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=A(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,y$,e,rat,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(b$,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,pfe],o,b$,e,pfe)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,C3,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(Yfe,r),i=yn(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new lat(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw bw(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Vfe(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===Ufe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Pa(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),sd)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},A(Ay,"RecognizerEngine"),Ay),xat=(_y=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Ar(e,"errorMessageProvider")?e.errorMessageProvider:$u.errorMessageProvider}SAVE_ERROR(e){if(bw(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Pa(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Pa(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=yw(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new cat(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=mw(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new oat(l,this.LA(1),o))}},A(_y,"ErrorHandler"),_y),Tat=(Ry=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Nu(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return l$([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Sl(e.ruleStack),i=this.getGAstProductions()[r];return new tat(i,e).startWalking()}},A(Ry,"ContentAssist"),Ry),E3={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(E3);var npe=!0,ipe=Math.pow(2,od)-1,ape=xm({name:"RECORDING_PHASE_TOKEN",pattern:Rs.NA});bm([ape]);var spe=gw(ape,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(spe);var wat={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Cat=(Ly=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return A3}topLevelRuleRecord(e,r){try{const n=new gm({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Ig.call(this,ya,e,r)}atLeastOneInternalRecord(e,r){Ig.call(this,Zs,r,e)}atLeastOneSepFirstInternalRecord(e,r){Ig.call(this,Qs,r,e,fce)}manyInternalRecord(e,r){Ig.call(this,ai,r,e)}manySepFirstInternalRecord(e,r){Ig.call(this,As,r,e,fce)}orInternalRecord(e,r){return yce.call(this,e,r)}subruleInternalRecord(e,r,n){if(CT(r),!e||br(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Ef(this.recordingProdStack),a=e.ruleName,s=new as({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?vJe:aE}consumeInternalRecord(e,r,n){if(CT(r),!kM(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=Ef(this.recordingProdStack),a=new Bn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),mce}},E(O1,"GastRecorder"),O1);function Ig(t,e,r,n=!1){CT(r);const i=Ef(this.recordingProdStack),a=Qc(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),br(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),aE}E(Ig,"recordProd");function yce(t,e){CT(e);const r=Ef(this.recordingProdStack),n=Qr(t)===!1,i=n===!1?t:t.DEF,a=new _s({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});br(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=boe(i,o=>Qc(o.GATE));return a.hasPredicates=s,r.definition.push(a),Er(i,o=>{const l=new Ss({definition:[]});a.definition.push(l),br(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:br(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),aE}E(yce,"recordOrProd");function HM(t){return t===0?"":`${t}`}E(HM,"getIdxSuffix");function CT(t){if(t<0||t>pce){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${pce+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}E(CT,"assertMethodIdxIsValid");var xJe=($1=class{initPerformanceTracer(e){if(br(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=ru.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=gM(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},E($1,"PerformanceTracer"),$1);function vce(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}E(vce,"applyMixins");var sE=vT(kh,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(sE);var ru=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Lg,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),oE=Object.freeze({recoveryValueFunc:E(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),os;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(os||(os={}));function YM(t=void 0){return function(){return t}}E(YM,"EMPTY_ALT");var XM=(cp=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{mM(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Er(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Yle({rules:zi(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(_n(n)&&this.skipValidations===!1){const i=Xle({rules:zi(this.gastProductionsCache),tokenTypes:zi(this.tokensMap),errMsgProvider:_f,grammarName:r}),a=Nle({lookaheadStrategy:this.lookaheadStrategy,rules:zi(this.gastProductionsCache),tokenTypes:zi(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),_n(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Ioe(zi(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:zi(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(zi(this.gastProductionsCache))})),!cp.DEFER_DEFINITION_ERRORS_HANDLING&&!_n(this.definitionErrors))throw e=ur(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return wm.call(this,Fa,e,r)}atLeastOneInternalRecord(e,r){wm.call(this,Co,r,e)}atLeastOneSepFirstInternalRecord(e,r){wm.call(this,So,r,e,npe)}manyInternalRecord(e,r){wm.call(this,ki,r,e)}manySepFirstInternalRecord(e,r){wm.call(this,Zs,r,e,npe)}orInternalRecord(e,r){return ope.call(this,e,r)}subruleInternalRecord(e,r,n){if(xw(r),!e||Ar(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=fp(this.recordingProdStack),a=e.ruleName,s=new _s({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?wat:E3}consumeInternalRecord(e,r,n){if(xw(r),!n$(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=fp(this.recordingProdStack),a=new si({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),spe}},A(Ly,"GastRecorder"),Ly);function wm(t,e,r,n=!1){xw(r);const i=fp(this.recordingProdStack),a=Mu(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Ar(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),E3}A(wm,"recordProd");function ope(t,e){xw(e);const r=fp(this.recordingProdStack),n=yn(t)===!1,i=n===!1?t:t.DEF,a=new Qs({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Ar(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=cde(i,o=>Mu(o.GATE));return a.hasPredicates=s,r.definition.push(a),Dr(i,o=>{const l=new Ks({definition:[]});a.definition.push(l),Ar(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Ar(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),E3}A(ope,"recordOrProd");function k$(t){return t===0?"":`${t}`}A(k$,"getIdxSuffix");function xw(t){if(t<0||t>ipe){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${ipe+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}A(xw,"assertMethodIdxIsValid");var Sat=(Iy=class{initPerformanceTracer(e){if(Ar(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=$u.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=XO(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},A(Iy,"PerformanceTracer"),Iy);function lpe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}A(lpe,"applyMixins");var A3=gw(sd,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(A3);var $u=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Tm,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),_3=Object.freeze({recoveryValueFunc:A(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Ls;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Ls||(Ls={}));function E$(t=void 0){return function(){return t}}A(E$,"EMPTY_ALT");var A$=(Qp=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{jO(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Dr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Pfe({rules:aa(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(jn(n)&&this.skipValidations===!1){const i=Bfe({rules:aa(this.gastProductionsCache),tokenTypes:aa(this.tokensMap),errMsgProvider:mp,grammarName:r}),a=Sfe({lookaheadStrategy:this.lookaheadStrategy,rules:aa(this.gastProductionsCache),tokenTypes:aa(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),jn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Tde(aa(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:aa(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(aa(this.gastProductionsCache))})),!Qp.DEFER_DEFINITION_ERRORS_HANDLING&&!jn(this.definitionErrors))throw e=yr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- -`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),br(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. +`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Ar(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=br(r,"skipValidations")?r.skipValidations:ru.skipValidations}},E(cp,"Parser"),cp);XM.DEFER_DEFINITION_ERRORS_HANDLING=!1,vce(XM,[oJe,cJe,dJe,fJe,gJe,pJe,mJe,yJe,bJe,xJe]);var TJe=(P1=class extends XM{constructor(e,r=ru){const n=ga(r);n.outputCst=!1,super(e,n)}},E(P1,"EmbeddedActionsParser"),P1);function bce(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}E(Ace,"listCacheHas");var AJe=Ace;function _ce(t,e){var r=this.__data__,n=lE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(_ce,"listCacheSet");var _Je=_ce;function Rf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&$et?new uue:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=ytt}E(Fue,"isLength");var JM=Fue,vtt="[object Arguments]",btt="[object Array]",xtt="[object Boolean]",Ttt="[object Date]",wtt="[object Error]",Ctt="[object Function]",ktt="[object Map]",Ett="[object Number]",Stt="[object Object]",Att="[object RegExp]",_tt="[object Set]",Rtt="[object String]",Ltt="[object WeakMap]",Itt="[object ArrayBuffer]",Dtt="[object DataView]",Mtt="[object Float32Array]",Ntt="[object Float64Array]",Ott="[object Int8Array]",$tt="[object Int16Array]",Ptt="[object Int32Array]",Btt="[object Uint8Array]",Ftt="[object Uint8ClampedArray]",ztt="[object Uint16Array]",Gtt="[object Uint32Array]",Fn={};Fn[Mtt]=Fn[Ntt]=Fn[Ott]=Fn[$tt]=Fn[Ptt]=Fn[Btt]=Fn[Ftt]=Fn[ztt]=Fn[Gtt]=!0,Fn[vtt]=Fn[btt]=Fn[Itt]=Fn[xtt]=Fn[Dtt]=Fn[Ttt]=Fn[wtt]=Fn[Ctt]=Fn[ktt]=Fn[Ett]=Fn[Stt]=Fn[Att]=Fn[_tt]=Fn[Rtt]=Fn[Ltt]=!1;function zue(t){return Ng(t)&&JM(t.length)&&!!Fn[Dg(t)]}E(zue,"baseIsTypedArray");var qtt=zue;function Gue(t){return function(e){return t(e)}}E(Gue,"baseUnary");var Vtt=Gue,que=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_T=que&&typeof module=="object"&&module&&!module.nodeType&&module,Wtt=_T&&_T.exports===que,eN=Wtt&&Mce.process,Utt=(function(){try{var t=_T&&_T.require&&_T.require("util").types;return t||eN&&eN.binding&&eN.binding("util")}catch{}})(),Vue=Utt,Wue=Vue&&Vue.isTypedArray,Htt=Wue?Vtt(Wue):qtt,tN=Htt,Ytt=Object.prototype,Xtt=Ytt.hasOwnProperty;function Uue(t,e){var r=ls(t),n=!r&&fE(t),i=!r&&!n&&pE(t),a=!r&&!n&&!i&&tN(t),s=r||n||i||a,o=s?stt(t.length,String):[],l=o.length;for(var u in t)(e||Xtt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Bue(u,l)))&&o.push(u);return o}E(Uue,"arrayLikeKeys");var Ktt=Uue,jtt=Object.prototype;function Hue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||jtt;return t===r}E(Hue,"isPrototype");var Yue=Hue;function Xue(t,e){return function(r){return t(e(r))}}E(Xue,"overArg");var Ztt=Xue,Qtt=Ztt(Object.keys,Object),Jtt=Qtt,ert=Object.prototype,trt=ert.hasOwnProperty;function Kue(t){if(!Yue(t))return Jtt(t);var e=[];for(var r in Object(t))trt.call(t,r)&&r!="constructor"&&e.push(r);return e}E(Kue,"baseKeys");var jue=Kue;function Zue(t){return t!=null&&JM(t.length)&&!Gce(t)}E(Zue,"isArrayLike");var gE=Zue;function Que(t){return gE(t)?Ktt(t):jue(t)}E(Que,"keys");var rN=Que;function Jue(t){return ett(t,rN,att)}E(Jue,"getAllKeys");var ehe=Jue,rrt=1,nrt=Object.prototype,irt=nrt.hasOwnProperty;function the(t,e,r,n,i,a){var s=r&rrt,o=ehe(t),l=o.length,u=ehe(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:irt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dpN(t,e,s));return $f(t,e,n,r,...i)}E(nde,"alternation");function ide(t,e,r){const n=Gi(t,e,r,{type:Sh});au(t,n);const i=$f(t,e,n,r,Ah(t,e,r));return ade(t,e,r,i)}E(ide,"option");function Ah(t,e,r){const n=tnt(iu(r.definition,i=>pN(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:ode(t,n)}E(Ah,"block");function gN(t,e,r,n,i){const a=n.left,s=n.right,o=Gi(t,e,r,{type:snt});au(t,o);const l=Gi(t,e,r,{type:Khe});return a.loopback=o,l.loopback=o,t.decisionMap[Of(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,fi(s,o),i===void 0?(fi(o,a),fi(o,l)):(fi(o,l),fi(o,i.left),fi(i.right,a)),{left:a,right:l}}E(gN,"plus");function mN(t,e,r,n,i){const a=n.left,s=n.right,o=Gi(t,e,r,{type:ant});au(t,o);const l=Gi(t,e,r,{type:Khe}),u=Gi(t,e,r,{type:int});return o.loopback=u,l.loopback=u,fi(o,a),fi(o,l),fi(s,u),i!==void 0?(fi(u,l),fi(u,i.left),fi(i.right,a)):fi(u,o),t.decisionMap[Of(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}E(mN,"star");function ade(t,e,r,n){const i=n.left,a=n.right;return fi(i,a),t.decisionMap[Of(e,"Option",r.idx)]=i,n}E(ade,"optional");function au(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}E(au,"defineDecisionState");function $f(t,e,r,n,...i){const a=Gi(t,e,n,{type:nnt,start:r});r.end=a;for(const o of i)o!==void 0?(fi(r,o.left),fi(o.right,a)):fi(r,a);const s={left:r,right:a};return t.decisionMap[Of(e,sde(n),n.idx)]=r,s}E($f,"makeAlts");function sde(t){if(t instanceof _s)return"Alternation";if(t instanceof ya)return"Option";if(t instanceof ai)return"Repetition";if(t instanceof As)return"RepetitionWithSeparator";if(t instanceof Zs)return"RepetitionMandatory";if(t instanceof Qs)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}E(sde,"getProdType");function ode(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},E(q1,"ATNConfigSet"),q1);function vN(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}E(vN,"getATNConfigKey");function hde(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?bN(o,e-1,r,n,i):wue(i,o):n||(i[i.length]=o)}return i}E(bN,"baseFlatten");var mde=bN;function yde(t,e){return mde(iu(t,e),1)}E(yde,"flatMap");var hnt=yde;function vde(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}E(wde,"arrayIncludes");var mnt=wde;function Cde(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=wnt){var u=e?null:Tnt(t);if(u)return ZM(u);s=!1,i=fue,l=new uue}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}E($de,"createDFACache");var Pde=(V1=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Zhe(e.rules),this.dfas=Fde(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Of(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=iu(LM({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>iu(f,p=>p[0]));if(TN(d,!1)&&!a){const f=Ode(d,(p,g,m)=>(xN(g,y=>{y&&(p[y.tokenTypeIdx]=m,xN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Pde,g=f===void 0?0:f.length;for(let y=0;yiu(f,p=>p[0]));if(TN(d)&&d[0][0]&&!a){const f=d[0],p=Ent(f);if(p.length===1&&Dnt(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Ode(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,xN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=EE.call(this,s,h,Bde,o);return typeof f=="object"?!1:f===0}}},E(W1,"LLStarLookaheadStrategy"),W1);function TN(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}E(TN,"isLL1Sequence");function Fde(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nAf(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Wde(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=Ar(r,"skipValidations")?r.skipValidations:$u.skipValidations}},A(Qp,"Parser"),Qp);A$.DEFER_DEFINITION_ERRORS_HANDLING=!1,lpe(A$,[hat,fat,mat,yat,bat,vat,xat,Tat,Cat,Sat]);var kat=(My=class extends A${constructor(e,r=$u){const n=Pa(r);n.outputCst=!1,super(e,n)}},A(My,"EmbeddedActionsParser"),My);function cpe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}A(ype,"listCacheHas");var Iat=ype;function vpe(t,e){var r=this.__data__,n=R3(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(vpe,"listCacheSet");var Mat=vpe;function yp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Bst?new e0e:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=bot}A(R0e,"isLength");var M$=R0e,xot="[object Arguments]",Tot="[object Array]",wot="[object Boolean]",Cot="[object Date]",Sot="[object Error]",kot="[object Function]",Eot="[object Map]",Aot="[object Number]",_ot="[object Object]",Rot="[object RegExp]",Lot="[object Set]",Iot="[object String]",Mot="[object WeakMap]",Dot="[object ArrayBuffer]",Not="[object DataView]",Oot="[object Float32Array]",$ot="[object Float64Array]",Pot="[object Int8Array]",Bot="[object Int16Array]",Fot="[object Int32Array]",zot="[object Uint8Array]",Got="[object Uint8ClampedArray]",Wot="[object Uint16Array]",qot="[object Uint32Array]",oi={};oi[Oot]=oi[$ot]=oi[Pot]=oi[Bot]=oi[Fot]=oi[zot]=oi[Got]=oi[Wot]=oi[qot]=!0,oi[xot]=oi[Tot]=oi[Dot]=oi[wot]=oi[Not]=oi[Cot]=oi[Sot]=oi[kot]=oi[Eot]=oi[Aot]=oi[_ot]=oi[Rot]=oi[Lot]=oi[Iot]=oi[Mot]=!1;function L0e(t){return km(t)&&M$(t.length)&&!!oi[Cm(t)]}A(L0e,"baseIsTypedArray");var Vot=L0e;function I0e(t){return function(e){return t(e)}}A(I0e,"baseUnary");var Uot=I0e,M0e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kw=M0e&&typeof module=="object"&&module&&!module.nodeType&&module,Hot=kw&&kw.exports===M0e,D$=Hot&&Cpe.process,Yot=(function(){try{var t=kw&&kw.require&&kw.require("util").types;return t||D$&&D$.binding&&D$.binding("util")}catch{}})(),D0e=Yot,N0e=D0e&&D0e.isTypedArray,Xot=N0e?Uot(N0e):Vot,N$=Xot,jot=Object.prototype,Kot=jot.hasOwnProperty;function O0e(t,e){var r=Is(t),n=!r&&N3(t),i=!r&&!n&&O3(t),a=!r&&!n&&!i&&N$(t),s=r||n||i||a,o=s?lot(t.length,String):[],l=o.length;for(var u in t)(e||Kot.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_0e(u,l)))&&o.push(u);return o}A(O0e,"arrayLikeKeys");var Zot=O0e,Qot=Object.prototype;function $0e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qot;return t===r}A($0e,"isPrototype");var P0e=$0e;function B0e(t,e){return function(r){return t(e(r))}}A(B0e,"overArg");var Jot=B0e,elt=Jot(Object.keys,Object),tlt=elt,rlt=Object.prototype,nlt=rlt.hasOwnProperty;function F0e(t){if(!P0e(t))return tlt(t);var e=[];for(var r in Object(t))nlt.call(t,r)&&r!="constructor"&&e.push(r);return e}A(F0e,"baseKeys");var z0e=F0e;function G0e(t){return t!=null&&M$(t.length)&&!Ipe(t)}A(G0e,"isArrayLike");var $3=G0e;function W0e(t){return $3(t)?Zot(t):z0e(t)}A(W0e,"keys");var O$=W0e;function q0e(t){return rot(t,O$,oot)}A(q0e,"getAllKeys");var V0e=q0e,ilt=1,alt=Object.prototype,slt=alt.hasOwnProperty;function U0e(t,e,r,n,i,a){var s=r&ilt,o=V0e(t),l=o.length,u=V0e(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:slt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dY$(t,e,s));return Sp(t,e,n,r,...i)}A(Yge,"alternation");function Xge(t,e,r){const n=sa(t,e,r,{type:ld});Fu(t,n);const i=Sp(t,e,n,r,cd(t,e,r));return jge(t,e,r,i)}A(Xge,"option");function cd(t,e,r){const n=nct(Bu(r.definition,i=>Y$(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Zge(t,n)}A(cd,"block");function X$(t,e,r,n,i){const a=n.left,s=n.right,o=sa(t,e,r,{type:lct});Fu(t,o);const l=sa(t,e,r,{type:Fge});return a.loopback=o,l.loopback=o,t.decisionMap[Cp(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,$i(s,o),i===void 0?($i(o,a),$i(o,l)):($i(o,l),$i(o,i.left),$i(i.right,a)),{left:a,right:l}}A(X$,"plus");function j$(t,e,r,n,i){const a=n.left,s=n.right,o=sa(t,e,r,{type:oct});Fu(t,o);const l=sa(t,e,r,{type:Fge}),u=sa(t,e,r,{type:sct});return o.loopback=u,l.loopback=u,$i(o,a),$i(o,l),$i(s,u),i!==void 0?($i(u,l),$i(u,i.left),$i(i.right,a)):$i(u,o),t.decisionMap[Cp(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}A(j$,"star");function jge(t,e,r,n){const i=n.left,a=n.right;return $i(i,a),t.decisionMap[Cp(e,"Option",r.idx)]=i,n}A(jge,"optional");function Fu(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}A(Fu,"defineDecisionState");function Sp(t,e,r,n,...i){const a=sa(t,e,n,{type:act,start:r});r.end=a;for(const o of i)o!==void 0?($i(r,o.left),$i(o.right,a)):$i(r,a);const s={left:r,right:a};return t.decisionMap[Cp(e,Kge(n),n.idx)]=r,s}A(Sp,"makeAlts");function Kge(t){if(t instanceof Qs)return"Alternation";if(t instanceof Fa)return"Option";if(t instanceof ki)return"Repetition";if(t instanceof Zs)return"RepetitionWithSeparator";if(t instanceof Co)return"RepetitionMandatory";if(t instanceof So)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}A(Kge,"getProdType");function Zge(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},A(Py,"ATNConfigSet"),Py);function Z$(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}A(Z$,"getATNConfigKey");function tme(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Q$(o,e-1,r,n,i):d0e(i,o):n||(i[i.length]=o)}return i}A(Q$,"baseFlatten");var sme=Q$;function ome(t,e){return sme(Bu(t,e),1)}A(ome,"flatMap");var fct=ome;function lme(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}A(dme,"arrayIncludes");var vct=dme;function fme(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Sct){var u=e?null:Cct(t);if(u)return L$(u);s=!1,i=n0e,l=new e0e}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}A(Eme,"createDFACache");var Ame=(By=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Gge(e.rules),this.dfas=Rme(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Cp(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Bu(c$({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Bu(f,p=>p[0]));if(eP(d,!1)&&!a){const f=kme(d,(p,g,m)=>(J$(g,y=>{y&&(p[y.tokenTypeIdx]=m,J$(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Ame,g=f===void 0?0:f.length;for(let y=0;yBu(f,p=>p[0]));if(eP(d)&&d[0][0]&&!a){const f=d[0],p=Act(f);if(p.length===1&&Nct(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=kme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,J$(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=H3.call(this,s,h,_me,o);return typeof f=="object"?!1:f===0}}},A(Fy,"LLStarLookaheadStrategy"),Fy);function eP(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}A(eP,"isLL1Sequence");function Rme(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;ngp(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Nme(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}E(Vde,"buildAmbiguityError");function Wde(t){if(t instanceof as)return"SUBRULE";if(t instanceof ya)return"OPTION";if(t instanceof _s)return"OR";if(t instanceof Zs)return"AT_LEAST_ONE";if(t instanceof Qs)return"AT_LEAST_ONE_SEP";if(t instanceof As)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Bn)return"CONSUME";throw Error("non exhaustive match")}E(Wde,"getProductionDslName");function Ude(t,e,r){const n=hnt(e.configs.elements,a=>a.state.transitions),i=knt(n.filter(a=>a instanceof dN).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}E(Ude,"buildAdaptivePredictError");function Hde(t,e){return t.edges[e.tokenTypeIdx]}E(Hde,"getExistingTargetState");function Yde(t,e,r){const n=new yN,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===RT){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Qde(a))for(const s of i)a.add(s);return a}E(Yde,"computeReachSet");function Xde(t,e){if(t instanceof dN&&_M(e,t.tokenType))return t.target}E(Xde,"getReachableTarget");function Kde(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}E(Kde,"getUniqueAlt");function wN(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}E(wN,"newDFAState");function CN(t,e,r,n){return n=kN(t,n),e.edges[r.tokenTypeIdx]=n,n}E(CN,"addDFAEdge");function kN(t,e){if(e===kE)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}E(kN,"addDFAState");function jde(t){const e=new yN,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};LT(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}E(rfe,"hasConflictingAltSet");function nfe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}E(nfe,"hasStateAssociatedWithOneAlt"),_x();var ife=(U1=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new SN(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new AE;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new SE(e.startOffset,e.image.length,qx(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new SE(a.startOffset,a.image.length,qx(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},E(U1,"CstNodeBuilder"),U1),EN=(H1=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},E(H1,"AbstractCstNode"),H1),SE=(Y1=class extends EN{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},E(Y1,"LeafCstNodeImpl"),Y1),AE=(X1=class extends EN{constructor(){super(...arguments),this.content=new $nt(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},E(X1,"CompositeCstNodeImpl"),X1),$nt=(up=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,up.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},E(up,"CstNodeContainer"),up),SN=(K1=class extends AE{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},E(K1,"RootCstNodeImpl"),K1),_E=Symbol("Datatype");function RE(t){return t.$type===_E}E(RE,"isDataTypeNode");var afe="​",sfe=E(t=>t.endsWith(afe)?t:t+afe,"withRuleSuffix"),AN=(j1=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new Bnt(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new ufe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},E(j1,"AbstractLangiumParser"),j1),ofe=(Z1=class extends AN{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new ife,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;ug(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(sfe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),ns(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===_E?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Kc(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(RE(u)){let h=i.image;Kc(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(RE(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):RE(e)?this.converter.convert(e.value,e.$cstNode):(V9(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Zd(e,Yc);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Jd(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},E(Z1,"LangiumParser"),Z1),lfe=(Q1=class{buildMismatchTokenMessage(e){return Lg.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Lg.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Lg.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Lg.buildEarlyExitMessage(e)}},E(Q1,"AbstractParserErrorMessageProvider"),Q1),_N=(J1=class extends lfe{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},E(J1,"LangiumParserErrorMessageProvider"),J1),cfe=(ey=class extends AN{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(sfe(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},E(ey,"LangiumCompletionParser"),ey),Pnt={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new _N},ufe=(ty=class extends TJe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Pnt,lookaheadStrategy:n?new GM({maxLookahead:r.maxLookahead}):new Ont({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},E(ty,"ChevrotainWrapper"),ty),Bnt=(ry=class extends ufe{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},E(ry,"ProfilerWrapper"),ry);function LE(t,e,r){return hfe({parser:e,tokens:r,ruleNames:new Map},t),e}E(LE,"createParser");function hfe(t,e){const r=mk(e,!1),n=gn(e.rules).filter(ns).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,_h(s,a.definition))}const i=gn(e.rules).filter(ug).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,dfe(t,a))}E(hfe,"buildRules");function dfe(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(mo(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:E(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=IE(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:E(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}E(dfe,"buildInfixRule");function _h(t,e,r=!1){let n;if(Kc(e))n=bfe(t,e);else if(mh(e))n=ffe(t,e);else if(Yc(e))n=_h(t,e.terminal);else if(Jd(e))n=RN(t,e);else if(jc(e))n=pfe(t,e);else if(V3(e))n=mfe(t,e);else if(sk(e))n=yfe(t,e);else if(tf(e))n=vfe(t,e);else if(j9(e)){const i=t.consume++;n=E(()=>t.parser.consume(i,kh,e),"method")}else throw new ck(e.$cstNode,`Unexpected element type: ${e.$type}`);return LN(t,r?void 0:IT(e),n,e.cardinality)}E(_h,"buildElement");function ffe(t,e){const r=gf(e);return()=>t.parser.action(r,e)}E(ffe,"buildAction");function pfe(t,e){const r=e.rule.ref;if(Qd(r)){const n=t.subrule++,i=ns(r)&&r.fragment,a=e.arguments.length>0?gfe(r,e.arguments):()=>({});let s;return o=>{s??(s=IE(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(mo(r)){const n=t.consume++,i=DE(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Th();else throw new ck(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}E(pfe,"buildRuleCall");function gfe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Zo(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Zo(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(X9(t)){const e=Zo(t.left),r=Zo(t.right);return n=>e(n)&&r(n)}else if(J9(t)){const e=Zo(t.value);return r=>!e(r)}else if(eD(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(H9(t)){const e=!!t.true;return()=>e}Th()}E(Zo,"buildPredicate");function mfe(t,e){if(e.elements.length===1)return _h(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:_h(t,i,!0)},s=IT(i);s&&(a.GATE=Zo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:E(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}E(mfe,"buildAlternatives");function yfe(t,e){if(e.elements.length===1)return _h(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:_h(t,o,!0)},u=IT(o);u&&(l.GATE=Zo(u)),r.push(l)}const n=t.or++,i=E((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=E(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:E(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=LN(t,IT(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}E(yfe,"buildUnorderedGroup");function vfe(t,e){const r=e.elements.map(n=>_h(t,n));return n=>r.forEach(i=>i(n))}E(vfe,"buildGroup");function IT(t){if(tf(t))return t.guardCondition}E(IT,"getGuardCondition");function RN(t,e,r=e.terminal){if(r)if(jc(r)&&ns(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=IE(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(jc(r)&&mo(r.rule.ref)){const n=t.consume++,i=DE(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Kc(r)){const n=t.consume++,i=DE(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=xk(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+gf(e.type.ref));return RN(t,e,i)}}E(RN,"buildCrossReference");function bfe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}E(bfe,"buildKeyword");function LN(t,e,r,n){const i=e&&Zo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:E(()=>r(s),"ALT"),GATE:E(()=>i(s),"GATE")},{ALT:YM(),GATE:E(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:E(()=>t.parser.atLeastOne(a,{DEF:E(()=>r(o),"DEF")}),"ALT"),GATE:E(()=>i(o),"GATE")},{ALT:YM(),GATE:E(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:E(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else Th()}E(LN,"wrap");function IE(t,e){const r=xfe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}E(IE,"getRule");function xfe(t,e){if(Qd(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ns(n);)(tf(n)||V3(n)||sk(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}E(xfe,"getRuleName");function DE(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}E(DE,"getToken");function IN(t){const e=t.Grammar,r=t.parser.Lexer,n=new cfe(t);return LE(e,n,r.definition),n.finalize(),n}E(IN,"createCompletionParser");function DN(t){const e=MN(t);return e.finalize(),e}E(DN,"createLangiumParser");function MN(t){const e=t.Grammar,r=t.parser.Lexer,n=new ofe(t);return LE(e,n,r.definition)}E(MN,"prepareLangiumParser");var ME=(ny=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=gn(mk(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(mo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Ux(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=gk(r)?ss.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Qd).flatMap(i=>Hc(i).filter(Kc)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(xg(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&kD("^"+a.source+"$",e.value)&&n.push(i),n},[])}},E(ny,"DefaultTokenBuilder"),ny),NN=(iy=class{convert(e,r){let n=r.grammarSource;if(Jd(n)&&(n=RD(n)),jc(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Zl.convertInt(r);case"STRING":return Zl.convertString(r);case"ID":return Zl.convertID(r)}switch((i=BD(e))==null?void 0:i.toLowerCase()){case"number":return Zl.convertNumber(r);case"boolean":return Zl.convertBoolean(r);case"bigint":return Zl.convertBigint(r);case"date":return Zl.convertDate(r);default:return r}}},E(iy,"DefaultValueConverter"),iy),Zl;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}E(NE,"delayNextTick");var OE=0,Tfe=10;function $E(){return OE=performance.now(),new Rn.CancellationTokenSource}E($E,"startCancelableOperation");function ON(t){Tfe=t}E(ON,"setInterruptionPeriod");var Ql=Symbol("OperationCancelled");function Pf(t){return t===Ql}E(Pf,"isOperationCancelled");async function ea(t){if(t===Rn.CancellationToken.None)return;const e=performance.now();if(e-OE>=Tfe&&(OE=e,await NE(),OE=performance.now()),t.isCancellationRequested)throw Ql}E(ea,"interruptAndCheck");var su=(ay=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},E(ay,"Deferred"),ay),wfe=(Bh=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Bh.isIncremental(n)){const i=BN(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=$N(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&PN(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},E(Bh,"FullTextDocument"),Bh),PE;(function(t){function e(i,a,s,o){return new wfe(i,a,s,o)}E(e,"create"),t.create=e;function r(i,a,s){if(i instanceof wfe)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}E(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=BE(a.map(Cfe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}E(n,"applyEdits"),t.applyEdits=n})(PE||(PE={}));function BE(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);BE(n,e),BE(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}E(BN,"getWellformedRange");function Cfe(t){const e=BN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}E(Cfe,"getWellformedEdit");var kfe;(()=>{var t={975:F=>{function A(M){if(typeof M!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(M))}E(A,"e");function R(M,I){for(var $,P="",B=0,q=-1,V=0,X=0;X<=M.length;++X){if(X2){var W=P.lastIndexOf("/");if(W!==P.length-1){W===-1?(P="",B=0):B=(P=P.slice(0,W)).length-1-P.lastIndexOf("/"),q=X,V=0;continue}}else if(P.length===2||P.length===1){P="",B=0,q=X,V=0;continue}}I&&(P.length>0?P+="/..":P="..",B=2)}else P.length>0?P+="/"+M.slice(q+1,X):P=M.slice(q+1,X),B=X-q-1;q=X,V=0}else $===46&&V!==-1?++V:V=-1}return P}E(R,"r");var N={resolve:E(function(){for(var M,I="",$=!1,P=arguments.length-1;P>=-1&&!$;P--){var B;P>=0?B=arguments[P]:(M===void 0&&(M=process.cwd()),B=M),A(B),B.length!==0&&(I=B+"/"+I,$=B.charCodeAt(0)===47)}return I=R(I,!$),$?I.length>0?"/"+I:"/":I.length>0?I:"."},"resolve"),normalize:E(function(M){if(A(M),M.length===0)return".";var I=M.charCodeAt(0)===47,$=M.charCodeAt(M.length-1)===47;return(M=R(M,!I)).length!==0||I||(M="."),M.length>0&&$&&(M+="/"),I?"/"+M:M},"normalize"),isAbsolute:E(function(M){return A(M),M.length>0&&M.charCodeAt(0)===47},"isAbsolute"),join:E(function(){if(arguments.length===0)return".";for(var M,I=0;I0&&(M===void 0?M=$:M+="/"+$)}return M===void 0?".":N.normalize(M)},"join"),relative:E(function(M,I){if(A(M),A(I),M===I||(M=N.resolve(M))===(I=N.resolve(I)))return"";for(var $=1;$X){if(I.charCodeAt(q+ie)===47)return I.slice(q+ie+1);if(ie===0)return I.slice(q+ie)}else B>X&&(M.charCodeAt($+ie)===47?W=ie:ie===0&&(W=0));break}var K=M.charCodeAt($+ie);if(K!==I.charCodeAt(q+ie))break;K===47&&(W=ie)}var se="";for(ie=$+W+1;ie<=P;++ie)ie!==P&&M.charCodeAt(ie)!==47||(se.length===0?se+="..":se+="/..");return se.length>0?se+I.slice(q+W):(q+=W,I.charCodeAt(q)===47&&++q,I.slice(q))},"relative"),_makeLong:E(function(M){return M},"_makeLong"),dirname:E(function(M){if(A(M),M.length===0)return".";for(var I=M.charCodeAt(0),$=I===47,P=-1,B=!0,q=M.length-1;q>=1;--q)if((I=M.charCodeAt(q))===47){if(!B){P=q;break}}else B=!1;return P===-1?$?"/":".":$&&P===1?"//":M.slice(0,P)},"dirname"),basename:E(function(M,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');A(M);var $,P=0,B=-1,q=!0;if(I!==void 0&&I.length>0&&I.length<=M.length){if(I.length===M.length&&I===M)return"";var V=I.length-1,X=-1;for($=M.length-1;$>=0;--$){var W=M.charCodeAt($);if(W===47){if(!q){P=$+1;break}}else X===-1&&(q=!1,X=$+1),V>=0&&(W===I.charCodeAt(V)?--V==-1&&(B=$):(V=-1,B=X))}return P===B?B=X:B===-1&&(B=M.length),M.slice(P,B)}for($=M.length-1;$>=0;--$)if(M.charCodeAt($)===47){if(!q){P=$+1;break}}else B===-1&&(q=!1,B=$+1);return B===-1?"":M.slice(P,B)},"basename"),extname:E(function(M){A(M);for(var I=-1,$=0,P=-1,B=!0,q=0,V=M.length-1;V>=0;--V){var X=M.charCodeAt(V);if(X!==47)P===-1&&(B=!1,P=V+1),X===46?I===-1?I=V:q!==1&&(q=1):I!==-1&&(q=-1);else if(!B){$=V+1;break}}return I===-1||P===-1||q===0||q===1&&I===P-1&&I===$+1?"":M.slice(I,P)},"extname"),format:E(function(M){if(M===null||typeof M!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof M);return(function(I,$){var P=$.dir||$.root,B=$.base||($.name||"")+($.ext||"");return P?P===$.root?P+B:P+"/"+B:B})(0,M)},"format"),parse:E(function(M){A(M);var I={root:"",dir:"",base:"",ext:"",name:""};if(M.length===0)return I;var $,P=M.charCodeAt(0),B=P===47;B?(I.root="/",$=1):$=0;for(var q=-1,V=0,X=-1,W=!0,ie=M.length-1,K=0;ie>=$;--ie)if((P=M.charCodeAt(ie))!==47)X===-1&&(W=!1,X=ie+1),P===46?q===-1?q=ie:K!==1&&(K=1):q!==-1&&(K=-1);else if(!W){V=ie+1;break}return q===-1||X===-1||K===0||K===1&&q===X-1&&q===V+1?X!==-1&&(I.base=I.name=V===0&&B?M.slice(1,X):M.slice(V,X)):(V===0&&B?(I.name=M.slice(1,q),I.base=M.slice(1,X)):(I.name=M.slice(V,q),I.base=M.slice(V,X)),I.ext=M.slice(q,X)),V>0?I.dir=M.slice(0,V-1):B&&(I.dir="/"),I},"parse"),sep:"/",delimiter:":",win32:null,posix:null};N.posix=N,F.exports=N}},e={};function r(F){var A=e[F];if(A!==void 0)return A.exports;var R=e[F]={exports:{}};return t[F](R,R.exports,r),R.exports}E(r,"r"),r.d=(F,A)=>{for(var R in A)r.o(A,R)&&!r.o(F,R)&&Object.defineProperty(F,R,{enumerable:!0,get:A[R]})},r.o=(F,A)=>Object.prototype.hasOwnProperty.call(F,A),r.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:E(()=>f,"URI"),Utils:E(()=>O,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(F,A){if(!F.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!a.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!s.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}E(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,D=class D{constructor(A,R,N,M,I,$=!1){Hr(this,"scheme");Hr(this,"authority");Hr(this,"path");Hr(this,"query");Hr(this,"fragment");typeof A=="object"?(this.scheme=A.scheme||u,this.authority=A.authority||u,this.path=A.path||u,this.query=A.query||u,this.fragment=A.fragment||u):(this.scheme=(function(P,B){return P||B?P:"file"})(A,$),this.authority=R||u,this.path=(function(P,B){switch(P){case"https":case"http":case"file":B?B[0]!==h&&(B=h+B):B=h}return B})(this.scheme,N||u),this.query=M||u,this.fragment=I||u,l(this,$))}static isUri(A){return A instanceof D||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}get fsPath(){return x(this,!1)}with(A){if(!A)return this;let{scheme:R,authority:N,path:M,query:I,fragment:$}=A;return R===void 0?R=this.scheme:R===null&&(R=u),N===void 0?N=this.authority:N===null&&(N=u),M===void 0?M=this.path:M===null&&(M=u),I===void 0?I=this.query:I===null&&(I=u),$===void 0?$=this.fragment:$===null&&($=u),R===this.scheme&&N===this.authority&&M===this.path&&I===this.query&&$===this.fragment?this:new g(R,N,M,I,$)}static parse(A,R=!1){const N=d.exec(A);return N?new g(N[2]||u,S(N[4]||u),S(N[5]||u),S(N[7]||u),S(N[9]||u),R):new g(u,u,u,u,u)}static file(A){let R=u;if(i&&(A=A.replace(/\\/g,h)),A[0]===h&&A[1]===h){const N=A.indexOf(h,2);N===-1?(R=A.substring(2),A=h):(R=A.substring(2,N),A=A.substring(N)||h)}return new g("file",R,A,u,u)}static from(A){const R=new g(A.scheme,A.authority,A.path,A.query,A.fragment);return l(R,!0),R}toString(A=!1){return b(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof D)return A;{const R=new g(A);return R._formatted=A.external,R._fsPath=A._sep===p?A.fsPath:null,R}}return A}};E(D,"l");let f=D;const p=i?1:void 0,z=class z extends f{constructor(){super(...arguments);Hr(this,"_formatted",null);Hr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(R=!1){return R?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};E(z,"d");let g=z;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(F,A,R){let N,M=-1;for(let I=0;I=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===45||$===46||$===95||$===126||A&&$===47||R&&$===91||R&&$===93||R&&$===58)M!==-1&&(N+=encodeURIComponent(F.substring(M,I)),M=-1),N!==void 0&&(N+=F.charAt(I));else{N===void 0&&(N=F.substr(0,I));const P=m[$];P!==void 0?(M!==-1&&(N+=encodeURIComponent(F.substring(M,I)),M=-1),N+=P):M===-1&&(M=I)}}return M!==-1&&(N+=encodeURIComponent(F.substring(M))),N!==void 0?N:F}E(y,"m");function v(F){let A;for(let R=0;R1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?A?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,i&&(R=R.replace(/\//g,"\\")),R}E(x,"v");function b(F,A){const R=A?v:y;let N="",{scheme:M,authority:I,path:$,query:P,fragment:B}=F;if(M&&(N+=M,N+=":"),(I||M==="file")&&(N+=h,N+=h),I){let q=I.indexOf("@");if(q!==-1){const V=I.substr(0,q);I=I.substr(q+1),q=V.lastIndexOf(":"),q===-1?N+=R(V,!1,!1):(N+=R(V.substr(0,q),!1,!1),N+=":",N+=R(V.substr(q+1),!1,!0)),N+="@"}I=I.toLowerCase(),q=I.lastIndexOf(":"),q===-1?N+=R(I,!1,!0):(N+=R(I.substr(0,q),!1,!0),N+=I.substr(q))}if($){if($.length>=3&&$.charCodeAt(0)===47&&$.charCodeAt(2)===58){const q=$.charCodeAt(1);q>=65&&q<=90&&($=`/${String.fromCharCode(q+32)}:${$.substr(3)}`)}else if($.length>=2&&$.charCodeAt(1)===58){const q=$.charCodeAt(0);q>=65&&q<=90&&($=`${String.fromCharCode(q+32)}:${$.substr(2)}`)}N+=R($,!0,!1)}return P&&(N+="?",N+=R(P,!1,!1)),B&&(N+="#",N+=A?B:y(B,!1,!1)),N}E(b,"b");function w(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+w(F.substr(3)):F}}E(w,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(F){return F.match(k)?F.replace(k,(A=>w(A))):F}E(S,"w");var C=r(975);const _=C.posix||C,L="/";var O;(function(F){F.joinPath=function(A,...R){return A.with({path:_.join(A.path,...R)})},F.resolvePath=function(A,...R){let N=A.path,M=!1;N[0]!==L&&(N=L+N,M=!0);let I=_.resolve(N,...R);return M&&I[0]===L&&!A.authority&&(I=I.substring(1)),A.with({path:I})},F.dirname=function(A){if(A.path.length===0||A.path===L)return A;let R=_.dirname(A.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),A.with({path:R})},F.basename=function(A){return _.basename(A.path)},F.extname=function(A){return _.extname(A.path)}})(O||(O={})),kfe=n})();var{URI:Js,Utils:DT}=kfe,cs;(function(t){t.basename=DT.basename,t.dirname=DT.dirname,t.extname=DT.extname,t.joinPath=DT.joinPath,t.resolvePath=DT.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}E(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Js.parse(s).path:s.path,u=typeof o=="string"?Js.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:cs.joinPath(Js.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(cs.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},E(sy,"UriTrie"),sy),zr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(zr||(zr={}));var Efe=(oy=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Rn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Js.parse(e.uri),Rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:zr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:zr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=zr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=PE.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},E(oy,"DefaultLangiumDocumentFactory"),oy),Sfe=(ly=class{constructor(e){this.documentTrie=new FN,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return gn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,zr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=zr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=zr.Changed;return this.documentTrie.delete(r),n}},E(ly,"DefaultLangiumDocuments"),ly),Bf=Symbol("RefResolving"),Afe=(cy=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Rn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Vo(e.parseResult.value))await ea(r),lg(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Vo(e.parseResult.value))await ea(r),lg(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Bf;try{const i=this.getCandidate(e);if(Kd(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Bf;try{const i=this.getCandidates(e),a=[];if(Kd(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Ai(this._ref))return this._ref;if(z9(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Bf;const o=og(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Kd(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=og(e.container).$document;n&&n.stateJd(r)&&r.isMulti)}findDeclarations(e){if(e){const r=MD(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ts(i)||Gl(i))return F3(i);if(Array.isArray(i)){for(const a of i)if((ts(a)||Gl(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return F3(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||uD(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of lg(n))if(Gl(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>cs.equals(a.sourceUri,r.documentUri))),n.push(...i),gn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=qo(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:vg(a),local:!0})}}return n}},E(hy,"DefaultReferences"),hy),ou=(dy=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Ix.sum(gn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?gn(r):ig}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return gn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return gn(this.map.keys())}values(){return gn(this.map.values()).flat()}entriesGroupedByKey(){return gn(this.map.entries())}},E(dy,"MultiMap"),dy),FE=(fy=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},E(fy,"BiMap"),fy),Lfe=(py=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Rn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Dx,i=Rn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await ea(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Rn.CancellationToken.None){const n=e.parseResult.value,i=new ou;for(const a of Hc(n))await ea(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},E(py,"DefaultScopeComputation"),py),GN=(gy=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},E(gy,"StreamScope"),gy),Fnt=(my=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?gn(i).concat(this.outerScope.getElements(e)):gn(i)}getAllElements(){let e=gn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(my,"MapScope"),my),Ife=(yy=class{constructor(e,r,n){this.elements=new ou,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?gn(n).concat(this.outerScope.getElements(e)):gn(n)}getAllElements(){let e=gn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(yy,"MultiMapScope"),yy),znt={getElement(){},getElements(){return ig},getAllElements(){return ig}},zE=(vy=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E(vy,"DisposableCache"),vy),qN=(by=class extends zE{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},E(by,"SimpleCache"),by),GE=(xy=class extends zE{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},E(xy,"ContextCache"),xy),Dfe=(Ty=class extends GE{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},E(Ty,"DocumentCache"),Ty),VN=(wy=class extends qN{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},E(wy,"WorkspaceCache"),wy),Mfe=(Cy=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new VN(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qo(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new GN(gn(e),r,n)}createScopeForNodes(e,r,n){const i=gn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new GN(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Ife(this.indexManager.allElements(e)))}},E(Cy,"DefaultScopeProvider"),Cy);function WN(t){return typeof t.$comment=="string"}E(WN,"isAstNodeWithComment");function UN(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}E(UN,"isIntermediateReference");var Nfe=(ky=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=E((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=qo(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(ts(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=qo(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Gl(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qo(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Ai(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=E(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=ID(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pf(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=gn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},E(Sy,"ValidationRegistry"),Sy),Pfe=Object.freeze({validateNode:!0,validateChildren:!0}),Bfe=(Ay=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Rn.CancellationToken.None){const i=e.parseResult,a=[];if(await ea(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===To.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===To.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===To.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pf(s))throw s;console.error("An error occurred during validation:",s)}return await ea(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:MT(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:YN(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=qx(i.token);if(a){const s={severity:MT("error"),range:a,message:i.message,data:Ff(To.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:To.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Rn.CancellationToken.None){const i=[],a=E((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Rn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ea(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Rn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Vo(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Vo(e).iterator();for(const o of s){await ea(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return Pfe}async validateAstAfter(e,r,n,i=Rn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ea(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:HN(n),severity:MT(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},E(Ay,"DefaultDocumentValidator"),Ay);function HN(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=yk(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=DD(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}E(HN,"getDiagnosticRange");function MT(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}E(MT,"toDiagnosticSeverity");function YN(t){switch(t){case"error":return Ff(To.LexingError);case"warning":return Ff(To.LexingWarning);case"info":return Ff(To.LexingInfo);case"hint":return Ff(To.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}E(YN,"toDiagnosticData");var To;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(To||(To={}));var Ffe=(_y=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qo(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=E(()=>s??(s=vg(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:vg(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},E(_y,"DefaultAstNodeDescriptionProvider"),_y),zfe=(Ry=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Rn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Vo(i))await ea(r),lg(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];ts(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Gl(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qo(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=vg(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:cs.equals(l.documentUri,i)});return s}},E(Ry,"DefaultReferenceDescriptionProvider"),Ry),Gfe=(Ly=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},E(Ly,"DefaultAstNodeLocator"),Ly),VE={};_3(VE,NI(rg()));var qfe=(Iy=class{constructor(e){this._ready=new su,this.onConfigurationSectionUpdateEmitter=new VE.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},E(Iy,"DefaultConfigurationProvider"),Iy),WE=NI(vHe()),zf;(function(t){function e(r){return{dispose:E(async()=>await r(),"dispose")}}E(e,"create"),t.create=e})(zf||(zf={}));var Vfe=(Dy=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new ou,this.documentPhaseListeners=new ou,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=zr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Rn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===zr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,zr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=zr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=zr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Rn.CancellationToken.None){this.currentState=zr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=zr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,zr.Changed)}const s=gn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,zr.ComputedScopes)),await this.emitUpdate(a,i),await ea(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return gn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),zf.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case zr.Changed:case zr.Parsed:this.indexManager.removeContent(e.uri);case zr.IndexedContent:e.localSymbols=void 0;case zr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case zr.Linked:this.indexManager.removeReferences(e.uri);case zr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case zr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=zr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,zr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,zr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,zr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,zr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,zr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,zr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),zf.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),zf.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Rn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Ql);if(this.currentState>=e&&e>i.state)return Promise.reject(new WE.ResponseError(WE.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${zr[i.state]}, requiring ${zr[e]}, but workspace state is already ${zr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new WE.ResponseError(WE.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{cs.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Ql)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Ql):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Ql)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await ea(n),await s(e,n)}catch(o){if(!Pf(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ea(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=gn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},E(Dy,"DefaultDocumentBuilder"),Dy),Wfe=(My=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new GE,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qo(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{cs.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),gn(i)}allElements(e,r){let n=gn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},E(My,"DefaultIndexManager"),My),Ufe=(Ny=class{constructor(e){this.initialBuildOptions={},this._ready=new su,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Rn.CancellationToken.None){const n=await this.performStartup(e);await ea(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=E(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=gn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Js.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=cs.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},E(Ny,"DefaultWorkspaceManager"),Ny),Hfe=(Oy=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return SM.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return SM.buildUnableToPopLexerModeMessage(e)}},E(Oy,"DefaultLexerErrorMessageProvider"),Oy),XN={mode:"full"},KN=($y=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=YE(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ss(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=XN){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(YE(e))return e;const r=HE(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},E($y,"DefaultLexer"),$y);function UE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}E(UE,"isTokenTypeArray");function HE(t){return t&&"modes"in t&&"defaultMode"in t}E(HE,"isIMultiModeLexerDefinition");function YE(t){return!UE(t)&&!HE(t)}E(YE,"isTokenTypeDictionary"),_x();function jN(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=on.create(0,0));const a=QN(t),s=KE(n),o=Xfe({lines:a,position:i,options:s});return Zfe({index:0,tokens:o,position:i})}E(jN,"parseJSDoc");function ZN(t,e){const r=KE(e),n=QN(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}E(ZN,"isJSDoc");function QN(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Ire)}E(QN,"getLines");var Yfe=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Gnt=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Xfe(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=on.create(r,n);e.push({type:"break",content:"",range:Ur.create(p,p)})}}else{Yfe.lastIndex=d;const p=Yfe.exec(h);if(p){const g=p[0],m=p[1],y=on.create(r,n+d),v=on.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ur.create(y,v)}),d+=g.length,d=XE(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}E(Xfe,"tokenize");function Kfe(t,e,r,n){const i=[];if(t.length===0){const a=on.create(r,n),s=on.create(r,n+e.length);i.push({type:"text",content:e,range:Ur.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ur.create(on.create(r,a+n),on.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Ur.create(on.create(r,a+h+n),on.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Ur.create(on.create(r,a+h+n),on.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ur.create(on.create(r,a+h+n),on.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Ur.create(on.create(r,a+n),on.create(r,a+n+s.length))})}return i}E(Kfe,"buildInlineTokens");var qnt=/\S/,Vnt=/\s*$/;function XE(t,e){const r=t.substring(e).match(qnt);return r?e+r.index:t.length}E(XE,"skipWhitespace");function jfe(t){const e=t.match(Vnt);if(e&&typeof e.index=="number")return e.index}E(jfe,"lastCharacter");function Zfe(t){var a,s;const e=on.create(t.position.line,t.position.character);if(t.tokens.length===0)return new tpe([],Ur.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=iO(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=iO(r)+i}return r.trim()}},E(Py,"JSDocCommentImpl"),Py),rO=(By=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} -${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=rpe(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} -${r}`),this.inline?`{${i}}`:i}},E(By,"JSDocTagImpl"),By);function rpe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=XE(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??npe(e,a)}}E(rpe,"renderInlineTag");function npe(t,e){try{return Js.parse(t,!0),`[${e}](${t})`}catch{return t}}E(npe,"renderLinkDefault");var nO=(Fy=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}A(Dme,"buildAmbiguityError");function Nme(t){if(t instanceof _s)return"SUBRULE";if(t instanceof Fa)return"OPTION";if(t instanceof Qs)return"OR";if(t instanceof Co)return"AT_LEAST_ONE";if(t instanceof So)return"AT_LEAST_ONE_SEP";if(t instanceof Zs)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof si)return"CONSUME";throw Error("non exhaustive match")}A(Nme,"getProductionDslName");function Ome(t,e,r){const n=fct(e.configs.elements,a=>a.state.transitions),i=Ect(n.filter(a=>a instanceof U$).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}A(Ome,"buildAdaptivePredictError");function $me(t,e){return t.edges[e.tokenTypeIdx]}A($me,"getExistingTargetState");function Pme(t,e,r){const n=new K$,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ew){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Wme(a))for(const s of i)a.add(s);return a}A(Pme,"computeReachSet");function Bme(t,e){if(t instanceof U$&&o$(e,t.tokenType))return t.target}A(Bme,"getReachableTarget");function Fme(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}A(Fme,"getUniqueAlt");function tP(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}A(tP,"newDFAState");function rP(t,e,r,n){return n=nP(t,n),e.edges[r.tokenTypeIdx]=n,n}A(rP,"addDFAEdge");function nP(t,e){if(e===U3)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}A(nP,"addDFAState");function zme(t){const e=new K$,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Aw(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}A(Hme,"hasConflictingAltSet");function Yme(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}A(Yme,"hasStateAssociatedWithOneAlt"),kT();var Xme=(zy=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new aP(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new X3;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Y3(e.startOffset,e.image.length,FT(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Y3(a.startOffset,a.image.length,FT(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},A(zy,"CstNodeBuilder"),zy),iP=(Gy=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},A(Gy,"AbstractCstNode"),Gy),Y3=(Wy=class extends iP{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},A(Wy,"LeafCstNodeImpl"),Wy),X3=(qy=class extends iP{constructor(){super(...arguments),this.content=new Bct(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},A(qy,"CompositeCstNodeImpl"),qy),Bct=(Jp=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Jp.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},A(Jp,"CstNodeContainer"),Jp),aP=(Vy=class extends X3{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},A(Vy,"RootCstNodeImpl"),Vy),j3=Symbol("Datatype");function K3(t){return t.$type===j3}A(K3,"isDataTypeNode");var jme="​",Kme=A(t=>t.endsWith(jme)?t:t+jme,"withRuleSuffix"),sP=(Uy=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new zct(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new e1e(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},A(Uy,"AbstractLangiumParser"),Uy),Zme=(Hy=class extends sP{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Xme,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;tm(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Kme(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Es(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===j3?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Ru(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(K3(u)){let h=i.image;Ru(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(K3(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):K3(e)?this.converter.convert(e.value,e.$cstNode):(w9(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=zf(e,Au);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Wf(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},A(Hy,"LangiumParser"),Hy),Qme=(Yy=class{buildMismatchTokenMessage(e){return Tm.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Tm.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Tm.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Tm.buildEarlyExitMessage(e)}},A(Yy,"AbstractParserErrorMessageProvider"),Yy),oP=(Xy=class extends Qme{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},A(Xy,"LangiumParserErrorMessageProvider"),Xy),Jme=(jy=class extends sP{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Kme(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},A(jy,"LangiumCompletionParser"),jy),Fct={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new oP},e1e=(Ky=class extends kat{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Fct,lookaheadStrategy:n?new x$({maxLookahead:r.maxLookahead}):new Pct({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},A(Ky,"ChevrotainWrapper"),Ky),zct=(Zy=class extends e1e{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},A(Zy,"ProfilerWrapper"),Zy);function Z3(t,e,r){return t1e({parser:e,tokens:r,ruleNames:new Map},t),e}A(Z3,"createParser");function t1e(t,e){const r=P5(e,!1),n=Mn(e.rules).filter(Es).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,ud(s,a.definition))}const i=Mn(e.rules).filter(tm).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,r1e(t,a))}A(t1e,"buildRules");function r1e(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Wo(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:A(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=Q3(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:A(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}A(r1e,"buildInfixRule");function ud(t,e,r=!1){let n;if(Ru(e))n=c1e(t,e);else if(Qh(e))n=n1e(t,e);else if(Au(e))n=ud(t,e.terminal);else if(Wf(e))n=lP(t,e);else if(Lu(e))n=i1e(t,e);else if(u5(e))n=s1e(t,e);else if(A5(e))n=o1e(t,e);else if(Vf(e))n=l1e(t,e);else if(R9(e)){const i=t.consume++;n=A(()=>t.parser.consume(i,sd,e),"method")}else throw new L5(e.$cstNode,`Unexpected element type: ${e.$type}`);return cP(t,r?void 0:_w(e),n,e.cardinality)}A(ud,"buildElement");function n1e(t,e){const r=np(e);return()=>t.parser.action(r,e)}A(n1e,"buildAction");function i1e(t,e){const r=e.rule.ref;if(Gf(r)){const n=t.subrule++,i=Es(r)&&r.fragment,a=e.arguments.length>0?a1e(r,e.arguments):()=>({});let s;return o=>{s??(s=Q3(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Wo(r)){const n=t.consume++,i=J3(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)nd();else throw new L5(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}A(i1e,"buildRuleCall");function a1e(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Al(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Al(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(A9(t)){const e=Al(t.left),r=Al(t.right);return n=>e(n)&&r(n)}else if(M9(t)){const e=Al(t.value);return r=>!e(r)}else if(D9(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(k9(t)){const e=!!t.true;return()=>e}nd()}A(Al,"buildPredicate");function s1e(t,e){if(e.elements.length===1)return ud(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:ud(t,i,!0)},s=_w(i);s&&(a.GATE=Al(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:A(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}A(s1e,"buildAlternatives");function o1e(t,e){if(e.elements.length===1)return ud(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:ud(t,o,!0)},u=_w(o);u&&(l.GATE=Al(u)),r.push(l)}const n=t.or++,i=A((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=A(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:A(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=cP(t,_w(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}A(o1e,"buildUnorderedGroup");function l1e(t,e){const r=e.elements.map(n=>ud(t,n));return n=>r.forEach(i=>i(n))}A(l1e,"buildGroup");function _w(t){if(Vf(t))return t.guardCondition}A(_w,"getGuardCondition");function lP(t,e,r=e.terminal){if(r)if(Lu(r)&&Es(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Q3(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Lu(r)&&Wo(r.rule.ref)){const n=t.consume++,i=J3(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Ru(r)){const n=t.consume++,i=J3(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=G5(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+np(e.type.ref));return lP(t,e,i)}}A(lP,"buildCrossReference");function c1e(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}A(c1e,"buildKeyword");function cP(t,e,r,n){const i=e&&Al(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:A(()=>r(s),"ALT"),GATE:A(()=>i(s),"GATE")},{ALT:E$(),GATE:A(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:A(()=>t.parser.atLeastOne(a,{DEF:A(()=>r(o),"DEF")}),"ALT"),GATE:A(()=>i(o),"GATE")},{ALT:E$(),GATE:A(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:A(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else nd()}A(cP,"wrap");function Q3(t,e){const r=u1e(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}A(Q3,"getRule");function u1e(t,e){if(Gf(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Es(n);)(Vf(n)||u5(n)||A5(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}A(u1e,"getRuleName");function J3(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}A(J3,"getToken");function uP(t){const e=t.Grammar,r=t.parser.Lexer,n=new Jme(t);return Z3(e,n,r.definition),n.finalize(),n}A(uP,"createCompletionParser");function hP(t){const e=dP(t);return e.finalize(),e}A(hP,"createLangiumParser");function dP(t){const e=t.Grammar,r=t.parser.Lexer,n=new Zme(t);return Z3(e,n,r.definition)}A(dP,"prepareLangiumParser");var eA=(Qy=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Mn(P5(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Wo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=WT(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=$5(r)?Rs.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Gf).flatMap(i=>Eu(i).filter(Ru)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(hm(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&nO("^"+a.source+"$",e.value)&&n.push(i),n},[])}},A(Qy,"DefaultTokenBuilder"),Qy),fP=(Jy=class{convert(e,r){let n=r.grammarSource;if(Wf(n)&&(n=lO(n)),Lu(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Ec.convertInt(r);case"STRING":return Ec.convertString(r);case"ID":return Ec.convertID(r)}switch((i=yO(e))==null?void 0:i.toLowerCase()){case"number":return Ec.convertNumber(r);case"boolean":return Ec.convertBoolean(r);case"bigint":return Ec.convertBigint(r);case"date":return Ec.convertDate(r);default:return r}}},A(Jy,"DefaultValueConverter"),Jy),Ec;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}A(tA,"delayNextTick");var rA=0,h1e=10;function nA(){return rA=performance.now(),new Kn.CancellationTokenSource}A(nA,"startCancelableOperation");function pP(t){h1e=t}A(pP,"setInterruptionPeriod");var Ac=Symbol("OperationCancelled");function kp(t){return t===Ac}A(kp,"isOperationCancelled");async function Ta(t){if(t===Kn.CancellationToken.None)return;const e=performance.now();if(e-rA>=h1e&&(rA=e,await tA(),rA=performance.now()),t.isCancellationRequested)throw Ac}A(Ta,"interruptAndCheck");var zu=(ev=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},A(ev,"Deferred"),ev),d1e=(Td=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Td.isIncremental(n)){const i=yP(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=gP(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&mP(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},A(Td,"FullTextDocument"),Td),iA;(function(t){function e(i,a,s,o){return new d1e(i,a,s,o)}A(e,"create"),t.create=e;function r(i,a,s){if(i instanceof d1e)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}A(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=aA(a.map(f1e),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}A(n,"applyEdits"),t.applyEdits=n})(iA||(iA={}));function aA(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);aA(n,e),aA(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}A(yP,"getWellformedRange");function f1e(t){const e=yP(t.range);return e!==t.range?{newText:t.newText,range:e}:t}A(f1e,"getWellformedEdit");var p1e;(()=>{var t={975:$=>{function _(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}A(_,"e");function R(D,N){for(var B,F="",G=0,z=-1,W=0,V=0;V<=D.length;++V){if(V2){var H=F.lastIndexOf("/");if(H!==F.length-1){H===-1?(F="",G=0):G=(F=F.slice(0,H)).length-1-F.lastIndexOf("/"),z=V,W=0;continue}}else if(F.length===2||F.length===1){F="",G=0,z=V,W=0;continue}}N&&(F.length>0?F+="/..":F="..",G=2)}else F.length>0?F+="/"+D.slice(z+1,V):F=D.slice(z+1,V),G=V-z-1;z=V,W=0}else B===46&&W!==-1?++W:W=-1}return F}A(R,"r");var O={resolve:A(function(){for(var D,N="",B=!1,F=arguments.length-1;F>=-1&&!B;F--){var G;F>=0?G=arguments[F]:(D===void 0&&(D=process.cwd()),G=D),_(G),G.length!==0&&(N=G+"/"+N,B=G.charCodeAt(0)===47)}return N=R(N,!B),B?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:A(function(D){if(_(D),D.length===0)return".";var N=D.charCodeAt(0)===47,B=D.charCodeAt(D.length-1)===47;return(D=R(D,!N)).length!==0||N||(D="."),D.length>0&&B&&(D+="/"),N?"/"+D:D},"normalize"),isAbsolute:A(function(D){return _(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:A(function(){if(arguments.length===0)return".";for(var D,N=0;N0&&(D===void 0?D=B:D+="/"+B)}return D===void 0?".":O.normalize(D)},"join"),relative:A(function(D,N){if(_(D),_(N),D===N||(D=O.resolve(D))===(N=O.resolve(N)))return"";for(var B=1;BV){if(N.charCodeAt(z+te)===47)return N.slice(z+te+1);if(te===0)return N.slice(z+te)}else G>V&&(D.charCodeAt(B+te)===47?H=te:te===0&&(H=0));break}var Y=D.charCodeAt(B+te);if(Y!==N.charCodeAt(z+te))break;Y===47&&(H=te)}var se="";for(te=B+H+1;te<=F;++te)te!==F&&D.charCodeAt(te)!==47||(se.length===0?se+="..":se+="/..");return se.length>0?se+N.slice(z+H):(z+=H,N.charCodeAt(z)===47&&++z,N.slice(z))},"relative"),_makeLong:A(function(D){return D},"_makeLong"),dirname:A(function(D){if(_(D),D.length===0)return".";for(var N=D.charCodeAt(0),B=N===47,F=-1,G=!0,z=D.length-1;z>=1;--z)if((N=D.charCodeAt(z))===47){if(!G){F=z;break}}else G=!1;return F===-1?B?"/":".":B&&F===1?"//":D.slice(0,F)},"dirname"),basename:A(function(D,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');_(D);var B,F=0,G=-1,z=!0;if(N!==void 0&&N.length>0&&N.length<=D.length){if(N.length===D.length&&N===D)return"";var W=N.length-1,V=-1;for(B=D.length-1;B>=0;--B){var H=D.charCodeAt(B);if(H===47){if(!z){F=B+1;break}}else V===-1&&(z=!1,V=B+1),W>=0&&(H===N.charCodeAt(W)?--W==-1&&(G=B):(W=-1,G=V))}return F===G?G=V:G===-1&&(G=D.length),D.slice(F,G)}for(B=D.length-1;B>=0;--B)if(D.charCodeAt(B)===47){if(!z){F=B+1;break}}else G===-1&&(z=!1,G=B+1);return G===-1?"":D.slice(F,G)},"basename"),extname:A(function(D){_(D);for(var N=-1,B=0,F=-1,G=!0,z=0,W=D.length-1;W>=0;--W){var V=D.charCodeAt(W);if(V!==47)F===-1&&(G=!1,F=W+1),V===46?N===-1?N=W:z!==1&&(z=1):N!==-1&&(z=-1);else if(!G){B=W+1;break}}return N===-1||F===-1||z===0||z===1&&N===F-1&&N===B+1?"":D.slice(N,F)},"extname"),format:A(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function(N,B){var F=B.dir||B.root,G=B.base||(B.name||"")+(B.ext||"");return F?F===B.root?F+G:F+"/"+G:G})(0,D)},"format"),parse:A(function(D){_(D);var N={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return N;var B,F=D.charCodeAt(0),G=F===47;G?(N.root="/",B=1):B=0;for(var z=-1,W=0,V=-1,H=!0,te=D.length-1,Y=0;te>=B;--te)if((F=D.charCodeAt(te))!==47)V===-1&&(H=!1,V=te+1),F===46?z===-1?z=te:Y!==1&&(Y=1):z!==-1&&(Y=-1);else if(!H){W=te+1;break}return z===-1||V===-1||Y===0||Y===1&&z===V-1&&z===W+1?V!==-1&&(N.base=N.name=W===0&&G?D.slice(1,V):D.slice(W,V)):(W===0&&G?(N.name=D.slice(1,z),N.base=D.slice(1,V)):(N.name=D.slice(W,z),N.base=D.slice(W,V)),N.ext=D.slice(z,V)),W>0?N.dir=D.slice(0,W-1):G&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};O.posix=O,$.exports=O}},e={};function r($){var _=e[$];if(_!==void 0)return _.exports;var R=e[$]={exports:{}};return t[$](R,R.exports,r),R.exports}A(r,"r"),r.d=($,_)=>{for(var R in _)r.o(_,R)&&!r.o($,R)&&Object.defineProperty($,R,{enumerable:!0,get:_[R]})},r.o=($,_)=>Object.prototype.hasOwnProperty.call($,_),r.r=$=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:A(()=>f,"URI"),Utils:A(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l($,_){if(!$.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${$.authority}", path: "${$.path}", query: "${$.query}", fragment: "${$.fragment}"}`);if($.scheme&&!a.test($.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if($.path){if($.authority){if(!s.test($.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test($.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}A(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,I=class I{constructor(_,R,O,D,N,B=!1){un(this,"scheme");un(this,"authority");un(this,"path");un(this,"query");un(this,"fragment");typeof _=="object"?(this.scheme=_.scheme||u,this.authority=_.authority||u,this.path=_.path||u,this.query=_.query||u,this.fragment=_.fragment||u):(this.scheme=(function(F,G){return F||G?F:"file"})(_,B),this.authority=R||u,this.path=(function(F,G){switch(F){case"https":case"http":case"file":G?G[0]!==h&&(G=h+G):G=h}return G})(this.scheme,O||u),this.query=D||u,this.fragment=N||u,l(this,B))}static isUri(_){return _ instanceof I||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}get fsPath(){return T(this,!1)}with(_){if(!_)return this;let{scheme:R,authority:O,path:D,query:N,fragment:B}=_;return R===void 0?R=this.scheme:R===null&&(R=u),O===void 0?O=this.authority:O===null&&(O=u),D===void 0?D=this.path:D===null&&(D=u),N===void 0?N=this.query:N===null&&(N=u),B===void 0?B=this.fragment:B===null&&(B=u),R===this.scheme&&O===this.authority&&D===this.path&&N===this.query&&B===this.fragment?this:new g(R,O,D,N,B)}static parse(_,R=!1){const O=d.exec(_);return O?new g(O[2]||u,k(O[4]||u),k(O[5]||u),k(O[7]||u),k(O[9]||u),R):new g(u,u,u,u,u)}static file(_){let R=u;if(i&&(_=_.replace(/\\/g,h)),_[0]===h&&_[1]===h){const O=_.indexOf(h,2);O===-1?(R=_.substring(2),_=h):(R=_.substring(2,O),_=_.substring(O)||h)}return new g("file",R,_,u,u)}static from(_){const R=new g(_.scheme,_.authority,_.path,_.query,_.fragment);return l(R,!0),R}toString(_=!1){return x(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof I)return _;{const R=new g(_);return R._formatted=_.external,R._fsPath=_._sep===p?_.fsPath:null,R}}return _}};A(I,"l");let f=I;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);un(this,"_formatted",null);un(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(R=!1){return R?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};A(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y($,_,R){let O,D=-1;for(let N=0;N<$.length;N++){const B=$.charCodeAt(N);if(B>=97&&B<=122||B>=65&&B<=90||B>=48&&B<=57||B===45||B===46||B===95||B===126||_&&B===47||R&&B===91||R&&B===93||R&&B===58)D!==-1&&(O+=encodeURIComponent($.substring(D,N)),D=-1),O!==void 0&&(O+=$.charAt(N));else{O===void 0&&(O=$.substr(0,N));const F=m[B];F!==void 0?(D!==-1&&(O+=encodeURIComponent($.substring(D,N)),D=-1),O+=F):D===-1&&(D=N)}}return D!==-1&&(O+=encodeURIComponent($.substring(D))),O!==void 0?O:$}A(y,"m");function v($){let _;for(let R=0;R<$.length;R++){const O=$.charCodeAt(R);O===35||O===63?(_===void 0&&(_=$.substr(0,R)),_+=m[O]):_!==void 0&&(_+=$[R])}return _!==void 0?_:$}A(v,"y");function T($,_){let R;return R=$.authority&&$.path.length>1&&$.scheme==="file"?`//${$.authority}${$.path}`:$.path.charCodeAt(0)===47&&($.path.charCodeAt(1)>=65&&$.path.charCodeAt(1)<=90||$.path.charCodeAt(1)>=97&&$.path.charCodeAt(1)<=122)&&$.path.charCodeAt(2)===58?_?$.path.substr(1):$.path[1].toLowerCase()+$.path.substr(2):$.path,i&&(R=R.replace(/\//g,"\\")),R}A(T,"v");function x($,_){const R=_?v:y;let O="",{scheme:D,authority:N,path:B,query:F,fragment:G}=$;if(D&&(O+=D,O+=":"),(N||D==="file")&&(O+=h,O+=h),N){let z=N.indexOf("@");if(z!==-1){const W=N.substr(0,z);N=N.substr(z+1),z=W.lastIndexOf(":"),z===-1?O+=R(W,!1,!1):(O+=R(W.substr(0,z),!1,!1),O+=":",O+=R(W.substr(z+1),!1,!0)),O+="@"}N=N.toLowerCase(),z=N.lastIndexOf(":"),z===-1?O+=R(N,!1,!0):(O+=R(N.substr(0,z),!1,!0),O+=N.substr(z))}if(B){if(B.length>=3&&B.charCodeAt(0)===47&&B.charCodeAt(2)===58){const z=B.charCodeAt(1);z>=65&&z<=90&&(B=`/${String.fromCharCode(z+32)}:${B.substr(3)}`)}else if(B.length>=2&&B.charCodeAt(1)===58){const z=B.charCodeAt(0);z>=65&&z<=90&&(B=`${String.fromCharCode(z+32)}:${B.substr(2)}`)}O+=R(B,!0,!1)}return F&&(O+="?",O+=R(F,!1,!1)),G&&(O+="#",O+=_?G:y(G,!1,!1)),O}A(x,"b");function w($){try{return decodeURIComponent($)}catch{return $.length>3?$.substr(0,3)+w($.substr(3)):$}}A(w,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function k($){return $.match(C)?$.replace(C,(_=>w(_))):$}A(k,"w");var S=r(975);const E=S.posix||S,L="/";var M;(function($){$.joinPath=function(_,...R){return _.with({path:E.join(_.path,...R)})},$.resolvePath=function(_,...R){let O=_.path,D=!1;O[0]!==L&&(O=L+O,D=!0);let N=E.resolve(O,...R);return D&&N[0]===L&&!_.authority&&(N=N.substring(1)),_.with({path:N})},$.dirname=function(_){if(_.path.length===0||_.path===L)return _;let R=E.dirname(_.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),_.with({path:R})},$.basename=function(_){return E.basename(_.path)},$.extname=function(_){return E.extname(_.path)}})(M||(M={})),p1e=n})();var{URI:ko,Utils:Rw}=p1e,Ms;(function(t){t.basename=Rw.basename,t.dirname=Rw.dirname,t.extname=Rw.extname,t.joinPath=Rw.joinPath,t.resolvePath=Rw.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}A(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?ko.parse(s).path:s.path,u=typeof o=="string"?ko.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:Ms.joinPath(ko.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Ms.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},A(tv,"UriTrie"),tv),Jr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Jr||(Jr={}));var g1e=(rv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Kn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??ko.parse(e.uri),Kn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Kn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Jr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Jr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Jr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=iA.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},A(rv,"DefaultLangiumDocumentFactory"),rv),m1e=(nv=class{constructor(e){this.documentTrie=new vP,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Mn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Jr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Jr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Jr.Changed;return this.documentTrie.delete(r),n}},A(nv,"DefaultLangiumDocuments"),nv),Ep=Symbol("RefResolving"),y1e=(iv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Kn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of bl(e.parseResult.value))await Ta(r),Jg(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of bl(e.parseResult.value))await Ta(r),Jg(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Ep;try{const i=this.getCandidate(e);if(Bf(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Ep;try{const i=this.getCandidates(e),a=[];if(Bf(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Xi(this._ref))return this._ref;if(b9(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Ep;const o=Qg(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Bf(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Qg(e.container).$document;n&&n.stateWf(r)&&r.isMulti)}findDeclarations(e){if(e){const r=dO(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Ss(i)||mc(i))return s5(i);if(Array.isArray(i)){for(const a of i)if((Ss(a)||mc(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return s5(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||q9(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Jg(n))if(mc(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Ms.equals(a.sourceUri,r.documentUri))),n.push(...i),Mn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=vl(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:cm(a),local:!0})}}return n}},A(sv,"DefaultReferences"),sv),Gu=(ov=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return _T.sum(Mn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?Mn(r):jg}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Mn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Mn(this.map.keys())}values(){return Mn(this.map.values()).flat()}entriesGroupedByKey(){return Mn(this.map.entries())}},A(ov,"MultiMap"),ov),sA=(lv=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},A(lv,"BiMap"),lv),x1e=(cv=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Kn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=RT,i=Kn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Ta(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Kn.CancellationToken.None){const n=e.parseResult.value,i=new Gu;for(const a of Eu(n))await Ta(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},A(cv,"DefaultScopeComputation"),cv),xP=(uv=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},A(uv,"StreamScope"),uv),Gct=(hv=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Mn(i).concat(this.outerScope.getElements(e)):Mn(i)}getAllElements(){let e=Mn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(hv,"MapScope"),hv),T1e=(dv=class{constructor(e,r,n){this.elements=new Gu,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Mn(n).concat(this.outerScope.getElements(e)):Mn(n)}getAllElements(){let e=Mn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(dv,"MultiMapScope"),dv),Wct={getElement(){},getElements(){return jg},getAllElements(){return jg}},oA=(fv=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},A(fv,"DisposableCache"),fv),TP=(pv=class extends oA{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},A(pv,"SimpleCache"),pv),lA=(gv=class extends oA{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},A(gv,"ContextCache"),gv),w1e=(mv=class extends lA{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},A(mv,"DocumentCache"),mv),wP=(yv=class extends TP{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},A(yv,"WorkspaceCache"),yv),C1e=(vv=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new wP(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=vl(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new xP(Mn(e),r,n)}createScopeForNodes(e,r,n){const i=Mn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new xP(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new T1e(this.indexManager.allElements(e)))}},A(vv,"DefaultScopeProvider"),vv);function CP(t){return typeof t.$comment=="string"}A(CP,"isAstNodeWithComment");function SP(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}A(SP,"isIntermediateReference");var S1e=(bv=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=A((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=vl(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Ss(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=vl(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(mc(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=vl(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Xi(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=A(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=uO(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(kp(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Mn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},A(Tv,"ValidationRegistry"),Tv),A1e=Object.freeze({validateNode:!0,validateChildren:!0}),_1e=(wv=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Kn.CancellationToken.None){const i=e.parseResult,a=[];if(await Ta(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Yo.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Yo.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Yo.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(kp(s))throw s;console.error("An error occurred during validation:",s)}return await Ta(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:Lw(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:EP(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=FT(i.token);if(a){const s={severity:Lw("error"),range:a,message:i.message,data:Ap(Yo.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:Yo.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Kn.CancellationToken.None){const i=[],a=A((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Kn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Ta(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Kn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=bl(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=bl(e).iterator();for(const o of s){await Ta(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return A1e}async validateAstAfter(e,r,n,i=Kn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Ta(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:kP(n),severity:Lw(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},A(wv,"DefaultDocumentValidator"),wv);function kP(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=B5(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=hO(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}A(kP,"getDiagnosticRange");function Lw(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}A(Lw,"toDiagnosticSeverity");function EP(t){switch(t){case"error":return Ap(Yo.LexingError);case"warning":return Ap(Yo.LexingWarning);case"info":return Ap(Yo.LexingInfo);case"hint":return Ap(Yo.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}A(EP,"toDiagnosticData");var Yo;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Yo||(Yo={}));var R1e=(Cv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??vl(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=A(()=>s??(s=cm(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:cm(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},A(Cv,"DefaultAstNodeDescriptionProvider"),Cv),L1e=(Sv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Kn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of bl(i))await Ta(r),Jg(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Ss(r)&&r.$nodeDescription?n=[r.$nodeDescription]:mc(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=vl(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=cm(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Ms.equals(l.documentUri,i)});return s}},A(Sv,"DefaultReferenceDescriptionProvider"),Sv),I1e=(kv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},A(kv,"DefaultAstNodeLocator"),kv),uA={};jE(uA,fN(Yg()));var M1e=(Ev=class{constructor(e){this._ready=new zu,this.onConfigurationSectionUpdateEmitter=new uA.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},A(Ev,"DefaultConfigurationProvider"),Ev),hA=fN(xQe()),_p;(function(t){function e(r){return{dispose:A(async()=>await r(),"dispose")}}A(e,"create"),t.create=e})(_p||(_p={}));var D1e=(Av=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Gu,this.documentPhaseListeners=new Gu,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Jr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Kn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Jr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Jr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=Jr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Jr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Kn.CancellationToken.None){this.currentState=Jr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Jr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Jr.Changed)}const s=Mn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Jr.ComputedScopes)),await this.emitUpdate(a,i),await Ta(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Mn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),_p.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Jr.Changed:case Jr.Parsed:this.indexManager.removeContent(e.uri);case Jr.IndexedContent:e.localSymbols=void 0;case Jr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Jr.Linked:this.indexManager.removeReferences(e.uri);case Jr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Jr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Jr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Jr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Jr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Jr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Jr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Jr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Jr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),_p.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),_p.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Kn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Ac);if(this.currentState>=e&&e>i.state)return Promise.reject(new hA.ResponseError(hA.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Jr[i.state]}, requiring ${Jr[e]}, but workspace state is already ${Jr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new hA.ResponseError(hA.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Ms.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Ac)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Ac):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Ac)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Ta(n),await s(e,n)}catch(o){if(!kp(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Ta(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Mn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},A(Av,"DefaultDocumentBuilder"),Av),N1e=(_v=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new lA,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=vl(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Ms.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Mn(i)}allElements(e,r){let n=Mn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Kn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Kn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},A(_v,"DefaultIndexManager"),_v),O1e=(Rv=class{constructor(e){this.initialBuildOptions={},this._ready=new zu,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Kn.CancellationToken.None){const n=await this.performStartup(e);await Ta(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=A(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Mn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return ko.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Ms.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},A(Rv,"DefaultWorkspaceManager"),Rv),$1e=(Lv=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return a$.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return a$.buildUnableToPopLexerModeMessage(e)}},A(Lv,"DefaultLexerErrorMessageProvider"),Lv),AP={mode:"full"},_P=(Iv=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=pA(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Rs(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=AP){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(pA(e))return e;const r=fA(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},A(Iv,"DefaultLexer"),Iv);function dA(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}A(dA,"isTokenTypeArray");function fA(t){return t&&"modes"in t&&"defaultMode"in t}A(fA,"isIMultiModeLexerDefinition");function pA(t){return!dA(t)&&!fA(t)}A(pA,"isTokenTypeDictionary"),kT();function RP(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=En.create(0,0));const a=IP(t),s=mA(n),o=B1e({lines:a,position:i,options:s});return G1e({index:0,tokens:o,position:i})}A(RP,"parseJSDoc");function LP(t,e){const r=mA(e),n=IP(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}A(LP,"isJSDoc");function IP(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Toe)}A(IP,"getLines");var P1e=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,qct=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function B1e(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=En.create(r,n);e.push({type:"break",content:"",range:on.create(p,p)})}}else{P1e.lastIndex=d;const p=P1e.exec(h);if(p){const g=p[0],m=p[1],y=En.create(r,n+d),v=En.create(r,n+d+g.length);e.push({type:"tag",content:m,range:on.create(y,v)}),d+=g.length,d=gA(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}A(B1e,"tokenize");function F1e(t,e,r,n){const i=[];if(t.length===0){const a=En.create(r,n),s=En.create(r,n+e.length);i.push({type:"text",content:e,range:on.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:on.create(En.create(r,a+n),En.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:on.create(En.create(r,a+h+n),En.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:on.create(En.create(r,a+h+n),En.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:on.create(En.create(r,a+h+n),En.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:on.create(En.create(r,a+n),En.create(r,a+n+s.length))})}return i}A(F1e,"buildInlineTokens");var Vct=/\S/,Uct=/\s*$/;function gA(t,e){const r=t.substring(e).match(Vct);return r?e+r.index:t.length}A(gA,"skipWhitespace");function z1e(t){const e=t.match(Uct);if(e&&typeof e.index=="number")return e.index}A(z1e,"lastCharacter");function G1e(t){var a,s;const e=En.create(t.position.line,t.position.character);if(t.tokens.length===0)return new U1e([],on.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=PP(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=PP(r)+i}return r.trim()}},A(Mv,"JSDocCommentImpl"),Mv),OP=(Dv=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=H1e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}},A(Dv,"JSDocTagImpl"),Dv);function H1e(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=gA(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??Y1e(e,a)}}A(H1e,"renderInlineTag");function Y1e(t,e){try{return ko.parse(t,!0),`[${e}](${t})`}catch{return t}}A(Y1e,"renderLinkDefault");var $P=(Nv=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` -`)}return r}},E(Fy,"JSDocTextImpl"),Fy),ipe=(zy=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},E(zy,"JSDocLineImpl"),zy);function iO(t){return t.endsWith(` +`)}return r}},A(Nv,"JSDocTextImpl"),Nv),X1e=(Ov=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},A(Ov,"JSDocLineImpl"),Ov);function PP(t){return t.endsWith(` `)?` `:` -`}E(iO,"fillNewlines");var ape=(Gy=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&ZN(r))return jN(r).toMarkdown({renderLink:E((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:E(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=qo(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},E(Gy,"JSDocDocumentationProvider"),Gy),spe=(qy=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return WN(e)?e.$comment:(r=pD(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},E(qy,"DefaultCommentProvider"),qy),ope=(Vy=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},E(Vy,"DefaultAsyncParser"),Vy),Wnt=(Wy=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new su;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new su;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Ql)}),this.queue.push(r),r.promise}},E(Wy,"AbstractThreadedAsyncParser"),Wy),Unt=(Uy=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new VE.Emitter,this.deferred=new su,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Ql),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new su,this.sendMessage(e),this.deferred.promise}},E(Uy,"ParserWorker"),Uy),lpe=(Hy=class{constructor(){this.previousTokenSource=new Rn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=$E();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Rn.CancellationToken.None){const i=new su,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pf(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},E(Hy,"DefaultWorkspaceLock"),Hy),cpe=(Yy=class{constructor(e){this.grammarElementIdMap=new FE,this.tokenTypeIdMap=new FE,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Vo(e))r.set(i,{});if(e.$cstNode)for(const i of yg(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ai(o)?s.push(this.dehydrateAstNode(o,r)):ts(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ai(a)?n[i]=this.dehydrateAstNode(a,r):ts(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return B3(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Uc(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):jd(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Vo(e))r.set(a,{});let i;if(e.$cstNode)for(const a of yg(e.$cstNode)){let s;"fullText"in a?(s=new SN(a.fullText),i=s):"content"in a?s=new AE:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ai(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ts(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ai(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ts(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Uc(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new SE(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Vo(this.grammar))q3(r)&&this.grammarElementIdMap.set(r,e++)}},E(Yy,"DefaultHydrator"),Yy);function ta(t){return{documentation:{CommentProvider:E(e=>new spe(e),"CommentProvider"),DocumentationProvider:E(e=>new ape(e),"DocumentationProvider")},parser:{AsyncParser:E(e=>new ope(e),"AsyncParser"),GrammarConfig:E(e=>zD(e),"GrammarConfig"),LangiumParser:E(e=>DN(e),"LangiumParser"),CompletionParser:E(e=>IN(e),"CompletionParser"),ValueConverter:E(()=>new NN,"ValueConverter"),TokenBuilder:E(()=>new ME,"TokenBuilder"),Lexer:E(e=>new KN(e),"Lexer"),ParserErrorMessageProvider:E(()=>new _N,"ParserErrorMessageProvider"),LexerErrorMessageProvider:E(()=>new Hfe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:E(()=>new Gfe,"AstNodeLocator"),AstNodeDescriptionProvider:E(e=>new Ffe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:E(e=>new zfe(e),"ReferenceDescriptionProvider")},references:{Linker:E(e=>new Afe(e),"Linker"),NameProvider:E(()=>new _fe,"NameProvider"),ScopeProvider:E(e=>new Mfe(e),"ScopeProvider"),ScopeComputation:E(e=>new Lfe(e),"ScopeComputation"),References:E(e=>new Rfe(e),"References")},serializer:{Hydrator:E(e=>new cpe(e),"Hydrator"),JsonSerializer:E(e=>new Nfe(e),"JsonSerializer")},validation:{DocumentValidator:E(e=>new Bfe(e),"DocumentValidator"),ValidationRegistry:E(e=>new $fe(e),"ValidationRegistry")},shared:E(()=>t.shared,"shared")}}E(ta,"createDefaultCoreModule");function ra(t){return{ServiceRegistry:E(e=>new Ofe(e),"ServiceRegistry"),workspace:{LangiumDocuments:E(e=>new Sfe(e),"LangiumDocuments"),LangiumDocumentFactory:E(e=>new Efe(e),"LangiumDocumentFactory"),DocumentBuilder:E(e=>new Vfe(e),"DocumentBuilder"),IndexManager:E(e=>new Wfe(e),"IndexManager"),WorkspaceManager:E(e=>new Ufe(e),"WorkspaceManager"),FileSystemProvider:E(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:E(()=>new lpe,"WorkspaceLock"),ConfigurationProvider:E(e=>new qfe(e),"ConfigurationProvider")},profilers:{}}}E(ra,"createDefaultSharedCoreModule");var aO;(function(t){t.merge=(e,r)=>$g($g({},e),r)})(aO||(aO={}));function Xr(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce($g,{});return oO(u)}E(Xr,"inject");var upe=Symbol("isProxy");function sO(t){if(t&&t[upe])for(const e of Object.values(t))sO(e);return t}E(sO,"eagerLoad");function oO(t,e){const r=new Proxy({},{deleteProperty:E(()=>!1,"deleteProperty"),set:E(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:E((n,i)=>i===upe?!0:lO(n,i,t,e||r),"get"),getOwnPropertyDescriptor:E((n,i)=>(lO(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:E((n,i)=>i in t,"has"),ownKeys:E(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}E(oO,"_inject");var hpe=Symbol();function lO(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===hpe)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=hpe;try{t[e]=typeof i=="function"?i(n):oO(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}E(lO,"_resolve");function $g(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=$g(i,n):t[r]=$g({},n)}else t[r]=n}return t}E($g,"_merge");var cO={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Gf;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Gf||(Gf={}));var dpe=(Xy=class extends ME{constructor(e=cO){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...cO,...e},this.indentTokenType=Rg({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Rg({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!UE(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=Gf.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[Gf.REGULAR]:[l,u,...d,h],[Gf.IGNORE_INDENTATION]:[...d,h]},defaultMode:Gf.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return vT(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},E(Xy,"IndentationAwareTokenBuilder"),Xy),Hnt=(Ky=class extends KN{constructor(e){if(super(e),e.parser.TokenBuilder instanceof dpe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=XN){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},E(Ky,"IndentationAwareLexer"),Ky),uO={};ph(uO,{AstUtils:()=>q9,BiMap:()=>FE,Cancellation:()=>Rn,ContextCache:()=>GE,CstUtils:()=>F9,DONE_RESULT:()=>rs,Deferred:()=>su,Disposable:()=>zf,DisposableCache:()=>zE,DocumentCache:()=>Dfe,EMPTY_STREAM:()=>ig,ErrorWithLocation:()=>ck,GrammarUtils:()=>bD,MultiMap:()=>ou,OperationCancelled:()=>Ql,Reduction:()=>Ix,RegExpUtils:()=>TD,SimpleCache:()=>qN,StreamImpl:()=>ql,TreeStreamImpl:()=>ag,URI:()=>Js,UriTrie:()=>FN,UriUtils:()=>cs,WorkspaceCache:()=>VN,assertCondition:()=>xD,assertUnreachable:()=>Th,delayNextTick:()=>NE,interruptAndCheck:()=>ea,isOperationCancelled:()=>Pf,loadGrammarFromJson:()=>na,setInterruptionPeriod:()=>ON,startCancelableOperation:()=>$E,stream:()=>gn}),_3(uO,VE);var fpe=(jy=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},E(jy,"EmptyFileSystemProvider"),jy),va={fileSystemProvider:E(()=>new fpe,"fileSystemProvider")},Ynt={Grammar:E(()=>{},"Grammar"),LanguageMetaData:E(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Xnt={AstReflection:E(()=>new cD,"AstReflection")};function ppe(){const t=Xr(ra(va),Xnt),e=Xr(ta({shared:t}),Ynt);return t.ServiceRegistry.register(e),e}E(ppe,"createMinimalGrammarServices");function na(t){const e=ppe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Js.parse(`memory:/${r.name??"grammar"}.langium`)),r}E(na,"loadGrammarFromJson"),_3(tre,uO);var Knt=(Zy=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new ou}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new gpe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return E(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},E(Zy,"DefaultLangiumProfiler"),Zy),gpe=(Qy=class{constructor(e,r){this.stack=[],this.entries=new ou,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},E(Qy,"ProfilingTask"),Qy),hO;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(hO||(hO={}));var dO;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dO||(dO={}));var fO;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(fO||(fO={}));var pO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(pO||(pO={}));var gO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(gO||(gO={}));var mO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(mO||(mO={}));var yO;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(yO||(yO={}));var vO;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(vO||(vO={}));var bO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(bO||(bO={}));var xO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(xO||(xO={}));var TO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(TO||(TO={}));var wO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(wO||(wO={}));var CO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(CO||(CO={}));var kO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(kO||(kO={}));var EO;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(EO||(EO={})),{...hO.Terminals,...dO.Terminals,...fO.Terminals,...pO.Terminals,...gO.Terminals,...mO.Terminals,...yO.Terminals,...vO.Terminals,...bO.Terminals,...xO.Terminals,...TO.Terminals,...wO.Terminals,...kO.Terminals,...CO.Terminals,...EO.Terminals};var mpe={$type:"AbnfAlternation",alternatives:"alternatives"},ype={$type:"AbnfConcatenation",elements:"elements"},SO={$type:"AbnfElement",primary:"primary",repeat:"repeat"},vpe={$type:"AbnfGroup",element:"element"},bpe={$type:"AbnfNumVal",value:"value"},xpe={$type:"AbnfOptionalGroup",element:"element"},Pg={$type:"AbnfPrimary"},AO={$type:"AbnfRule",definition:"definition",name:"name"},Tpe={$type:"AbnfRuleName",name:"name"},wpe={$type:"AbnfStringLiteral",value:"value"},ZE={$type:"Accelerator",name:"name",x:"x",y:"y"},_O={$type:"Alignment",direction:"direction",members:"members"},QE={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},NT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},RO={$type:"Annotations",x:"x",y:"y"},Jl={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function jnt(t){return pi.isInstance(t,Jl.$type)}E(jnt,"isArchitecture");var JE={$type:"Axis",label:"label",name:"name"},eS={$type:"Branch",name:"name",order:"order"};function Znt(t){return pi.isInstance(t,eS.$type)}E(Znt,"isBranch");var Cpe={$type:"Checkout",branch:"branch"},tS={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},LO={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Bg={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Qnt(t){return pi.isInstance(t,Bg.$type)}E(Qnt,"isCommit");var rS={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},qf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},nS={$type:"Curve",entries:"entries",label:"label",name:"name"},Vf={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Jnt(t){return pi.isInstance(t,Vf.$type)}E(Jnt,"isCynefin");var iS={$type:"Deaccelerator",name:"name",x:"x",y:"y"},kpe={$type:"Decorator",strategy:"strategy"},Fg={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},aS={$type:"DomainBlock",domain:"domain",items:"items"};function eit(t){return pi.isInstance(t,aS.$type)}E(eit,"isDomainBlock");var IO={$type:"DomainItem",label:"label"};function tit(t){return pi.isInstance(t,IO.$type)}E(tit,"isDomainItem");var Epe={$type:"EbnfChoice",alternatives:"alternatives"},Spe={$type:"EbnfExceptionPostfix",except:"except"},Ape={$type:"EbnfGroup",element:"element"},_pe={$type:"EbnfNonTerminal",name:"name"},Rpe={$type:"EbnfOneOrMorePostfix",operator:"operator"},Lpe={$type:"EbnfOptional",element:"element"},Ipe={$type:"EbnfOptionalPostfix",operator:"operator"},OT={$type:"EbnfPostfix"},Wf={$type:"EbnfPrimary"},Dpe={$type:"EbnfRepetition",element:"element"},DO={$type:"EbnfRule",definition:"definition",name:"name"},Mpe={$type:"EbnfSequence",elements:"elements"},Npe={$type:"EbnfSpecial",text:"text"},MO={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Ope={$type:"EbnfTerminal",value:"value"},$pe={$type:"EbnfZeroOrMorePostfix",operator:"operator"},ec={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},zg={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Uf={$type:"EmFrame"},$T={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Ppe={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},NO={$type:"EmModelEntity",name:"name"};function rit(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}E(rit,"isEmModelEntityType");var sS={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},lu={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Bpe(t){return pi.isInstance(t,lu.$type)}E(Bpe,"isEmResetFrame");var Rh={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},OO={$type:"Entry",axis:"axis",value:"value"},cu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Fpe={$type:"Evolution",stages:"stages"},oS={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},$O={$type:"Evolve",component:"component",target:"target"},Hf={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function nit(t){return pi.isInstance(t,Hf.$type)}E(nit,"isGitGraph");var PT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},BT={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function iit(t){return pi.isInstance(t,BT.$type)}E(iit,"isInfo");var FT={$type:"Item",classSelector:"classSelector",name:"name"},PO={$type:"Junction",id:"id",in:"in"},zT={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},lS={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Yf={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Gg={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function ait(t){return pi.isInstance(t,Gg.$type)}E(ait,"isMerge");var cS={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},BO={$type:"Option",name:"name",value:"value"},qg={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function sit(t){return pi.isInstance(t,qg.$type)}E(sit,"isPacket");var Vg={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function oit(t){return pi.isInstance(t,Vg.$type)}E(oit,"isPacketBlock");var zpe={$type:"PegAny",dot:"dot"},Gpe={$type:"PegGroup",element:"element"},qpe={$type:"PegIdentifier",name:"name"},Vpe={$type:"PegLiteral",value:"value"},Wpe={$type:"PegOrderedChoice",alternatives:"alternatives"},FO={$type:"PegPrefix",operator:"operator",suffix:"suffix"},GT={$type:"PegPrimary"},zO={$type:"PegRule",definition:"definition",name:"name"},Upe={$type:"PegSequence",elements:"elements"},GO={$type:"PegSuffix",operator:"operator",primary:"primary"},Xf={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function lit(t){return pi.isInstance(t,Xf.$type)}E(lit,"isPie");var uS={$type:"PieSection",label:"label",value:"value"};function cit(t){return pi.isInstance(t,uS.$type)}E(cit,"isPieSection");var qO={$type:"Pipeline",components:"components",parent:"parent"},hS={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Kf={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Wg={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function uit(t){return pi.isInstance(t,Wg.$type)}E(uit,"isRailroad");var Ug={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function hit(t){return pi.isInstance(t,Ug.$type)}E(hit,"isRailroadAbnf");var Hpe={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Hg={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function dit(t){return pi.isInstance(t,Hg.$type)}E(dit,"isRailroadEbnf");var uu={$type:"RailroadExpression"},Ype={$type:"RailroadNonTerminalExpr",name:"name"},Xpe={$type:"RailroadOneOrMoreExpr",element:"element"},Kpe={$type:"RailroadOptionalExpr",element:"element"},Yg={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function fit(t){return pi.isInstance(t,Yg.$type)}E(fit,"isRailroadPeg");var VO={$type:"RailroadRule",definition:"definition",name:"name"},jpe={$type:"RailroadSequenceExpr",elements:"elements"},Zpe={$type:"RailroadSpecialExpr",text:"text"},Qpe={$type:"RailroadTerminalExpr",value:"value"},Jpe={$type:"RailroadZeroOrMoreExpr",element:"element"},WO={$type:"Section",classSelector:"classSelector",name:"name"},Xg={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},UO={$type:"Size",height:"height",width:"width"},Kg={$type:"Statement"},qT={$type:"Transition",from:"from",label:"label",to:"to"};function pit(t){return pi.isInstance(t,qT.$type)}E(pit,"isTransition");var jg={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function git(t){return pi.isInstance(t,jg.$type)}E(git,"isTreemap");var HO={$type:"TreemapRow",indent:"indent",item:"item"},Zg={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},VT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},ba={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function mit(t){return pi.isInstance(t,ba.$type)}E(mit,"isWardley");var e0e=(Jy=class extends G9{constructor(){super(...arguments),this.types={AbnfAlternation:{name:mpe.$type,properties:{alternatives:{name:mpe.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:ype.$type,properties:{elements:{name:ype.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:SO.$type,properties:{primary:{name:SO.primary},repeat:{name:SO.repeat}},superTypes:[]},AbnfGroup:{name:vpe.$type,properties:{element:{name:vpe.element}},superTypes:[Pg.$type]},AbnfNumVal:{name:bpe.$type,properties:{value:{name:bpe.value}},superTypes:[Pg.$type]},AbnfOptionalGroup:{name:xpe.$type,properties:{element:{name:xpe.element}},superTypes:[Pg.$type]},AbnfPrimary:{name:Pg.$type,properties:{},superTypes:[]},AbnfRule:{name:AO.$type,properties:{definition:{name:AO.definition},name:{name:AO.name}},superTypes:[]},AbnfRuleName:{name:Tpe.$type,properties:{name:{name:Tpe.name}},superTypes:[Pg.$type]},AbnfStringLiteral:{name:wpe.$type,properties:{value:{name:wpe.value}},superTypes:[Pg.$type]},Accelerator:{name:ZE.$type,properties:{name:{name:ZE.name},x:{name:ZE.x},y:{name:ZE.y}},superTypes:[]},Alignment:{name:_O.$type,properties:{direction:{name:_O.direction},members:{name:_O.members,defaultValue:[]}},superTypes:[]},Anchor:{name:QE.$type,properties:{evolution:{name:QE.evolution},name:{name:QE.name},visibility:{name:QE.visibility}},superTypes:[]},Annotation:{name:NT.$type,properties:{number:{name:NT.number},text:{name:NT.text},x:{name:NT.x},y:{name:NT.y}},superTypes:[]},Annotations:{name:RO.$type,properties:{x:{name:RO.x},y:{name:RO.y}},superTypes:[]},Architecture:{name:Jl.$type,properties:{accDescr:{name:Jl.accDescr},accTitle:{name:Jl.accTitle},alignments:{name:Jl.alignments,defaultValue:[]},edges:{name:Jl.edges,defaultValue:[]},groups:{name:Jl.groups,defaultValue:[]},junctions:{name:Jl.junctions,defaultValue:[]},services:{name:Jl.services,defaultValue:[]},title:{name:Jl.title}},superTypes:[]},Axis:{name:JE.$type,properties:{label:{name:JE.label},name:{name:JE.name}},superTypes:[]},Branch:{name:eS.$type,properties:{name:{name:eS.name},order:{name:eS.order}},superTypes:[Kg.$type]},Checkout:{name:Cpe.$type,properties:{branch:{name:Cpe.branch}},superTypes:[Kg.$type]},CherryPicking:{name:tS.$type,properties:{id:{name:tS.id},parent:{name:tS.parent},tags:{name:tS.tags,defaultValue:[]}},superTypes:[Kg.$type]},ClassDefStatement:{name:LO.$type,properties:{className:{name:LO.className},styleText:{name:LO.styleText}},superTypes:[]},Commit:{name:Bg.$type,properties:{id:{name:Bg.id},message:{name:Bg.message},tags:{name:Bg.tags,defaultValue:[]},type:{name:Bg.type}},superTypes:[Kg.$type]},Common:{name:rS.$type,properties:{accDescr:{name:rS.accDescr},accTitle:{name:rS.accTitle},title:{name:rS.title}},superTypes:[]},Component:{name:qf.$type,properties:{decorator:{name:qf.decorator},evolution:{name:qf.evolution},inertia:{name:qf.inertia,defaultValue:!1},label:{name:qf.label},name:{name:qf.name},visibility:{name:qf.visibility}},superTypes:[]},Curve:{name:nS.$type,properties:{entries:{name:nS.entries,defaultValue:[]},label:{name:nS.label},name:{name:nS.name}},superTypes:[]},Cynefin:{name:Vf.$type,properties:{accDescr:{name:Vf.accDescr},accTitle:{name:Vf.accTitle},domains:{name:Vf.domains,defaultValue:[]},title:{name:Vf.title},transitions:{name:Vf.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:iS.$type,properties:{name:{name:iS.name},x:{name:iS.x},y:{name:iS.y}},superTypes:[]},Decorator:{name:kpe.$type,properties:{strategy:{name:kpe.strategy}},superTypes:[]},Direction:{name:Fg.$type,properties:{accDescr:{name:Fg.accDescr},accTitle:{name:Fg.accTitle},dir:{name:Fg.dir},statements:{name:Fg.statements,defaultValue:[]},title:{name:Fg.title}},superTypes:[Hf.$type]},DomainBlock:{name:aS.$type,properties:{domain:{name:aS.domain},items:{name:aS.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:IO.$type,properties:{label:{name:IO.label}},superTypes:[]},EbnfChoice:{name:Epe.$type,properties:{alternatives:{name:Epe.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Spe.$type,properties:{except:{name:Spe.except}},superTypes:[OT.$type]},EbnfGroup:{name:Ape.$type,properties:{element:{name:Ape.element}},superTypes:[Wf.$type]},EbnfNonTerminal:{name:_pe.$type,properties:{name:{name:_pe.name}},superTypes:[Wf.$type]},EbnfOneOrMorePostfix:{name:Rpe.$type,properties:{operator:{name:Rpe.operator}},superTypes:[OT.$type]},EbnfOptional:{name:Lpe.$type,properties:{element:{name:Lpe.element}},superTypes:[Wf.$type]},EbnfOptionalPostfix:{name:Ipe.$type,properties:{operator:{name:Ipe.operator}},superTypes:[OT.$type]},EbnfPostfix:{name:OT.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Wf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Dpe.$type,properties:{element:{name:Dpe.element}},superTypes:[Wf.$type]},EbnfRule:{name:DO.$type,properties:{definition:{name:DO.definition},name:{name:DO.name}},superTypes:[]},EbnfSequence:{name:Mpe.$type,properties:{elements:{name:Mpe.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Npe.$type,properties:{text:{name:Npe.text}},superTypes:[Wf.$type]},EbnfTerm:{name:MO.$type,properties:{base:{name:MO.base},postfixes:{name:MO.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Ope.$type,properties:{value:{name:Ope.value}},superTypes:[Wf.$type]},EbnfZeroOrMorePostfix:{name:$pe.$type,properties:{operator:{name:$pe.operator}},superTypes:[OT.$type]},Edge:{name:ec.$type,properties:{lhsDir:{name:ec.lhsDir},lhsGroup:{name:ec.lhsGroup,defaultValue:!1},lhsId:{name:ec.lhsId},lhsInto:{name:ec.lhsInto,defaultValue:!1},rhsDir:{name:ec.rhsDir},rhsGroup:{name:ec.rhsGroup,defaultValue:!1},rhsId:{name:ec.rhsId},rhsInto:{name:ec.rhsInto,defaultValue:!1},title:{name:ec.title}},superTypes:[]},EmDataEntity:{name:zg.$type,properties:{dataBlockValue:{name:zg.dataBlockValue},dataType:{name:zg.dataType},name:{name:zg.name}},superTypes:[]},EmFrame:{name:Uf.$type,properties:{},superTypes:[]},EmGwt:{name:$T.$type,properties:{givenStatements:{name:$T.givenStatements,defaultValue:[]},sourceFrame:{name:$T.sourceFrame,referenceType:Uf.$type},thenStatements:{name:$T.thenStatements,defaultValue:[]},whenStatements:{name:$T.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Ppe.$type,properties:{entityIdentifier:{name:Ppe.entityIdentifier,referenceType:NO.$type}},superTypes:[]},EmModelEntity:{name:NO.$type,properties:{name:{name:NO.name}},superTypes:[]},EmNoteEntity:{name:sS.$type,properties:{dataBlockValue:{name:sS.dataBlockValue},dataType:{name:sS.dataType},sourceFrame:{name:sS.sourceFrame,referenceType:Uf.$type}},superTypes:[]},EmResetFrame:{name:lu.$type,properties:{dataInlineValue:{name:lu.dataInlineValue},dataReference:{name:lu.dataReference,referenceType:zg.$type},dataType:{name:lu.dataType},entityIdentifier:{name:lu.entityIdentifier},modelEntityType:{name:lu.modelEntityType},name:{name:lu.name},sourceFrames:{name:lu.sourceFrames,defaultValue:[],referenceType:Uf.$type}},superTypes:[Uf.$type]},EmTimeFrame:{name:Rh.$type,properties:{dataInlineValue:{name:Rh.dataInlineValue},dataReference:{name:Rh.dataReference,referenceType:zg.$type},dataType:{name:Rh.dataType},entityIdentifier:{name:Rh.entityIdentifier},modelEntityType:{name:Rh.modelEntityType},name:{name:Rh.name},sourceFrames:{name:Rh.sourceFrames,defaultValue:[],referenceType:Uf.$type}},superTypes:[Uf.$type]},Entry:{name:OO.$type,properties:{axis:{name:OO.axis,referenceType:JE.$type},value:{name:OO.value}},superTypes:[]},EventModel:{name:cu.$type,properties:{accDescr:{name:cu.accDescr},accTitle:{name:cu.accTitle},dataEntities:{name:cu.dataEntities,defaultValue:[]},frames:{name:cu.frames,defaultValue:[]},gwtEntities:{name:cu.gwtEntities,defaultValue:[]},modelEntities:{name:cu.modelEntities,defaultValue:[]},noteEntities:{name:cu.noteEntities,defaultValue:[]},title:{name:cu.title}},superTypes:[]},Evolution:{name:Fpe.$type,properties:{stages:{name:Fpe.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:oS.$type,properties:{boundary:{name:oS.boundary},name:{name:oS.name},secondName:{name:oS.secondName}},superTypes:[]},Evolve:{name:$O.$type,properties:{component:{name:$O.component},target:{name:$O.target}},superTypes:[]},GitGraph:{name:Hf.$type,properties:{accDescr:{name:Hf.accDescr},accTitle:{name:Hf.accTitle},statements:{name:Hf.statements,defaultValue:[]},title:{name:Hf.title}},superTypes:[]},Group:{name:PT.$type,properties:{icon:{name:PT.icon},id:{name:PT.id},in:{name:PT.in},title:{name:PT.title}},superTypes:[]},Info:{name:BT.$type,properties:{accDescr:{name:BT.accDescr},accTitle:{name:BT.accTitle},title:{name:BT.title}},superTypes:[]},Item:{name:FT.$type,properties:{classSelector:{name:FT.classSelector},name:{name:FT.name}},superTypes:[]},Junction:{name:PO.$type,properties:{id:{name:PO.id},in:{name:PO.in}},superTypes:[]},Label:{name:zT.$type,properties:{negX:{name:zT.negX,defaultValue:!1},negY:{name:zT.negY,defaultValue:!1},offsetX:{name:zT.offsetX},offsetY:{name:zT.offsetY}},superTypes:[]},Leaf:{name:lS.$type,properties:{classSelector:{name:lS.classSelector},name:{name:lS.name},value:{name:lS.value}},superTypes:[FT.$type]},Link:{name:Yf.$type,properties:{arrow:{name:Yf.arrow},from:{name:Yf.from},fromPort:{name:Yf.fromPort},linkLabel:{name:Yf.linkLabel},to:{name:Yf.to},toPort:{name:Yf.toPort}},superTypes:[]},Merge:{name:Gg.$type,properties:{branch:{name:Gg.branch},id:{name:Gg.id},tags:{name:Gg.tags,defaultValue:[]},type:{name:Gg.type}},superTypes:[Kg.$type]},Note:{name:cS.$type,properties:{evolution:{name:cS.evolution},text:{name:cS.text},visibility:{name:cS.visibility}},superTypes:[]},Option:{name:BO.$type,properties:{name:{name:BO.name},value:{name:BO.value,defaultValue:!1}},superTypes:[]},Packet:{name:qg.$type,properties:{accDescr:{name:qg.accDescr},accTitle:{name:qg.accTitle},blocks:{name:qg.blocks,defaultValue:[]},title:{name:qg.title}},superTypes:[]},PacketBlock:{name:Vg.$type,properties:{bits:{name:Vg.bits},end:{name:Vg.end},label:{name:Vg.label},start:{name:Vg.start}},superTypes:[]},PegAny:{name:zpe.$type,properties:{dot:{name:zpe.dot}},superTypes:[GT.$type]},PegGroup:{name:Gpe.$type,properties:{element:{name:Gpe.element}},superTypes:[GT.$type]},PegIdentifier:{name:qpe.$type,properties:{name:{name:qpe.name}},superTypes:[GT.$type]},PegLiteral:{name:Vpe.$type,properties:{value:{name:Vpe.value}},superTypes:[GT.$type]},PegOrderedChoice:{name:Wpe.$type,properties:{alternatives:{name:Wpe.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:FO.$type,properties:{operator:{name:FO.operator},suffix:{name:FO.suffix}},superTypes:[]},PegPrimary:{name:GT.$type,properties:{},superTypes:[]},PegRule:{name:zO.$type,properties:{definition:{name:zO.definition},name:{name:zO.name}},superTypes:[]},PegSequence:{name:Upe.$type,properties:{elements:{name:Upe.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:GO.$type,properties:{operator:{name:GO.operator},primary:{name:GO.primary}},superTypes:[]},Pie:{name:Xf.$type,properties:{accDescr:{name:Xf.accDescr},accTitle:{name:Xf.accTitle},sections:{name:Xf.sections,defaultValue:[]},showData:{name:Xf.showData,defaultValue:!1},title:{name:Xf.title}},superTypes:[]},PieSection:{name:uS.$type,properties:{label:{name:uS.label},value:{name:uS.value}},superTypes:[]},Pipeline:{name:qO.$type,properties:{components:{name:qO.components,defaultValue:[]},parent:{name:qO.parent}},superTypes:[]},PipelineComponent:{name:hS.$type,properties:{evolution:{name:hS.evolution},label:{name:hS.label},name:{name:hS.name}},superTypes:[]},Radar:{name:Kf.$type,properties:{accDescr:{name:Kf.accDescr},accTitle:{name:Kf.accTitle},axes:{name:Kf.axes,defaultValue:[]},curves:{name:Kf.curves,defaultValue:[]},options:{name:Kf.options,defaultValue:[]},title:{name:Kf.title}},superTypes:[]},Railroad:{name:Wg.$type,properties:{accDescr:{name:Wg.accDescr},accTitle:{name:Wg.accTitle},rules:{name:Wg.rules,defaultValue:[]},title:{name:Wg.title}},superTypes:[]},RailroadAbnf:{name:Ug.$type,properties:{accDescr:{name:Ug.accDescr},accTitle:{name:Ug.accTitle},rules:{name:Ug.rules,defaultValue:[]},title:{name:Ug.title}},superTypes:[]},RailroadChoiceExpr:{name:Hpe.$type,properties:{alternatives:{name:Hpe.alternatives,defaultValue:[]}},superTypes:[uu.$type]},RailroadEbnf:{name:Hg.$type,properties:{accDescr:{name:Hg.accDescr},accTitle:{name:Hg.accTitle},rules:{name:Hg.rules,defaultValue:[]},title:{name:Hg.title}},superTypes:[]},RailroadExpression:{name:uu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Ype.$type,properties:{name:{name:Ype.name}},superTypes:[uu.$type]},RailroadOneOrMoreExpr:{name:Xpe.$type,properties:{element:{name:Xpe.element}},superTypes:[uu.$type]},RailroadOptionalExpr:{name:Kpe.$type,properties:{element:{name:Kpe.element}},superTypes:[uu.$type]},RailroadPeg:{name:Yg.$type,properties:{accDescr:{name:Yg.accDescr},accTitle:{name:Yg.accTitle},rules:{name:Yg.rules,defaultValue:[]},title:{name:Yg.title}},superTypes:[]},RailroadRule:{name:VO.$type,properties:{definition:{name:VO.definition},name:{name:VO.name}},superTypes:[]},RailroadSequenceExpr:{name:jpe.$type,properties:{elements:{name:jpe.elements,defaultValue:[]}},superTypes:[uu.$type]},RailroadSpecialExpr:{name:Zpe.$type,properties:{text:{name:Zpe.text}},superTypes:[uu.$type]},RailroadTerminalExpr:{name:Qpe.$type,properties:{value:{name:Qpe.value}},superTypes:[uu.$type]},RailroadZeroOrMoreExpr:{name:Jpe.$type,properties:{element:{name:Jpe.element}},superTypes:[uu.$type]},Section:{name:WO.$type,properties:{classSelector:{name:WO.classSelector},name:{name:WO.name}},superTypes:[FT.$type]},Service:{name:Xg.$type,properties:{icon:{name:Xg.icon},iconText:{name:Xg.iconText},id:{name:Xg.id},in:{name:Xg.in},title:{name:Xg.title}},superTypes:[]},Size:{name:UO.$type,properties:{height:{name:UO.height},width:{name:UO.width}},superTypes:[]},Statement:{name:Kg.$type,properties:{},superTypes:[]},Transition:{name:qT.$type,properties:{from:{name:qT.from},label:{name:qT.label},to:{name:qT.to}},superTypes:[]},TreeNode:{name:Zg.$type,properties:{classAnnotation:{name:Zg.classAnnotation},descAnnotation:{name:Zg.descAnnotation},iconAnnotation:{name:Zg.iconAnnotation},indent:{name:Zg.indent},name:{name:Zg.name}},superTypes:[]},TreeView:{name:VT.$type,properties:{accDescr:{name:VT.accDescr},accTitle:{name:VT.accTitle},nodes:{name:VT.nodes,defaultValue:[]},title:{name:VT.title}},superTypes:[]},Treemap:{name:jg.$type,properties:{accDescr:{name:jg.accDescr},accTitle:{name:jg.accTitle},title:{name:jg.title},TreemapRows:{name:jg.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:HO.$type,properties:{indent:{name:HO.indent},item:{name:HO.item}},superTypes:[]},Wardley:{name:ba.$type,properties:{accDescr:{name:ba.accDescr},accelerators:{name:ba.accelerators,defaultValue:[]},accTitle:{name:ba.accTitle},anchors:{name:ba.anchors,defaultValue:[]},annotation:{name:ba.annotation,defaultValue:[]},annotations:{name:ba.annotations,defaultValue:[]},components:{name:ba.components,defaultValue:[]},deaccelerators:{name:ba.deaccelerators,defaultValue:[]},evolution:{name:ba.evolution},evolves:{name:ba.evolves,defaultValue:[]},links:{name:ba.links,defaultValue:[]},notes:{name:ba.notes,defaultValue:[]},pipelines:{name:ba.pipelines,defaultValue:[]},size:{name:ba.size},title:{name:ba.title}},superTypes:[]}}}},E(Jy,"MermaidAstReflection"),Jy),pi=new e0e,t0e,yit=E(()=>t0e??(t0e=na(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),r0e,vit=E(()=>r0e??(r0e=na(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),n0e,bit=E(()=>n0e??(n0e=na('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),i0e,xit=E(()=>i0e??(i0e=na(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),a0e,Tit=E(()=>a0e??(a0e=na(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),s0e,wit=E(()=>s0e??(s0e=na(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),o0e,Cit=E(()=>o0e??(o0e=na(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),l0e,kit=E(()=>l0e??(l0e=na(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),c0e,Eit=E(()=>c0e??(c0e=na('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),u0e,Sit=E(()=>u0e??(u0e=na(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),h0e,Ait=E(()=>h0e??(h0e=na(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),d0e,_it=E(()=>d0e??(d0e=na(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),f0e,Rit=E(()=>f0e??(f0e=na(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),p0e,Lit=E(()=>p0e??(p0e=na(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),g0e,Iit=E(()=>g0e??(g0e=na(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Dit={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Mit={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Nit={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Oit={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$it={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Pit={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bit={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fit={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zit={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Git={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qit={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vit={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wit={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Uit={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hit={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},us={AstReflection:E(()=>new e0e,"AstReflection")},Yit={Grammar:E(()=>yit(),"Grammar"),LanguageMetaData:E(()=>Dit,"LanguageMetaData"),parser:{}},Xit={Grammar:E(()=>vit(),"Grammar"),LanguageMetaData:E(()=>Mit,"LanguageMetaData"),parser:{}},Kit={Grammar:E(()=>bit(),"Grammar"),LanguageMetaData:E(()=>Nit,"LanguageMetaData"),parser:{}},jit={Grammar:E(()=>xit(),"Grammar"),LanguageMetaData:E(()=>Oit,"LanguageMetaData"),parser:{}},Zit={Grammar:E(()=>Tit(),"Grammar"),LanguageMetaData:E(()=>$it,"LanguageMetaData"),parser:{}},Qit={Grammar:E(()=>wit(),"Grammar"),LanguageMetaData:E(()=>Pit,"LanguageMetaData"),parser:{}},Jit={Grammar:E(()=>Cit(),"Grammar"),LanguageMetaData:E(()=>Bit,"LanguageMetaData"),parser:{}},eat={Grammar:E(()=>kit(),"Grammar"),LanguageMetaData:E(()=>Fit,"LanguageMetaData"),parser:{}},tat={Grammar:E(()=>Eit(),"Grammar"),LanguageMetaData:E(()=>zit,"LanguageMetaData"),parser:{}},rat={Grammar:E(()=>Sit(),"Grammar"),LanguageMetaData:E(()=>Git,"LanguageMetaData"),parser:{}},nat={Grammar:E(()=>Ait(),"Grammar"),LanguageMetaData:E(()=>qit,"LanguageMetaData"),parser:{}},iat={Grammar:E(()=>_it(),"Grammar"),LanguageMetaData:E(()=>Vit,"LanguageMetaData"),parser:{}},aat={Grammar:E(()=>Rit(),"Grammar"),LanguageMetaData:E(()=>Wit,"LanguageMetaData"),parser:{}},sat={Grammar:E(()=>Lit(),"Grammar"),LanguageMetaData:E(()=>Uit,"LanguageMetaData"),parser:{}},oat={Grammar:E(()=>Iit(),"Grammar"),LanguageMetaData:E(()=>Hit,"LanguageMetaData"),parser:{}},lat=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,cat=/accTitle[\t ]*:([^\n\r]*)/,uat=/title([\t ][^\n\r]*|)/,hat={ACC_DESCR:lat,ACC_TITLE:cat,TITLE:uat},tc=(ev=class extends NN{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=hat[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},E(ev,"AbstractMermaidValueConverter"),ev),Qg=(tv=class extends tc{runCustomConverter(e,r,n){}},E(tv,"CommonValueConverter"),tv),hs=(rv=class extends ME{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},E(rv,"AbstractMermaidTokenBuilder"),rv);nv=class extends hs{},E(nv,"CommonTokenBuilder");/*! Bundled license information: +`}A(PP,"fillNewlines");var j1e=($v=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&LP(r))return RP(r).toMarkdown({renderLink:A((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:A(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=vl(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},A($v,"JSDocDocumentationProvider"),$v),K1e=(Pv=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return CP(e)?e.$comment:(r=Y9(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},A(Pv,"DefaultCommentProvider"),Pv),Z1e=(Bv=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},A(Bv,"DefaultAsyncParser"),Bv),Hct=(Fv=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new zu;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new zu;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Ac)}),this.queue.push(r),r.promise}},A(Fv,"AbstractThreadedAsyncParser"),Fv),Yct=(zv=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new uA.Emitter,this.deferred=new zu,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Ac),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new zu,this.sendMessage(e),this.deferred.promise}},A(zv,"ParserWorker"),zv),Q1e=(Gv=class{constructor(){this.previousTokenSource=new Kn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=nA();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Kn.CancellationToken.None){const i=new zu,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){kp(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},A(Gv,"DefaultWorkspaceLock"),Gv),J1e=(Wv=class{constructor(e){this.grammarElementIdMap=new sA,this.tokenTypeIdMap=new sA,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of bl(e))r.set(i,{});if(e.$cstNode)for(const i of lm(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Xi(o)?s.push(this.dehydrateAstNode(o,r)):Ss(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Xi(a)?n[i]=this.dehydrateAstNode(a,r):Ss(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return a5(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),ku(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Ff(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of bl(e))r.set(a,{});let i;if(e.$cstNode)for(const a of lm(e.$cstNode)){let s;"fullText"in a?(s=new aP(a.fullText),i=s):"content"in a?s=new X3:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Xi(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Ss(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Xi(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Ss(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),ku(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new Y3(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of bl(this.grammar))c5(r)&&this.grammarElementIdMap.set(r,e++)}},A(Wv,"DefaultHydrator"),Wv);function wa(t){return{documentation:{CommentProvider:A(e=>new K1e(e),"CommentProvider"),DocumentationProvider:A(e=>new j1e(e),"DocumentationProvider")},parser:{AsyncParser:A(e=>new Z1e(e),"AsyncParser"),GrammarConfig:A(e=>bO(e),"GrammarConfig"),LangiumParser:A(e=>hP(e),"LangiumParser"),CompletionParser:A(e=>uP(e),"CompletionParser"),ValueConverter:A(()=>new fP,"ValueConverter"),TokenBuilder:A(()=>new eA,"TokenBuilder"),Lexer:A(e=>new _P(e),"Lexer"),ParserErrorMessageProvider:A(()=>new oP,"ParserErrorMessageProvider"),LexerErrorMessageProvider:A(()=>new $1e,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:A(()=>new I1e,"AstNodeLocator"),AstNodeDescriptionProvider:A(e=>new R1e(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:A(e=>new L1e(e),"ReferenceDescriptionProvider")},references:{Linker:A(e=>new y1e(e),"Linker"),NameProvider:A(()=>new v1e,"NameProvider"),ScopeProvider:A(e=>new C1e(e),"ScopeProvider"),ScopeComputation:A(e=>new x1e(e),"ScopeComputation"),References:A(e=>new b1e(e),"References")},serializer:{Hydrator:A(e=>new J1e(e),"Hydrator"),JsonSerializer:A(e=>new S1e(e),"JsonSerializer")},validation:{DocumentValidator:A(e=>new _1e(e),"DocumentValidator"),ValidationRegistry:A(e=>new E1e(e),"ValidationRegistry")},shared:A(()=>t.shared,"shared")}}A(wa,"createDefaultCoreModule");function Ca(t){return{ServiceRegistry:A(e=>new k1e(e),"ServiceRegistry"),workspace:{LangiumDocuments:A(e=>new m1e(e),"LangiumDocuments"),LangiumDocumentFactory:A(e=>new g1e(e),"LangiumDocumentFactory"),DocumentBuilder:A(e=>new D1e(e),"DocumentBuilder"),IndexManager:A(e=>new N1e(e),"IndexManager"),WorkspaceManager:A(e=>new O1e(e),"WorkspaceManager"),FileSystemProvider:A(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:A(()=>new Q1e,"WorkspaceLock"),ConfigurationProvider:A(e=>new M1e(e),"ConfigurationProvider")},profilers:{}}}A(Ca,"createDefaultSharedCoreModule");var BP;(function(t){t.merge=(e,r)=>Am(Am({},e),r)})(BP||(BP={}));function dn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(Am,{});return zP(u)}A(dn,"inject");var eye=Symbol("isProxy");function FP(t){if(t&&t[eye])for(const e of Object.values(t))FP(e);return t}A(FP,"eagerLoad");function zP(t,e){const r=new Proxy({},{deleteProperty:A(()=>!1,"deleteProperty"),set:A(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:A((n,i)=>i===eye?!0:GP(n,i,t,e||r),"get"),getOwnPropertyDescriptor:A((n,i)=>(GP(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:A((n,i)=>i in t,"has"),ownKeys:A(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}A(zP,"_inject");var tye=Symbol();function GP(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===tye)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=tye;try{t[e]=typeof i=="function"?i(n):zP(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}A(GP,"_resolve");function Am(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Am(i,n):t[r]=Am({},n)}else t[r]=n}return t}A(Am,"_merge");var WP={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Rp;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Rp||(Rp={}));var rye=(qv=class extends eA{constructor(e=WP){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...WP,...e},this.indentTokenType=xm({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=xm({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!dA(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=Rp.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[Rp.REGULAR]:[l,u,...d,h],[Rp.IGNORE_INDENTATION]:[...d,h]},defaultMode:Rp.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return gw(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},A(qv,"IndentationAwareTokenBuilder"),qv),Xct=(Vv=class extends _P{constructor(e){if(super(e),e.parser.TokenBuilder instanceof rye)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=AP){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},A(Vv,"IndentationAwareLexer"),Vv),qP={};Kh(qP,{AstUtils:()=>T9,BiMap:()=>sA,Cancellation:()=>Kn,ContextCache:()=>lA,CstUtils:()=>v9,DONE_RESULT:()=>ks,Deferred:()=>zu,Disposable:()=>_p,DisposableCache:()=>oA,DocumentCache:()=>w1e,EMPTY_STREAM:()=>jg,ErrorWithLocation:()=>L5,GrammarUtils:()=>Q9,MultiMap:()=>Gu,OperationCancelled:()=>Ac,Reduction:()=>_T,RegExpUtils:()=>eO,SimpleCache:()=>TP,StreamImpl:()=>yc,TreeStreamImpl:()=>Kg,URI:()=>ko,UriTrie:()=>vP,UriUtils:()=>Ms,WorkspaceCache:()=>wP,assertCondition:()=>J9,assertUnreachable:()=>nd,delayNextTick:()=>tA,interruptAndCheck:()=>Ta,isOperationCancelled:()=>kp,loadGrammarFromJson:()=>Sa,setInterruptionPeriod:()=>pP,startCancelableOperation:()=>nA,stream:()=>Mn}),jE(qP,uA);var nye=(Uv=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},A(Uv,"EmptyFileSystemProvider"),Uv),za={fileSystemProvider:A(()=>new nye,"fileSystemProvider")},jct={Grammar:A(()=>{},"Grammar"),LanguageMetaData:A(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Kct={AstReflection:A(()=>new W9,"AstReflection")};function iye(){const t=dn(Ca(za),Kct),e=dn(wa({shared:t}),jct);return t.ServiceRegistry.register(e),e}A(iye,"createMinimalGrammarServices");function Sa(t){const e=iye(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ko.parse(`memory:/${r.name??"grammar"}.langium`)),r}A(Sa,"loadGrammarFromJson"),jE(Use,qP);var Zct=(Hv=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Gu}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new aye(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return A(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},A(Hv,"DefaultLangiumProfiler"),Hv),aye=(Yv=class{constructor(e,r){this.stack=[],this.entries=new Gu,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},A(Yv,"ProfilingTask"),Yv),VP;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(VP||(VP={}));var UP;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(UP||(UP={}));var HP;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(HP||(HP={}));var YP;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(YP||(YP={}));var XP;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(XP||(XP={}));var jP;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(jP||(jP={}));var KP;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(KP||(KP={}));var ZP;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(ZP||(ZP={}));var QP;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(QP||(QP={}));var JP;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(JP||(JP={}));var eB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(eB||(eB={}));var tB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(tB||(tB={}));var rB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(rB||(rB={}));var nB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(nB||(nB={}));var iB;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(iB||(iB={})),{...VP.Terminals,...UP.Terminals,...HP.Terminals,...YP.Terminals,...XP.Terminals,...jP.Terminals,...KP.Terminals,...ZP.Terminals,...QP.Terminals,...JP.Terminals,...eB.Terminals,...tB.Terminals,...nB.Terminals,...rB.Terminals,...iB.Terminals};var sye={$type:"AbnfAlternation",alternatives:"alternatives"},oye={$type:"AbnfConcatenation",elements:"elements"},aB={$type:"AbnfElement",primary:"primary",repeat:"repeat"},lye={$type:"AbnfGroup",element:"element"},cye={$type:"AbnfNumVal",value:"value"},uye={$type:"AbnfOptionalGroup",element:"element"},_m={$type:"AbnfPrimary"},sB={$type:"AbnfRule",definition:"definition",name:"name"},hye={$type:"AbnfRuleName",name:"name"},dye={$type:"AbnfStringLiteral",value:"value"},vA={$type:"Accelerator",name:"name",x:"x",y:"y"},oB={$type:"Alignment",direction:"direction",members:"members"},bA={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Iw={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},lB={$type:"Annotations",x:"x",y:"y"},_c={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Qct(t){return Pi.isInstance(t,_c.$type)}A(Qct,"isArchitecture");var xA={$type:"Axis",label:"label",name:"name"},TA={$type:"Branch",name:"name",order:"order"};function Jct(t){return Pi.isInstance(t,TA.$type)}A(Jct,"isBranch");var fye={$type:"Checkout",branch:"branch"},wA={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},cB={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Rm={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function eut(t){return Pi.isInstance(t,Rm.$type)}A(eut,"isCommit");var CA={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Lp={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},SA={$type:"Curve",entries:"entries",label:"label",name:"name"},Ip={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function tut(t){return Pi.isInstance(t,Ip.$type)}A(tut,"isCynefin");var kA={$type:"Deaccelerator",name:"name",x:"x",y:"y"},pye={$type:"Decorator",strategy:"strategy"},Lm={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},EA={$type:"DomainBlock",domain:"domain",items:"items"};function rut(t){return Pi.isInstance(t,EA.$type)}A(rut,"isDomainBlock");var uB={$type:"DomainItem",label:"label"};function nut(t){return Pi.isInstance(t,uB.$type)}A(nut,"isDomainItem");var gye={$type:"EbnfChoice",alternatives:"alternatives"},mye={$type:"EbnfExceptionPostfix",except:"except"},yye={$type:"EbnfGroup",element:"element"},vye={$type:"EbnfNonTerminal",name:"name"},bye={$type:"EbnfOneOrMorePostfix",operator:"operator"},xye={$type:"EbnfOptional",element:"element"},Tye={$type:"EbnfOptionalPostfix",operator:"operator"},Mw={$type:"EbnfPostfix"},Mp={$type:"EbnfPrimary"},wye={$type:"EbnfRepetition",element:"element"},hB={$type:"EbnfRule",definition:"definition",name:"name"},Cye={$type:"EbnfSequence",elements:"elements"},Sye={$type:"EbnfSpecial",text:"text"},dB={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},kye={$type:"EbnfTerminal",value:"value"},Eye={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Rc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Im={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Dp={$type:"EmFrame"},Dw={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Aye={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},fB={$type:"EmModelEntity",name:"name"};function iut(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}A(iut,"isEmModelEntityType");var AA={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Wu={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function _ye(t){return Pi.isInstance(t,Wu.$type)}A(_ye,"isEmResetFrame");var hd={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},pB={$type:"Entry",axis:"axis",value:"value"},qu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Rye={$type:"Evolution",stages:"stages"},_A={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},gB={$type:"Evolve",component:"component",target:"target"},Np={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function aut(t){return Pi.isInstance(t,Np.$type)}A(aut,"isGitGraph");var Nw={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ow={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function sut(t){return Pi.isInstance(t,Ow.$type)}A(sut,"isInfo");var $w={$type:"Item",classSelector:"classSelector",name:"name"},mB={$type:"Junction",id:"id",in:"in"},Pw={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},RA={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Op={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Mm={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function out(t){return Pi.isInstance(t,Mm.$type)}A(out,"isMerge");var LA={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},yB={$type:"Option",name:"name",value:"value"},Dm={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function lut(t){return Pi.isInstance(t,Dm.$type)}A(lut,"isPacket");var Nm={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function cut(t){return Pi.isInstance(t,Nm.$type)}A(cut,"isPacketBlock");var Lye={$type:"PegAny",dot:"dot"},Iye={$type:"PegGroup",element:"element"},Mye={$type:"PegIdentifier",name:"name"},Dye={$type:"PegLiteral",value:"value"},Nye={$type:"PegOrderedChoice",alternatives:"alternatives"},vB={$type:"PegPrefix",operator:"operator",suffix:"suffix"},Bw={$type:"PegPrimary"},bB={$type:"PegRule",definition:"definition",name:"name"},Oye={$type:"PegSequence",elements:"elements"},xB={$type:"PegSuffix",operator:"operator",primary:"primary"},$p={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function uut(t){return Pi.isInstance(t,$p.$type)}A(uut,"isPie");var IA={$type:"PieSection",label:"label",value:"value"};function hut(t){return Pi.isInstance(t,IA.$type)}A(hut,"isPieSection");var TB={$type:"Pipeline",components:"components",parent:"parent"},MA={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Pp={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Om={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function dut(t){return Pi.isInstance(t,Om.$type)}A(dut,"isRailroad");var $m={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function fut(t){return Pi.isInstance(t,$m.$type)}A(fut,"isRailroadAbnf");var $ye={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Pm={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function put(t){return Pi.isInstance(t,Pm.$type)}A(put,"isRailroadEbnf");var Vu={$type:"RailroadExpression"},Pye={$type:"RailroadNonTerminalExpr",name:"name"},Bye={$type:"RailroadOneOrMoreExpr",element:"element"},Fye={$type:"RailroadOptionalExpr",element:"element"},Bm={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function gut(t){return Pi.isInstance(t,Bm.$type)}A(gut,"isRailroadPeg");var wB={$type:"RailroadRule",definition:"definition",name:"name"},zye={$type:"RailroadSequenceExpr",elements:"elements"},Gye={$type:"RailroadSpecialExpr",text:"text"},Wye={$type:"RailroadTerminalExpr",value:"value"},qye={$type:"RailroadZeroOrMoreExpr",element:"element"},CB={$type:"Section",classSelector:"classSelector",name:"name"},Fm={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},SB={$type:"Size",height:"height",width:"width"},zm={$type:"Statement"},Fw={$type:"Transition",from:"from",label:"label",to:"to"};function mut(t){return Pi.isInstance(t,Fw.$type)}A(mut,"isTransition");var Gm={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function yut(t){return Pi.isInstance(t,Gm.$type)}A(yut,"isTreemap");var kB={$type:"TreemapRow",indent:"indent",item:"item"},Wm={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},zw={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ga={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function vut(t){return Pi.isInstance(t,Ga.$type)}A(vut,"isWardley");var Vye=(Xv=class extends x9{constructor(){super(...arguments),this.types={AbnfAlternation:{name:sye.$type,properties:{alternatives:{name:sye.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:oye.$type,properties:{elements:{name:oye.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:aB.$type,properties:{primary:{name:aB.primary},repeat:{name:aB.repeat}},superTypes:[]},AbnfGroup:{name:lye.$type,properties:{element:{name:lye.element}},superTypes:[_m.$type]},AbnfNumVal:{name:cye.$type,properties:{value:{name:cye.value}},superTypes:[_m.$type]},AbnfOptionalGroup:{name:uye.$type,properties:{element:{name:uye.element}},superTypes:[_m.$type]},AbnfPrimary:{name:_m.$type,properties:{},superTypes:[]},AbnfRule:{name:sB.$type,properties:{definition:{name:sB.definition},name:{name:sB.name}},superTypes:[]},AbnfRuleName:{name:hye.$type,properties:{name:{name:hye.name}},superTypes:[_m.$type]},AbnfStringLiteral:{name:dye.$type,properties:{value:{name:dye.value}},superTypes:[_m.$type]},Accelerator:{name:vA.$type,properties:{name:{name:vA.name},x:{name:vA.x},y:{name:vA.y}},superTypes:[]},Alignment:{name:oB.$type,properties:{direction:{name:oB.direction},members:{name:oB.members,defaultValue:[]}},superTypes:[]},Anchor:{name:bA.$type,properties:{evolution:{name:bA.evolution},name:{name:bA.name},visibility:{name:bA.visibility}},superTypes:[]},Annotation:{name:Iw.$type,properties:{number:{name:Iw.number},text:{name:Iw.text},x:{name:Iw.x},y:{name:Iw.y}},superTypes:[]},Annotations:{name:lB.$type,properties:{x:{name:lB.x},y:{name:lB.y}},superTypes:[]},Architecture:{name:_c.$type,properties:{accDescr:{name:_c.accDescr},accTitle:{name:_c.accTitle},alignments:{name:_c.alignments,defaultValue:[]},edges:{name:_c.edges,defaultValue:[]},groups:{name:_c.groups,defaultValue:[]},junctions:{name:_c.junctions,defaultValue:[]},services:{name:_c.services,defaultValue:[]},title:{name:_c.title}},superTypes:[]},Axis:{name:xA.$type,properties:{label:{name:xA.label},name:{name:xA.name}},superTypes:[]},Branch:{name:TA.$type,properties:{name:{name:TA.name},order:{name:TA.order}},superTypes:[zm.$type]},Checkout:{name:fye.$type,properties:{branch:{name:fye.branch}},superTypes:[zm.$type]},CherryPicking:{name:wA.$type,properties:{id:{name:wA.id},parent:{name:wA.parent},tags:{name:wA.tags,defaultValue:[]}},superTypes:[zm.$type]},ClassDefStatement:{name:cB.$type,properties:{className:{name:cB.className},styleText:{name:cB.styleText}},superTypes:[]},Commit:{name:Rm.$type,properties:{id:{name:Rm.id},message:{name:Rm.message},tags:{name:Rm.tags,defaultValue:[]},type:{name:Rm.type}},superTypes:[zm.$type]},Common:{name:CA.$type,properties:{accDescr:{name:CA.accDescr},accTitle:{name:CA.accTitle},title:{name:CA.title}},superTypes:[]},Component:{name:Lp.$type,properties:{decorator:{name:Lp.decorator},evolution:{name:Lp.evolution},inertia:{name:Lp.inertia,defaultValue:!1},label:{name:Lp.label},name:{name:Lp.name},visibility:{name:Lp.visibility}},superTypes:[]},Curve:{name:SA.$type,properties:{entries:{name:SA.entries,defaultValue:[]},label:{name:SA.label},name:{name:SA.name}},superTypes:[]},Cynefin:{name:Ip.$type,properties:{accDescr:{name:Ip.accDescr},accTitle:{name:Ip.accTitle},domains:{name:Ip.domains,defaultValue:[]},title:{name:Ip.title},transitions:{name:Ip.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:kA.$type,properties:{name:{name:kA.name},x:{name:kA.x},y:{name:kA.y}},superTypes:[]},Decorator:{name:pye.$type,properties:{strategy:{name:pye.strategy}},superTypes:[]},Direction:{name:Lm.$type,properties:{accDescr:{name:Lm.accDescr},accTitle:{name:Lm.accTitle},dir:{name:Lm.dir},statements:{name:Lm.statements,defaultValue:[]},title:{name:Lm.title}},superTypes:[Np.$type]},DomainBlock:{name:EA.$type,properties:{domain:{name:EA.domain},items:{name:EA.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:uB.$type,properties:{label:{name:uB.label}},superTypes:[]},EbnfChoice:{name:gye.$type,properties:{alternatives:{name:gye.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:mye.$type,properties:{except:{name:mye.except}},superTypes:[Mw.$type]},EbnfGroup:{name:yye.$type,properties:{element:{name:yye.element}},superTypes:[Mp.$type]},EbnfNonTerminal:{name:vye.$type,properties:{name:{name:vye.name}},superTypes:[Mp.$type]},EbnfOneOrMorePostfix:{name:bye.$type,properties:{operator:{name:bye.operator}},superTypes:[Mw.$type]},EbnfOptional:{name:xye.$type,properties:{element:{name:xye.element}},superTypes:[Mp.$type]},EbnfOptionalPostfix:{name:Tye.$type,properties:{operator:{name:Tye.operator}},superTypes:[Mw.$type]},EbnfPostfix:{name:Mw.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Mp.$type,properties:{},superTypes:[]},EbnfRepetition:{name:wye.$type,properties:{element:{name:wye.element}},superTypes:[Mp.$type]},EbnfRule:{name:hB.$type,properties:{definition:{name:hB.definition},name:{name:hB.name}},superTypes:[]},EbnfSequence:{name:Cye.$type,properties:{elements:{name:Cye.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Sye.$type,properties:{text:{name:Sye.text}},superTypes:[Mp.$type]},EbnfTerm:{name:dB.$type,properties:{base:{name:dB.base},postfixes:{name:dB.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:kye.$type,properties:{value:{name:kye.value}},superTypes:[Mp.$type]},EbnfZeroOrMorePostfix:{name:Eye.$type,properties:{operator:{name:Eye.operator}},superTypes:[Mw.$type]},Edge:{name:Rc.$type,properties:{lhsDir:{name:Rc.lhsDir},lhsGroup:{name:Rc.lhsGroup,defaultValue:!1},lhsId:{name:Rc.lhsId},lhsInto:{name:Rc.lhsInto,defaultValue:!1},rhsDir:{name:Rc.rhsDir},rhsGroup:{name:Rc.rhsGroup,defaultValue:!1},rhsId:{name:Rc.rhsId},rhsInto:{name:Rc.rhsInto,defaultValue:!1},title:{name:Rc.title}},superTypes:[]},EmDataEntity:{name:Im.$type,properties:{dataBlockValue:{name:Im.dataBlockValue},dataType:{name:Im.dataType},name:{name:Im.name}},superTypes:[]},EmFrame:{name:Dp.$type,properties:{},superTypes:[]},EmGwt:{name:Dw.$type,properties:{givenStatements:{name:Dw.givenStatements,defaultValue:[]},sourceFrame:{name:Dw.sourceFrame,referenceType:Dp.$type},thenStatements:{name:Dw.thenStatements,defaultValue:[]},whenStatements:{name:Dw.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Aye.$type,properties:{entityIdentifier:{name:Aye.entityIdentifier,referenceType:fB.$type}},superTypes:[]},EmModelEntity:{name:fB.$type,properties:{name:{name:fB.name}},superTypes:[]},EmNoteEntity:{name:AA.$type,properties:{dataBlockValue:{name:AA.dataBlockValue},dataType:{name:AA.dataType},sourceFrame:{name:AA.sourceFrame,referenceType:Dp.$type}},superTypes:[]},EmResetFrame:{name:Wu.$type,properties:{dataInlineValue:{name:Wu.dataInlineValue},dataReference:{name:Wu.dataReference,referenceType:Im.$type},dataType:{name:Wu.dataType},entityIdentifier:{name:Wu.entityIdentifier},modelEntityType:{name:Wu.modelEntityType},name:{name:Wu.name},sourceFrames:{name:Wu.sourceFrames,defaultValue:[],referenceType:Dp.$type}},superTypes:[Dp.$type]},EmTimeFrame:{name:hd.$type,properties:{dataInlineValue:{name:hd.dataInlineValue},dataReference:{name:hd.dataReference,referenceType:Im.$type},dataType:{name:hd.dataType},entityIdentifier:{name:hd.entityIdentifier},modelEntityType:{name:hd.modelEntityType},name:{name:hd.name},sourceFrames:{name:hd.sourceFrames,defaultValue:[],referenceType:Dp.$type}},superTypes:[Dp.$type]},Entry:{name:pB.$type,properties:{axis:{name:pB.axis,referenceType:xA.$type},value:{name:pB.value}},superTypes:[]},EventModel:{name:qu.$type,properties:{accDescr:{name:qu.accDescr},accTitle:{name:qu.accTitle},dataEntities:{name:qu.dataEntities,defaultValue:[]},frames:{name:qu.frames,defaultValue:[]},gwtEntities:{name:qu.gwtEntities,defaultValue:[]},modelEntities:{name:qu.modelEntities,defaultValue:[]},noteEntities:{name:qu.noteEntities,defaultValue:[]},title:{name:qu.title}},superTypes:[]},Evolution:{name:Rye.$type,properties:{stages:{name:Rye.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:_A.$type,properties:{boundary:{name:_A.boundary},name:{name:_A.name},secondName:{name:_A.secondName}},superTypes:[]},Evolve:{name:gB.$type,properties:{component:{name:gB.component},target:{name:gB.target}},superTypes:[]},GitGraph:{name:Np.$type,properties:{accDescr:{name:Np.accDescr},accTitle:{name:Np.accTitle},statements:{name:Np.statements,defaultValue:[]},title:{name:Np.title}},superTypes:[]},Group:{name:Nw.$type,properties:{icon:{name:Nw.icon},id:{name:Nw.id},in:{name:Nw.in},title:{name:Nw.title}},superTypes:[]},Info:{name:Ow.$type,properties:{accDescr:{name:Ow.accDescr},accTitle:{name:Ow.accTitle},title:{name:Ow.title}},superTypes:[]},Item:{name:$w.$type,properties:{classSelector:{name:$w.classSelector},name:{name:$w.name}},superTypes:[]},Junction:{name:mB.$type,properties:{id:{name:mB.id},in:{name:mB.in}},superTypes:[]},Label:{name:Pw.$type,properties:{negX:{name:Pw.negX,defaultValue:!1},negY:{name:Pw.negY,defaultValue:!1},offsetX:{name:Pw.offsetX},offsetY:{name:Pw.offsetY}},superTypes:[]},Leaf:{name:RA.$type,properties:{classSelector:{name:RA.classSelector},name:{name:RA.name},value:{name:RA.value}},superTypes:[$w.$type]},Link:{name:Op.$type,properties:{arrow:{name:Op.arrow},from:{name:Op.from},fromPort:{name:Op.fromPort},linkLabel:{name:Op.linkLabel},to:{name:Op.to},toPort:{name:Op.toPort}},superTypes:[]},Merge:{name:Mm.$type,properties:{branch:{name:Mm.branch},id:{name:Mm.id},tags:{name:Mm.tags,defaultValue:[]},type:{name:Mm.type}},superTypes:[zm.$type]},Note:{name:LA.$type,properties:{evolution:{name:LA.evolution},text:{name:LA.text},visibility:{name:LA.visibility}},superTypes:[]},Option:{name:yB.$type,properties:{name:{name:yB.name},value:{name:yB.value,defaultValue:!1}},superTypes:[]},Packet:{name:Dm.$type,properties:{accDescr:{name:Dm.accDescr},accTitle:{name:Dm.accTitle},blocks:{name:Dm.blocks,defaultValue:[]},title:{name:Dm.title}},superTypes:[]},PacketBlock:{name:Nm.$type,properties:{bits:{name:Nm.bits},end:{name:Nm.end},label:{name:Nm.label},start:{name:Nm.start}},superTypes:[]},PegAny:{name:Lye.$type,properties:{dot:{name:Lye.dot}},superTypes:[Bw.$type]},PegGroup:{name:Iye.$type,properties:{element:{name:Iye.element}},superTypes:[Bw.$type]},PegIdentifier:{name:Mye.$type,properties:{name:{name:Mye.name}},superTypes:[Bw.$type]},PegLiteral:{name:Dye.$type,properties:{value:{name:Dye.value}},superTypes:[Bw.$type]},PegOrderedChoice:{name:Nye.$type,properties:{alternatives:{name:Nye.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:vB.$type,properties:{operator:{name:vB.operator},suffix:{name:vB.suffix}},superTypes:[]},PegPrimary:{name:Bw.$type,properties:{},superTypes:[]},PegRule:{name:bB.$type,properties:{definition:{name:bB.definition},name:{name:bB.name}},superTypes:[]},PegSequence:{name:Oye.$type,properties:{elements:{name:Oye.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:xB.$type,properties:{operator:{name:xB.operator},primary:{name:xB.primary}},superTypes:[]},Pie:{name:$p.$type,properties:{accDescr:{name:$p.accDescr},accTitle:{name:$p.accTitle},sections:{name:$p.sections,defaultValue:[]},showData:{name:$p.showData,defaultValue:!1},title:{name:$p.title}},superTypes:[]},PieSection:{name:IA.$type,properties:{label:{name:IA.label},value:{name:IA.value}},superTypes:[]},Pipeline:{name:TB.$type,properties:{components:{name:TB.components,defaultValue:[]},parent:{name:TB.parent}},superTypes:[]},PipelineComponent:{name:MA.$type,properties:{evolution:{name:MA.evolution},label:{name:MA.label},name:{name:MA.name}},superTypes:[]},Radar:{name:Pp.$type,properties:{accDescr:{name:Pp.accDescr},accTitle:{name:Pp.accTitle},axes:{name:Pp.axes,defaultValue:[]},curves:{name:Pp.curves,defaultValue:[]},options:{name:Pp.options,defaultValue:[]},title:{name:Pp.title}},superTypes:[]},Railroad:{name:Om.$type,properties:{accDescr:{name:Om.accDescr},accTitle:{name:Om.accTitle},rules:{name:Om.rules,defaultValue:[]},title:{name:Om.title}},superTypes:[]},RailroadAbnf:{name:$m.$type,properties:{accDescr:{name:$m.accDescr},accTitle:{name:$m.accTitle},rules:{name:$m.rules,defaultValue:[]},title:{name:$m.title}},superTypes:[]},RailroadChoiceExpr:{name:$ye.$type,properties:{alternatives:{name:$ye.alternatives,defaultValue:[]}},superTypes:[Vu.$type]},RailroadEbnf:{name:Pm.$type,properties:{accDescr:{name:Pm.accDescr},accTitle:{name:Pm.accTitle},rules:{name:Pm.rules,defaultValue:[]},title:{name:Pm.title}},superTypes:[]},RailroadExpression:{name:Vu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Pye.$type,properties:{name:{name:Pye.name}},superTypes:[Vu.$type]},RailroadOneOrMoreExpr:{name:Bye.$type,properties:{element:{name:Bye.element}},superTypes:[Vu.$type]},RailroadOptionalExpr:{name:Fye.$type,properties:{element:{name:Fye.element}},superTypes:[Vu.$type]},RailroadPeg:{name:Bm.$type,properties:{accDescr:{name:Bm.accDescr},accTitle:{name:Bm.accTitle},rules:{name:Bm.rules,defaultValue:[]},title:{name:Bm.title}},superTypes:[]},RailroadRule:{name:wB.$type,properties:{definition:{name:wB.definition},name:{name:wB.name}},superTypes:[]},RailroadSequenceExpr:{name:zye.$type,properties:{elements:{name:zye.elements,defaultValue:[]}},superTypes:[Vu.$type]},RailroadSpecialExpr:{name:Gye.$type,properties:{text:{name:Gye.text}},superTypes:[Vu.$type]},RailroadTerminalExpr:{name:Wye.$type,properties:{value:{name:Wye.value}},superTypes:[Vu.$type]},RailroadZeroOrMoreExpr:{name:qye.$type,properties:{element:{name:qye.element}},superTypes:[Vu.$type]},Section:{name:CB.$type,properties:{classSelector:{name:CB.classSelector},name:{name:CB.name}},superTypes:[$w.$type]},Service:{name:Fm.$type,properties:{icon:{name:Fm.icon},iconText:{name:Fm.iconText},id:{name:Fm.id},in:{name:Fm.in},title:{name:Fm.title}},superTypes:[]},Size:{name:SB.$type,properties:{height:{name:SB.height},width:{name:SB.width}},superTypes:[]},Statement:{name:zm.$type,properties:{},superTypes:[]},Transition:{name:Fw.$type,properties:{from:{name:Fw.from},label:{name:Fw.label},to:{name:Fw.to}},superTypes:[]},TreeNode:{name:Wm.$type,properties:{classAnnotation:{name:Wm.classAnnotation},descAnnotation:{name:Wm.descAnnotation},iconAnnotation:{name:Wm.iconAnnotation},indent:{name:Wm.indent},name:{name:Wm.name}},superTypes:[]},TreeView:{name:zw.$type,properties:{accDescr:{name:zw.accDescr},accTitle:{name:zw.accTitle},nodes:{name:zw.nodes,defaultValue:[]},title:{name:zw.title}},superTypes:[]},Treemap:{name:Gm.$type,properties:{accDescr:{name:Gm.accDescr},accTitle:{name:Gm.accTitle},title:{name:Gm.title},TreemapRows:{name:Gm.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:kB.$type,properties:{indent:{name:kB.indent},item:{name:kB.item}},superTypes:[]},Wardley:{name:Ga.$type,properties:{accDescr:{name:Ga.accDescr},accelerators:{name:Ga.accelerators,defaultValue:[]},accTitle:{name:Ga.accTitle},anchors:{name:Ga.anchors,defaultValue:[]},annotation:{name:Ga.annotation,defaultValue:[]},annotations:{name:Ga.annotations,defaultValue:[]},components:{name:Ga.components,defaultValue:[]},deaccelerators:{name:Ga.deaccelerators,defaultValue:[]},evolution:{name:Ga.evolution},evolves:{name:Ga.evolves,defaultValue:[]},links:{name:Ga.links,defaultValue:[]},notes:{name:Ga.notes,defaultValue:[]},pipelines:{name:Ga.pipelines,defaultValue:[]},size:{name:Ga.size},title:{name:Ga.title}},superTypes:[]}}}},A(Xv,"MermaidAstReflection"),Xv),Pi=new Vye,Uye,but=A(()=>Uye??(Uye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Hye,xut=A(()=>Hye??(Hye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),Yye,Tut=A(()=>Yye??(Yye=Sa('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Xye,wut=A(()=>Xye??(Xye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),jye,Cut=A(()=>jye??(jye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Kye,Sut=A(()=>Kye??(Kye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Zye,kut=A(()=>Zye??(Zye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Qye,Eut=A(()=>Qye??(Qye=Sa(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Jye,Aut=A(()=>Jye??(Jye=Sa('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),eve,_ut=A(()=>eve??(eve=Sa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),tve,Rut=A(()=>tve??(tve=Sa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),rve,Lut=A(()=>rve??(rve=Sa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),nve,Iut=A(()=>nve??(nve=Sa(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),ive,Mut=A(()=>ive??(ive=Sa(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),ave,Dut=A(()=>ave??(ave=Sa(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Nut={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Out={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$ut={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Put={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},But={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fut={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zut={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gut={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wut={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qut={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vut={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Uut={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hut={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Yut={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Xut={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ds={AstReflection:A(()=>new Vye,"AstReflection")},jut={Grammar:A(()=>but(),"Grammar"),LanguageMetaData:A(()=>Nut,"LanguageMetaData"),parser:{}},Kut={Grammar:A(()=>xut(),"Grammar"),LanguageMetaData:A(()=>Out,"LanguageMetaData"),parser:{}},Zut={Grammar:A(()=>Tut(),"Grammar"),LanguageMetaData:A(()=>$ut,"LanguageMetaData"),parser:{}},Qut={Grammar:A(()=>wut(),"Grammar"),LanguageMetaData:A(()=>Put,"LanguageMetaData"),parser:{}},Jut={Grammar:A(()=>Cut(),"Grammar"),LanguageMetaData:A(()=>But,"LanguageMetaData"),parser:{}},eht={Grammar:A(()=>Sut(),"Grammar"),LanguageMetaData:A(()=>Fut,"LanguageMetaData"),parser:{}},tht={Grammar:A(()=>kut(),"Grammar"),LanguageMetaData:A(()=>zut,"LanguageMetaData"),parser:{}},rht={Grammar:A(()=>Eut(),"Grammar"),LanguageMetaData:A(()=>Gut,"LanguageMetaData"),parser:{}},nht={Grammar:A(()=>Aut(),"Grammar"),LanguageMetaData:A(()=>Wut,"LanguageMetaData"),parser:{}},iht={Grammar:A(()=>_ut(),"Grammar"),LanguageMetaData:A(()=>qut,"LanguageMetaData"),parser:{}},aht={Grammar:A(()=>Rut(),"Grammar"),LanguageMetaData:A(()=>Vut,"LanguageMetaData"),parser:{}},sht={Grammar:A(()=>Lut(),"Grammar"),LanguageMetaData:A(()=>Uut,"LanguageMetaData"),parser:{}},oht={Grammar:A(()=>Iut(),"Grammar"),LanguageMetaData:A(()=>Hut,"LanguageMetaData"),parser:{}},lht={Grammar:A(()=>Mut(),"Grammar"),LanguageMetaData:A(()=>Yut,"LanguageMetaData"),parser:{}},cht={Grammar:A(()=>Dut(),"Grammar"),LanguageMetaData:A(()=>Xut,"LanguageMetaData"),parser:{}},uht=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,hht=/accTitle[\t ]*:([^\n\r]*)/,dht=/title([\t ][^\n\r]*|)/,fht={ACC_DESCR:uht,ACC_TITLE:hht,TITLE:dht},Lc=(jv=class extends fP{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=fht[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},A(jv,"AbstractMermaidValueConverter"),jv),qm=(Kv=class extends Lc{runCustomConverter(e,r,n){}},A(Kv,"CommonValueConverter"),Kv),Ns=(Zv=class extends eA{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},A(Zv,"AbstractMermaidTokenBuilder"),Zv);Qv=class extends Ns{},A(Qv,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -1334,39 +1340,39 @@ ${r}`),this.inline?`{${i}}`:i}},E(By,"JSDocTagImpl"),By);function rpe(t,e,r){var * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) - */var dat=(iv=class extends hs{constructor(){super(["radar-beta"])}},E(iv,"RadarTokenBuilder"),iv),m0e={parser:{TokenBuilder:E(()=>new dat,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")}};function y0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),eat,m0e);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}E(y0e,"createRadarServices");var fat=(av=class extends hs{constructor(){super(["railroad-beta"])}},E(av,"RailroadTokenBuilder"),av),v0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew fat,"TokenBuilder"),ValueConverter:E(()=>new pat,"ValueConverter")}};function x0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),nat,b0e);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}E(x0e,"createRailroadServices");var gat=(ov=class extends hs{constructor(){super(["railroad-ebnf-beta"])}},E(ov,"RailroadEbnfTokenBuilder"),ov),T0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew gat,"TokenBuilder"),ValueConverter:E(()=>new mat,"ValueConverter")}};function C0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),rat,w0e);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}E(C0e,"createRailroadEbnfServices");var yat=(cv=class extends hs{constructor(){super(["railroad-abnf-beta"])}},E(cv,"RailroadAbnfTokenBuilder"),cv),vat=(uv=class extends tc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},E(uv,"RailroadAbnfValueConverter"),uv),k0e={parser:{TokenBuilder:E(()=>new yat,"TokenBuilder"),ValueConverter:E(()=>new vat,"ValueConverter")}};function E0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),tat,k0e);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}E(E0e,"createRailroadAbnfServices");var bat=(hv=class extends hs{constructor(){super(["railroad-peg-beta"])}},E(hv,"RailroadPegTokenBuilder"),hv),S0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew bat,"TokenBuilder"),ValueConverter:E(()=>new xat,"ValueConverter")}};function _0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),iat,A0e);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}E(_0e,"createRailroadPegServices");var Tat=(fv=class extends hs{constructor(){super(["treemap"])}},E(fv,"TreemapTokenBuilder"),fv),wat=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Cat=(pv=class extends tc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=wat.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},E(pv,"TreemapValueConverter"),pv);function R0e(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}E(R0e,"registerValidationChecks");var kat=(gv=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},E(gv,"TreemapValidator"),gv),L0e={parser:{TokenBuilder:E(()=>new Tat,"TokenBuilder"),ValueConverter:E(()=>new Cat,"ValueConverter")},validation:{TreemapValidator:E(()=>new kat,"TreemapValidator")}};function I0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),aat,L0e);return e.ServiceRegistry.register(r),R0e(r),{shared:e,Treemap:r}}E(I0e,"createTreemapServices");var Eat=(mv=class extends tc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},E(mv,"WardleyValueConverter"),mv),D0e={parser:{ValueConverter:E(()=>new Eat,"ValueConverter")}};function M0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),oat,D0e);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}E(M0e,"createWardleyServices");var Sat=(yv=class extends hs{constructor(){super(["cynefin-beta"])}},E(yv,"CynefinTokenBuilder"),yv),N0e={parser:{TokenBuilder:E(()=>new Sat,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")}};function O0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Xit,N0e);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}E(O0e,"createCynefinServices");var Aat=(vv=class extends hs{constructor(){super(["gitGraph"])}},E(vv,"GitGraphTokenBuilder"),vv),$0e={parser:{TokenBuilder:E(()=>new Aat,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")}};function P0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),jit,$0e);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}E(P0e,"createGitGraphServices");var _at=(bv=class extends hs{constructor(){super(["info","showInfo"])}},E(bv,"InfoTokenBuilder"),bv),B0e={parser:{TokenBuilder:E(()=>new _at,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")}};function F0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Zit,B0e);return e.ServiceRegistry.register(r),{shared:e,Info:r}}E(F0e,"createInfoServices");var Rat=(xv=class extends hs{constructor(){super(["packet"])}},E(xv,"PacketTokenBuilder"),xv),z0e={parser:{TokenBuilder:E(()=>new Rat,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")}};function G0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Qit,z0e);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}E(G0e,"createPacketServices");var Lat=(Tv=class extends hs{constructor(){super(["pie","showData"])}},E(Tv,"PieTokenBuilder"),Tv),Iat=(wv=class extends tc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},E(wv,"PieValueConverter"),wv),q0e={parser:{TokenBuilder:E(()=>new Lat,"TokenBuilder"),ValueConverter:E(()=>new Iat,"ValueConverter")}};function V0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Jit,q0e);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}E(V0e,"createPieServices");var Dat=(Cv=class extends tc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},E(Cv,"TreeViewValueConverter"),Cv),Mat=(kv=class extends hs{constructor(){super(["treeView-beta"])}},E(kv,"TreeViewTokenBuilder"),kv),W0e={parser:{TokenBuilder:E(()=>new Mat,"TokenBuilder"),ValueConverter:E(()=>new Dat,"ValueConverter")}};function U0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),sat,W0e);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}E(U0e,"createTreeViewServices");var Nat=(Ev=class extends hs{constructor(){super(["architecture"])}},E(Ev,"ArchitectureTokenBuilder"),Ev),Oat=(Sv=class extends tc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},E(Sv,"ArchitectureValueConverter"),Sv),H0e={parser:{TokenBuilder:E(()=>new Nat,"TokenBuilder"),ValueConverter:E(()=>new Oat,"ValueConverter")}};function Y0e(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Yit,H0e);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}E(Y0e,"createArchitectureServices");var $at=(Av=class extends hs{constructor(){super(["eventmodeling"])}},E(Av,"EventModelingTokenBuilder"),Av),X0e=new Set(["cmd","command"]),K0e=new Set(["evt","event"]),YO=new Set(["rmo","readmodel"]),j0e=new Set(["pcr","processor"]),Z0e=new Set(["ui"]);function Q0e(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}E(Q0e,"registerValidationChecks");var Pat=(_v=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(X0e.has(e.modelEntityType)?this.validateSources(e,new Set([...Z0e,...j0e]),"command","ui or processor",r):K0e.has(e.modelEntityType)?this.validateSources(e,X0e,"event","command",r):YO.has(e.modelEntityType)?this.validateSources(e,K0e,"read model","event",r):j0e.has(e.modelEntityType)?this.validateSources(e,YO,"processor","read model",r):Z0e.has(e.modelEntityType)&&this.validateSources(e,YO,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},E(_v,"EventModelingValidator"),_v),J0e={parser:{TokenBuilder:E(()=>new $at,"TokenBuilder"),ValueConverter:E(()=>new Qg,"ValueConverter")},validation:{EventModelingValidator:E(()=>new Pat,"EventModelingValidator")}};function ege(t=va){const e=Xr(ra(t),us),r=Xr(ta({shared:e}),Kit,J0e);return e.ServiceRegistry.register(r),Q0e(r),{shared:e,EventModel:r}}E(ege,"createEventModelingServices");var xa={},Bat={info:E(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>Zmt),e=t().Info.parser.LangiumParser;xa.info=e},"info"),packet:E(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>Qmt),e=t().Packet.parser.LangiumParser;xa.packet=e},"packet"),pie:E(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>Jmt),e=t().Pie.parser.LangiumParser;xa.pie=e},"pie"),treeView:E(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>e1t),e=t().TreeView.parser.LangiumParser;xa.treeView=e},"treeView"),architecture:E(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>t1t),e=t().Architecture.parser.LangiumParser;xa.architecture=e},"architecture"),gitGraph:E(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>r1t),e=t().GitGraph.parser.LangiumParser;xa.gitGraph=e},"gitGraph"),eventmodeling:E(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>n1t),e=t().EventModel.parser.LangiumParser;xa.eventmodeling=e},"eventmodeling"),radar:E(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>i1t),e=t().Radar.parser.LangiumParser;xa.radar=e},"radar"),railroad:E(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>a1t),e=t().Railroad.parser.LangiumParser;xa.railroad=e},"railroad"),railroadEbnf:E(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>s1t),e=t().RailroadEbnf.parser.LangiumParser;xa.railroadEbnf=e},"railroadEbnf"),railroadAbnf:E(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>o1t),e=t().RailroadAbnf.parser.LangiumParser;xa.railroadAbnf=e},"railroadAbnf"),railroadPeg:E(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>l1t),e=t().RailroadPeg.parser.LangiumParser;xa.railroadPeg=e},"railroadPeg"),treemap:E(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>c1t),e=t().Treemap.parser.LangiumParser;xa.treemap=e},"treemap"),wardley:E(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>u1t),e=t().Wardley.parser.LangiumParser;xa.wardley=e},"wardley"),cynefin:E(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>h1t),e=t().Cynefin.parser.LangiumParser;xa.cynefin=e},"cynefin")};async function Qo(t,e){const r=Bat[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);xa[t]||await r();const i=xa[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Fat(i);return i.value}E(Qo,"parse");var Fat=(Rv=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` + */var pht=(Jv=class extends Ns{constructor(){super(["radar-beta"])}},A(Jv,"RadarTokenBuilder"),Jv),sve={parser:{TokenBuilder:A(()=>new pht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")}};function ove(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),rht,sve);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(ove,"createRadarServices");var ght=(e2=class extends Ns{constructor(){super(["railroad-beta"])}},A(e2,"RailroadTokenBuilder"),e2),lve=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew ght,"TokenBuilder"),ValueConverter:A(()=>new mht,"ValueConverter")}};function EB(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),aht,cve);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}A(EB,"createRailroadServices");var yht=(r2=class extends Ns{constructor(){super(["railroad-ebnf-beta"])}},A(r2,"RailroadEbnfTokenBuilder"),r2),uve=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew yht,"TokenBuilder"),ValueConverter:A(()=>new vht,"ValueConverter")}};function AB(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),iht,hve);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}A(AB,"createRailroadEbnfServices");var bht=(i2=class extends Ns{constructor(){super(["railroad-abnf-beta"])}},A(i2,"RailroadAbnfTokenBuilder"),i2),xht=(a2=class extends Lc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},A(a2,"RailroadAbnfValueConverter"),a2),dve={parser:{TokenBuilder:A(()=>new bht,"TokenBuilder"),ValueConverter:A(()=>new xht,"ValueConverter")}};function _B(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),nht,dve);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}A(_B,"createRailroadAbnfServices");var Tht=(s2=class extends Ns{constructor(){super(["railroad-peg-beta"])}},A(s2,"RailroadPegTokenBuilder"),s2),fve=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Tht,"TokenBuilder"),ValueConverter:A(()=>new wht,"ValueConverter")}};function RB(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),sht,pve);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}A(RB,"createRailroadPegServices");var Cht=(l2=class extends Ns{constructor(){super(["treemap"])}},A(l2,"TreemapTokenBuilder"),l2),Sht=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,kht=(c2=class extends Lc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=Sht.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},A(c2,"TreemapValueConverter"),c2);function gve(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(gve,"registerValidationChecks");var Eht=(u2=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},A(u2,"TreemapValidator"),u2),mve={parser:{TokenBuilder:A(()=>new Cht,"TokenBuilder"),ValueConverter:A(()=>new kht,"ValueConverter")},validation:{TreemapValidator:A(()=>new Eht,"TreemapValidator")}};function yve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),oht,mve);return e.ServiceRegistry.register(r),gve(r),{shared:e,Treemap:r}}A(yve,"createTreemapServices");var Aht=(h2=class extends Lc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},A(h2,"WardleyValueConverter"),h2),vve={parser:{ValueConverter:A(()=>new Aht,"ValueConverter")}};function bve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),cht,vve);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}A(bve,"createWardleyServices");var _ht=(d2=class extends Ns{constructor(){super(["cynefin-beta"])}},A(d2,"CynefinTokenBuilder"),d2),xve={parser:{TokenBuilder:A(()=>new _ht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")}};function Tve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),Kut,xve);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}A(Tve,"createCynefinServices");var Rht=(f2=class extends Ns{constructor(){super(["gitGraph"])}},A(f2,"GitGraphTokenBuilder"),f2),wve={parser:{TokenBuilder:A(()=>new Rht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")}};function Cve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),Qut,wve);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(Cve,"createGitGraphServices");var Lht=(p2=class extends Ns{constructor(){super(["info","showInfo"])}},A(p2,"InfoTokenBuilder"),p2),Sve={parser:{TokenBuilder:A(()=>new Lht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")}};function kve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),Jut,Sve);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(kve,"createInfoServices");var Iht=(g2=class extends Ns{constructor(){super(["packet"])}},A(g2,"PacketTokenBuilder"),g2),Eve={parser:{TokenBuilder:A(()=>new Iht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")}};function Ave(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),eht,Eve);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(Ave,"createPacketServices");var Mht=(m2=class extends Ns{constructor(){super(["pie","showData"])}},A(m2,"PieTokenBuilder"),m2),Dht=(y2=class extends Lc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},A(y2,"PieValueConverter"),y2),_ve={parser:{TokenBuilder:A(()=>new Mht,"TokenBuilder"),ValueConverter:A(()=>new Dht,"ValueConverter")}};function Rve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),tht,_ve);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(Rve,"createPieServices");var Nht=(v2=class extends Lc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},A(v2,"TreeViewValueConverter"),v2),Oht=(b2=class extends Ns{constructor(){super(["treeView-beta"])}},A(b2,"TreeViewTokenBuilder"),b2),Lve={parser:{TokenBuilder:A(()=>new Oht,"TokenBuilder"),ValueConverter:A(()=>new Nht,"ValueConverter")}};function Ive(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),lht,Lve);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}A(Ive,"createTreeViewServices");var $ht=(x2=class extends Ns{constructor(){super(["architecture"])}},A(x2,"ArchitectureTokenBuilder"),x2),Pht=(T2=class extends Lc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},A(T2,"ArchitectureValueConverter"),T2),Mve={parser:{TokenBuilder:A(()=>new $ht,"TokenBuilder"),ValueConverter:A(()=>new Pht,"ValueConverter")}};function Dve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),jut,Mve);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(Dve,"createArchitectureServices");var Bht=(w2=class extends Ns{constructor(){super(["eventmodeling"])}},A(w2,"EventModelingTokenBuilder"),w2),Nve=new Set(["cmd","command"]),Ove=new Set(["evt","event"]),LB=new Set(["rmo","readmodel"]),$ve=new Set(["pcr","processor"]),Pve=new Set(["ui"]);function Bve(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}A(Bve,"registerValidationChecks");var Fht=(C2=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(Nve.has(e.modelEntityType)?this.validateSources(e,new Set([...Pve,...$ve]),"command","ui or processor",r):Ove.has(e.modelEntityType)?this.validateSources(e,Nve,"event","command",r):LB.has(e.modelEntityType)?this.validateSources(e,Ove,"read model","event",r):$ve.has(e.modelEntityType)?this.validateSources(e,LB,"processor","read model",r):Pve.has(e.modelEntityType)&&this.validateSources(e,LB,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},A(C2,"EventModelingValidator"),C2),Fve={parser:{TokenBuilder:A(()=>new Bht,"TokenBuilder"),ValueConverter:A(()=>new qm,"ValueConverter")},validation:{EventModelingValidator:A(()=>new Fht,"EventModelingValidator")}};function zve(t=za){const e=dn(Ca(t),Ds),r=dn(wa({shared:e}),Zut,Fve);return e.ServiceRegistry.register(r),Bve(r),{shared:e,EventModel:r}}A(zve,"createEventModelingServices");var Wa={},zht={info:A(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>xwt),e=t().Info.parser.LangiumParser;Wa.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>Twt),e=t().Packet.parser.LangiumParser;Wa.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>wwt),e=t().Pie.parser.LangiumParser;Wa.pie=e},"pie"),treeView:A(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>Cwt),e=t().TreeView.parser.LangiumParser;Wa.treeView=e},"treeView"),architecture:A(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>Swt),e=t().Architecture.parser.LangiumParser;Wa.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>kwt),e=t().GitGraph.parser.LangiumParser;Wa.gitGraph=e},"gitGraph"),eventmodeling:A(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>Ewt),e=t().EventModel.parser.LangiumParser;Wa.eventmodeling=e},"eventmodeling"),radar:A(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Awt),e=t().Radar.parser.LangiumParser;Wa.radar=e},"radar"),railroad:A(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>_wt),e=t().Railroad.parser.LangiumParser;Wa.railroad=e},"railroad"),railroadEbnf:A(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>Rwt),e=t().RailroadEbnf.parser.LangiumParser;Wa.railroadEbnf=e},"railroadEbnf"),railroadAbnf:A(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>Lwt),e=t().RailroadAbnf.parser.LangiumParser;Wa.railroadAbnf=e},"railroadAbnf"),railroadPeg:A(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>Iwt),e=t().RailroadPeg.parser.LangiumParser;Wa.railroadPeg=e},"railroadPeg"),treemap:A(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>Mwt),e=t().Treemap.parser.LangiumParser;Wa.treemap=e},"treemap"),wardley:A(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>Dwt),e=t().Wardley.parser.LangiumParser;Wa.wardley=e},"wardley"),cynefin:A(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>Nwt),e=t().Cynefin.parser.LangiumParser;Wa.cynefin=e},"cynefin")};async function Xo(t,e){const r=zht[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Wa[t]||await r();const i=Wa[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Gw(i);return i.value}A(Xo,"parse");var Gw=(S2=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},E(Rv,"MermaidParseError"),Rv),xn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},zat=Fr.gitGraph,jf=T(()=>ti({...zat,...lr().gitGraph}),"getConfig"),qt=new II(()=>{const t=jf(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function dS(){return TV({length:7})}T(dS,"getID");function tge(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}T(tge,"uniqBy");var Gat=T(function(t){qt.records.direction=t},"setDirection"),qat=T(function(t){ae.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{qt.records.options=JSON.parse(t)}catch(e){ae.error("error while parsing gitGraph options",e.message)}},"setOptions"),Vat=T(function(){return qt.records.options},"getOptions"),Wat=T(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ae.info("commit",e,r,n,i),ae.debug("Entering commit:",e,r,n,i);const a=jf();r=It.sanitizeText(r,a),e=It.sanitizeText(e,a),i=i==null?void 0:i.map(o=>It.sanitizeText(o,a));const s={id:r||qt.records.seq+"-"+dS(),message:e,seq:qt.records.seq++,type:n??xn.NORMAL,tags:i??[],parents:qt.records.head==null?[]:[qt.records.head.id],branch:qt.records.currBranch};qt.records.head=s,ae.info("main branch",a.mainBranchName),qt.records.commits.has(s.id)&&ae.warn(`Commit ID ${s.id} already exists`),qt.records.commits.set(s.id,s),qt.records.branches.set(qt.records.currBranch,s.id),ae.debug("in pushCommit "+s.id)},"commit"),Uat=T(function(t){let e=t.name;const r=t.order;if(e=It.sanitizeText(e,jf()),qt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);qt.records.branches.set(e,qt.records.head!=null?qt.records.head.id:null),qt.records.branchConfig.set(e,{name:e,order:r}),rge(e),ae.debug("in createBranch")},"branch"),Hat=T(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=jf();e=It.sanitizeText(e,a),r&&(r=It.sanitizeText(r,a));const s=qt.records.branches.get(qt.records.currBranch),o=qt.records.branches.get(e),l=s?qt.records.commits.get(s):void 0,u=o?qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${qt.records.seq}-${dS()}`,message:`merged branch ${e} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,h],branch:qt.records.currBranch,type:xn.MERGE,customType:n,customId:!!r,tags:i??[]};qt.records.head=d,qt.records.commits.set(d.id,d),qt.records.branches.set(qt.records.currBranch,d.id),ae.debug(qt.records.branches),ae.debug("in mergeBranch")},"merge"),Yat=T(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ae.debug("Entering cherryPick:",e,r,n);const a=jf();if(e=It.sanitizeText(e,a),r=It.sanitizeText(r,a),n=n==null?void 0:n.map(l=>It.sanitizeText(l,a)),i=It.sanitizeText(i,a),!e||!qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=qt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===xn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!qt.records.commits.has(r)){if(o===qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=qt.records.branches.get(qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:qt.records.seq+"-"+dS(),message:`cherry-picked ${s==null?void 0:s.message} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,s.id],branch:qt.records.currBranch,type:xn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===xn.MERGE?`|parent:${i}`:""}`]};qt.records.head=h,qt.records.commits.set(h.id,h),qt.records.branches.set(qt.records.currBranch,h.id),ae.debug(qt.records.branches),ae.debug("in cherryPick")}},"cherryPick"),rge=T(function(t){if(t=It.sanitizeText(t,jf()),qt.records.branches.has(t)){qt.records.currBranch=t;const e=qt.records.branches.get(qt.records.currBranch);e===void 0||!e?qt.records.head=null:qt.records.head=qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function XO(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}T(XO,"upsert");function KO(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in qt.records.branches)qt.records.branches.get(i)===e.id&&n.push(i);if(ae.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=qt.records.commits.get(e.parents[0]);XO(t,e,i),e.parents[1]&&t.push(qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=qt.records.commits.get(e.parents[0]);XO(t,e,i)}}t=tge(t,i=>i.id),KO(t)}T(KO,"prettyPrintCommitHistory");var Xat=T(function(){ae.debug(qt.records.commits);const t=nge()[0];KO([t])},"prettyPrint"),Kat=T(function(){qt.reset(),Dn()},"clear"),jat=T(function(){return[...qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Zat=T(function(){return qt.records.branches},"getBranches"),Qat=T(function(){return qt.records.commits},"getCommits"),nge=T(function(){const t=[...qt.records.commits.values()];return t.forEach(function(e){ae.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Jat=T(function(){return qt.records.currBranch},"getCurrentBranch"),est=T(function(){return qt.records.direction},"getDirection"),tst=T(function(){return qt.records.head},"getHead"),ige={commitType:xn,getConfig:jf,setDirection:Gat,setOptions:qat,getOptions:Vat,commit:Wat,branch:Uat,merge:Hat,cherryPick:Yat,checkout:rge,prettyPrint:Xat,clear:Kat,getBranchesAsObjArray:jat,getBranches:Zat,getCommits:Qat,getCommitsArray:nge,getCurrentBranch:Jat,getDirection:est,getHead:tst,setAccTitle:Mn,getAccTitle:Gn,getAccDescription:Vn,setAccDescription:qn,setDiagramTitle:Wn,getDiagramTitle:Nn},rst=T((t,e)=>{Fl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)nst(r,e)},"populate"),nst=T((t,e)=>{const n={Commit:T(i=>e.commit(ist(i)),"Commit"),Branch:T(i=>e.branch(ast(i)),"Branch"),Merge:T(i=>e.merge(sst(i)),"Merge"),Checkout:T(i=>e.checkout(ost(i)),"Checkout"),CherryPicking:T(i=>e.cherryPick(lst(i)),"CherryPicking")}[t.$type];n?n(t):ae.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),ist=T(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?xn[t.type]:xn.NORMAL,tags:t.tags??void 0}),"parseCommit"),ast=T(t=>({name:t.name,order:t.order??0}),"parseBranch"),sst=T(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?xn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),ost=T(t=>t.branch,"parseCheckout"),lst=T(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),cst={parse:T(async t=>{const e=await Qo("gitGraph",t);ae.debug(e),rst(e,ige)},"parse")},Lh=10,Ih=40,rc=4,hu=2,Zf=8,fS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),jO=12,ZO=new Set(["redux-color","redux-dark-color"]),ust=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Qf=T((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Rs=new Map,Ls=new Map,pS=30,WT=new Map,gS=[],du=0,Gr="LR",hst=T(()=>{Rs.clear(),Ls.clear(),WT.clear(),du=0,gS=[],Gr="LR"},"clear"),age=T(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),sge=T(t=>{let e,r,n;return Gr==="BT"?(r=T((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=T((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Gr==="TB"||Gr=="BT"?(s=Ls.get(i))==null?void 0:s.y:(o=Ls.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),dst=T(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Ls.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),fst=T((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=gst(o),i=Math.max(n,i)):a.push(o),mst(o,n)}),n=i,a.forEach(s=>{yst(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=dst(o.parents);n=Ls.get(l).y-Ih,n<=i&&(i=n);const u=Rs.get(o.branch).pos,h=n-Lh;Ls.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),pst=T(t=>{var n;const e=sge(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Ls.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),gst=T(t=>pst(t)+Ih,"calculateCommitPosition"),mst=T((t,e)=>{const r=Rs.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Lh;return Ls.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),yst=T((t,e,r)=>{const n=Rs.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Ls.set(t.id,{x:a,y:i})},"setRootPosition"),vst=T((t,e,r,n,i,a)=>{const{theme:s}=$e(),o=fS.has(s??""),l=ZO.has(s??""),u=ust.has(s??"");if(a===xn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Qf(i,Zf,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Qf(i,Zf,l)} ${n}-inner`);else if(a===xn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Qf(i,Zf,l)}`),a===xn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Qf(i,Zf,l)}`)}if(a===xn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Qf(i,Zf,l)}`)}}},"drawCommitBullet"),bst=T((t,e,r,n,i)=>{var a;if(e.type!==xn.CHERRY_PICK&&(e.customId&&e.type===xn.MERGE||e.type!==xn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-hu).attr("y",r.y+13.5).attr("width",u.width+2*hu).attr("height",u.height+2*hu),Gr==="TB"||Gr==="BT"?(o.attr("x",r.x-(u.width+4*rc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*rc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Gr==="TB"||Gr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),xst=T((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-s/2-rc/2},${g+hu} - ${n-s/2-rc/2},${g-hu} - ${r.posWithOffset-s/2-rc},${g-p-hu} - ${r.posWithOffset+s/2+rc},${g-p-hu} - ${r.posWithOffset+s/2+rc},${g+p+hu} - ${r.posWithOffset-s/2-rc},${g+p+hu}`),h.attr("cy",g).attr("cx",n-s/2+rc/2).attr("r",1.5).attr("class","tag-hole"),Gr==="TB"||Gr==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},A(S2,"MermaidParseError"),S2),Pn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ght=jr.gitGraph,Bp=b(()=>ri({...Ght,...sr().gitGraph}),"getConfig"),Ht=new uN(()=>{const t=Bp(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function DA(){return fH({length:7})}b(DA,"getID");function Gve(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}b(Gve,"uniqBy");var Wht=b(function(t){Ht.records.direction=t},"setDirection"),qht=b(function(t){he.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Ht.records.options=JSON.parse(t)}catch(e){he.error("error while parsing gitGraph options",e.message)}},"setOptions"),Vht=b(function(){return Ht.records.options},"getOptions"),Uht=b(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;he.info("commit",e,r,n,i),he.debug("Entering commit:",e,r,n,i);const a=Bp();r=$t.sanitizeText(r,a),e=$t.sanitizeText(e,a),i=i==null?void 0:i.map(o=>$t.sanitizeText(o,a));const s={id:r||Ht.records.seq+"-"+DA(),message:e,seq:Ht.records.seq++,type:n??Pn.NORMAL,tags:i??[],parents:Ht.records.head==null?[]:[Ht.records.head.id],branch:Ht.records.currBranch};Ht.records.head=s,he.info("main branch",a.mainBranchName),Ht.records.commits.has(s.id)&&he.warn(`Commit ID ${s.id} already exists`),Ht.records.commits.set(s.id,s),Ht.records.branches.set(Ht.records.currBranch,s.id),he.debug("in pushCommit "+s.id)},"commit"),Hht=b(function(t){let e=t.name;const r=t.order;if(e=$t.sanitizeText(e,Bp()),Ht.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Ht.records.branches.set(e,Ht.records.head!=null?Ht.records.head.id:null),Ht.records.branchConfig.set(e,{name:e,order:r}),Wve(e),he.debug("in createBranch")},"branch"),Yht=b(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Bp();e=$t.sanitizeText(e,a),r&&(r=$t.sanitizeText(r,a));const s=Ht.records.branches.get(Ht.records.currBranch),o=Ht.records.branches.get(e),l=s?Ht.records.commits.get(s):void 0,u=o?Ht.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ht.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Ht.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Ht.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Ht.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Ht.records.seq}-${DA()}`,message:`merged branch ${e} into ${Ht.records.currBranch}`,seq:Ht.records.seq++,parents:Ht.records.head==null?[]:[Ht.records.head.id,h],branch:Ht.records.currBranch,type:Pn.MERGE,customType:n,customId:!!r,tags:i??[]};Ht.records.head=d,Ht.records.commits.set(d.id,d),Ht.records.branches.set(Ht.records.currBranch,d.id),he.debug(Ht.records.branches),he.debug("in mergeBranch")},"merge"),Xht=b(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;he.debug("Entering cherryPick:",e,r,n);const a=Bp();if(e=$t.sanitizeText(e,a),r=$t.sanitizeText(r,a),n=n==null?void 0:n.map(l=>$t.sanitizeText(l,a)),i=$t.sanitizeText(i,a),!e||!Ht.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Ht.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Pn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Ht.records.commits.has(r)){if(o===Ht.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Ht.records.branches.get(Ht.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ht.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Ht.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ht.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Ht.records.seq+"-"+DA(),message:`cherry-picked ${s==null?void 0:s.message} into ${Ht.records.currBranch}`,seq:Ht.records.seq++,parents:Ht.records.head==null?[]:[Ht.records.head.id,s.id],branch:Ht.records.currBranch,type:Pn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Pn.MERGE?`|parent:${i}`:""}`]};Ht.records.head=h,Ht.records.commits.set(h.id,h),Ht.records.branches.set(Ht.records.currBranch,h.id),he.debug(Ht.records.branches),he.debug("in cherryPick")}},"cherryPick"),Wve=b(function(t){if(t=$t.sanitizeText(t,Bp()),Ht.records.branches.has(t)){Ht.records.currBranch=t;const e=Ht.records.branches.get(Ht.records.currBranch);e===void 0||!e?Ht.records.head=null:Ht.records.head=Ht.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function IB(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}b(IB,"upsert");function MB(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Ht.records.branches)Ht.records.branches.get(i)===e.id&&n.push(i);if(he.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Ht.records.commits.get(e.parents[0]);IB(t,e,i),e.parents[1]&&t.push(Ht.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Ht.records.commits.get(e.parents[0]);IB(t,e,i)}}t=Gve(t,i=>i.id),MB(t)}b(MB,"prettyPrintCommitHistory");var jht=b(function(){he.debug(Ht.records.commits);const t=qve()[0];MB([t])},"prettyPrint"),Kht=b(function(){Ht.reset(),zn()},"clear"),Zht=b(function(){return[...Ht.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Qht=b(function(){return Ht.records.branches},"getBranches"),Jht=b(function(){return Ht.records.commits},"getCommits"),qve=b(function(){const t=[...Ht.records.commits.values()];return t.forEach(function(e){he.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),edt=b(function(){return Ht.records.currBranch},"getCurrentBranch"),tdt=b(function(){return Ht.records.direction},"getDirection"),rdt=b(function(){return Ht.records.head},"getHead"),Vve={commitType:Pn,getConfig:Bp,setDirection:Wht,setOptions:qht,getOptions:Vht,commit:Uht,branch:Hht,merge:Yht,cherryPick:Xht,checkout:Wve,prettyPrint:jht,clear:Kht,getBranchesAsObjArray:Zht,getBranches:Qht,getCommits:Jht,getCommitsArray:qve,getCurrentBranch:edt,getDirection:tdt,getHead:rdt,setAccTitle:qn,getAccTitle:Qn,getAccDescription:ei,setAccDescription:Jn,setDiagramTitle:ti,getDiagramTitle:Vn},ndt=b((t,e)=>{Cs(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)idt(r,e)},"populate"),idt=b((t,e)=>{const n={Commit:b(i=>e.commit(adt(i)),"Commit"),Branch:b(i=>e.branch(sdt(i)),"Branch"),Merge:b(i=>e.merge(odt(i)),"Merge"),Checkout:b(i=>e.checkout(ldt(i)),"Checkout"),CherryPicking:b(i=>e.cherryPick(cdt(i)),"CherryPicking")}[t.$type];n?n(t):he.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),adt=b(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Pn[t.type]:Pn.NORMAL,tags:t.tags??void 0}),"parseCommit"),sdt=b(t=>({name:t.name,order:t.order??0}),"parseBranch"),odt=b(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Pn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),ldt=b(t=>t.branch,"parseCheckout"),cdt=b(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),udt={parse:b(async t=>{const e=await Xo("gitGraph",t);he.debug(e),ndt(e,Vve)},"parse")},dd=10,fd=40,Ic=4,Uu=2,Fp=8,NA=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),DB=12,NB=new Set(["redux-color","redux-dark-color"]),hdt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),zp=b((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Js=new Map,eo=new Map,OA=30,Ww=new Map,$A=[],Hu=0,en="LR",ddt=b(()=>{Js.clear(),eo.clear(),Ww.clear(),Hu=0,$A=[],en="LR"},"clear"),Uve=b(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Hve=b(t=>{let e,r,n;return en==="BT"?(r=b((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=b((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=en==="TB"||en=="BT"?(s=eo.get(i))==null?void 0:s.y:(o=eo.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),fdt=b(t=>{let e="",r=1/0;return t.forEach(n=>{const i=eo.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),pdt=b((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=mdt(o),i=Math.max(n,i)):a.push(o),ydt(o,n)}),n=i,a.forEach(s=>{vdt(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=fdt(o.parents);n=eo.get(l).y-fd,n<=i&&(i=n);const u=Js.get(o.branch).pos,h=n-dd;eo.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),gdt=b(t=>{var n;const e=Hve(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=eo.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),mdt=b(t=>gdt(t)+fd,"calculateCommitPosition"),ydt=b((t,e)=>{const r=Js.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+dd;return eo.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),vdt=b((t,e,r)=>{const n=Js.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;eo.set(t.id,{x:a,y:i})},"setRootPosition"),bdt=b((t,e,r,n,i,a)=>{const{theme:s}=Ve(),o=NA.has(s??""),l=NB.has(s??""),u=hdt.has(s??"");if(a===Pn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${zp(i,Fp,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${zp(i,Fp,l)} ${n}-inner`);else if(a===Pn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${zp(i,Fp,l)}`),a===Pn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${zp(i,Fp,l)}`)}if(a===Pn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${zp(i,Fp,l)}`)}}},"drawCommitBullet"),xdt=b((t,e,r,n,i)=>{var a;if(e.type!==Pn.CHERRY_PICK&&(e.customId&&e.type===Pn.MERGE||e.type!==Pn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-Uu).attr("y",r.y+13.5).attr("width",u.width+2*Uu).attr("height",u.height+2*Uu),en==="TB"||en==="BT"?(o.attr("x",r.x-(u.width+4*Ic+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Ic)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(en==="TB"||en==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),Tdt=b((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` + ${n-s/2-Ic/2},${g+Uu} + ${n-s/2-Ic/2},${g-Uu} + ${r.posWithOffset-s/2-Ic},${g-p-Uu} + ${r.posWithOffset+s/2+Ic},${g-p-Uu} + ${r.posWithOffset+s/2+Ic},${g+p+Uu} + ${r.posWithOffset-s/2-Ic},${g+p+Uu}`),h.attr("cy",g).attr("cx",n-s/2+Ic/2).attr("r",1.5).attr("class","tag-hole"),en==="TB"||en==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} - ${r.x+Lh},${m-p-2} - ${r.x+Lh+s+4},${m-p-2} - ${r.x+Lh+s+4},${m+p+2} - ${r.x+Lh},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+rc/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),Tst=T(t=>{switch(t.customType??t.type){case xn.NORMAL:return"commit-normal";case xn.REVERSE:return"commit-reverse";case xn.HIGHLIGHT:return"commit-highlight";case xn.MERGE:return"commit-merge";case xn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),wst=T((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=sge(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Ih:e==="BT"?(n.get(t.id)??i).y-Ih:s.x+Ih}}else return e==="TB"?pS:e==="BT"?(n.get(t.id)??i).y-Ih:0;return 0},"calculatePosition"),Cst=T((t,e,r)=>{var l,u;const n=Gr==="BT"&&r?e:e+Lh,i=(l=Rs.get(t.branch))==null?void 0:l.pos,a=Gr==="TB"||Gr==="BT"?(u=Rs.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=fS.has($e().theme??""),o=Gr==="TB"||Gr==="BT"?n:i+(s?jO/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),oge=T((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Gr==="TB"||Gr==="BT"?pS:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=T((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Gr==="BT"&&(l&&fst(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=wst(f,Gr,s,Ls));const p=Cst(f,s,l);if(r){const m=Tst(f),y=f.customType??f.type,v=((g=Rs.get(f.branch))==null?void 0:g.index)??0;vst(i,f,p,m,v,y),bst(a,f,p,s,n),xst(a,f,p,s)}Gr==="TB"||Gr==="BT"?Ls.set(f.id,{x:p.x,y:p.posWithOffset}):Ls.set(f.id,{x:p.posWithOffset,y:p.y}),s=Gr==="BT"&&l?s+Ih:s+Ih+Lh,s>du&&(du=s)})},"drawCommits"),kst=T((t,e,r,n,i)=>{const s=(Gr==="TB"||Gr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=T(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),UT=T((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(gS.every(s=>Math.abs(s-n)>=10))return gS.push(n),n;const a=Math.abs(t-e);return UT(t,e-a/5,r+1)},"findLane"),Est=T((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=$e(),a=ZO.has(i??""),s=Ls.get(e.id),o=Ls.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=kst(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Rs.get(r.branch))==null?void 0:m.index;r.type===xn.MERGE&&e.id!==r.parents[0]&&(p=(y=Rs.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===xn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Gr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===xn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===xn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Qf(p,Zf,a))},"drawArrow"),Sst=T((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{Est(r,e.get(a),i,e)})})},"drawArrows"),Ast=T((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=$e(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=fS.has(a??""),h=ZO.has(a??""),d=t.append("g");e.forEach((f,p)=>{var D;const g=Qf(p,u?l:Zf,h),m=(D=Rs.get(f.name))==null?void 0:D.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Gr==="TB"||Gr==="BT"?m:u?m+jO/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",du),v.attr("y2",y),v.attr("class","branch branch"+g),Gr==="TB"?(v.attr("y1",pS),v.attr("x1",m),v.attr("y2",du),v.attr("x2",m)):Gr==="BT"&&(v.attr("y1",du),v.attr("x1",m),v.attr("y2",pS),v.attr("x2",m)),gS.push(y);const x=f.name,b=age(x),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const C=b.getBBox(),_=u?0:4,L=u?16:0,O=u?jO:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",_).attr("ry",_).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+L).attr("height",C.height+4+O),S.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-C.height/2-2)+")"),Gr==="TB"?(w.attr("x",m-C.width/2-10).attr("y",0),S.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-O-10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(-O*2+7)+")"))):Gr==="BT"?(w.attr("x",m-C.width/2-10).attr("y",du),S.attr("transform","translate("+(m-C.width/2-5)+", "+du+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${O+10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(du+O*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-O/2)+")")})},"drawBranches"),_st=T(function(t,e,r,n,i){return Rs.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Gr==="TB"||Gr==="BT"?n.width/2:0),e},"setBranchPosition"),Rst=T(function(t,e,r,n){hst(),ae.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){ae.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;WT=i.getCommits();const o=i.getBranchesAsObjArray();Gr=i.getDirection();const l=pt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=$e(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&fS.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,x)=>{var _;const b=age(v.name),w=l.append("g"),k=w.insert("g").attr("class","branchLabel"),S=k.insert("g").attr("class","label branch-label");(_=S.node())==null||_.appendChild(b);const C=b.getBBox();y=_st(v.name,y,x,C,s),S.remove(),k.remove(),w.remove()}),oge(l,WT,!1,a),a.showBranches&&Ast(l,o,a,e),Sst(l,WT),oge(l,WT,!0,a),Lr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),W6(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),Lst={draw:Rst},lge=8,cge=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Ist=new Set(["redux-color","redux-dark-color"]),Dst=new Set(["neo","neo-dark"]),Mst=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Nst=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Ost=T(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Pn.NORMAL:return"commit-normal";case Pn.REVERSE:return"commit-reverse";case Pn.HIGHLIGHT:return"commit-highlight";case Pn.MERGE:return"commit-merge";case Pn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Cdt=b((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=Hve(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+fd:e==="BT"?(n.get(t.id)??i).y-fd:s.x+fd}}else return e==="TB"?OA:e==="BT"?(n.get(t.id)??i).y-fd:0;return 0},"calculatePosition"),Sdt=b((t,e,r)=>{var l,u;const n=en==="BT"&&r?e:e+dd,i=(l=Js.get(t.branch))==null?void 0:l.pos,a=en==="TB"||en==="BT"?(u=Js.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=NA.has(Ve().theme??""),o=en==="TB"||en==="BT"?n:i+(s?DB/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),Yve=b((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=en==="TB"||en==="BT"?OA:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=b((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);en==="BT"&&(l&&pdt(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=Cdt(f,en,s,eo));const p=Sdt(f,s,l);if(r){const m=wdt(f),y=f.customType??f.type,v=((g=Js.get(f.branch))==null?void 0:g.index)??0;bdt(i,f,p,m,v,y),xdt(a,f,p,s,n),Tdt(a,f,p,s)}en==="TB"||en==="BT"?eo.set(f.id,{x:p.x,y:p.posWithOffset}):eo.set(f.id,{x:p.posWithOffset,y:p.y}),s=en==="BT"&&l?s+fd:s+fd+dd,s>Hu&&(Hu=s)})},"drawCommits"),kdt=b((t,e,r,n,i)=>{const s=(en==="TB"||en==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=b(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),qw=b((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if($A.every(s=>Math.abs(s-n)>=10))return $A.push(n),n;const a=Math.abs(t-e);return qw(t,e-a/5,r+1)},"findLane"),Edt=b((t,e,r,n)=>{var m,y,v,T,x;const{theme:i}=Ve(),a=NB.has(i??""),s=eo.get(e.id),o=eo.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=kdt(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Js.get(r.branch))==null?void 0:m.index;r.type===Pn.MERGE&&e.id!==r.parents[0]&&(p=(y=Js.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Pn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):en==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Pn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===Pn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+zp(p,Fp,a))},"drawArrow"),Adt=b((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{Edt(r,e.get(a),i,e)})})},"drawArrows"),_dt=b((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Ve(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=NA.has(a??""),h=NB.has(a??""),d=t.append("g");e.forEach((f,p)=>{var I;const g=zp(p,u?l:Fp,h),m=(I=Js.get(f.name))==null?void 0:I.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=en==="TB"||en==="BT"?m:u?m+DB/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Hu),v.attr("y2",y),v.attr("class","branch branch"+g),en==="TB"?(v.attr("y1",OA),v.attr("x1",m),v.attr("y2",Hu),v.attr("x2",m)):en==="BT"&&(v.attr("y1",Hu),v.attr("x1",m),v.attr("y2",OA),v.attr("x2",m)),$A.push(y);const T=f.name,x=Uve(T),w=d.insert("rect"),k=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);k.node().appendChild(x);const S=x.getBBox(),E=u?0:4,L=u?16:0,M=u?DB:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-S.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-S.height/2+10).attr("width",S.width+18+L).attr("height",S.height+4+M),k.attr("transform","translate("+(-S.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-S.height/2-2)+")"),en==="TB"?(w.attr("x",m-S.width/2-10).attr("y",0),k.attr("transform","translate("+(m-S.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-M-10})`),k.attr("transform","translate("+(m-S.width/2-5)+", "+(-M*2+7)+")"))):en==="BT"?(w.attr("x",m-S.width/2-10).attr("y",Hu),k.attr("transform","translate("+(m-S.width/2-5)+", "+Hu+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${M+10})`),k.attr("transform","translate("+(m-S.width/2-5)+", "+(Hu+M*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),Rdt=b(function(t,e,r,n,i){return Js.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(en==="TB"||en==="BT"?n.width/2:0),e},"setBranchPosition"),Ldt=b(function(t,e,r,n){ddt(),he.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){he.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;Ww=i.getCommits();const o=i.getBranchesAsObjArray();en=i.getDirection();const l=mt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Ve(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&NA.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var E;const x=Uve(v.name),w=l.append("g"),C=w.insert("g").attr("class","branchLabel"),k=C.insert("g").attr("class","label branch-label");(E=k.node())==null||E.appendChild(x);const S=x.getBBox();y=Rdt(v.name,y,T,S,s),k.remove(),C.remove(),w.remove()}),Yve(l,Ww,!1,a),a.showBranches&&_dt(l,o,a,e),Adt(l,Ww),Yve(l,Ww,!0,a),Er.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),m_(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),Idt={draw:Ldt},Xve=8,jve=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Mdt=new Set(["redux-color","redux-dark-color"]),Ddt=new Set(["neo","neo-dark"]),Ndt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Odt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),$dt=b(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=lr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=cge.has(r);if(Dst.has(r)){let s="";for(let o=0;o{const e=sr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=jve.has(r);if(Ddt.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%lge;return` + `;return s}},"genColor"),Bdt=b(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%Xve;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),Bst=T(t=>{const e=lr(),{theme:r}=e,n=Nst.has(r);return` +`)}`,"normalTheme"),Fdt=b(t=>{const e=sr(),{theme:r}=e,n=Odt.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -1404,7 +1410,7 @@ ${r}`),this.inline?`{${i}}`:i}},E(By,"JSDocTagImpl"),By);function rpe(t,e,r){var font-family: var(--mermaid-font-family); } - ${n?$st(t):Pst(t)} + ${n?Pdt(t):Bdt(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -1435,7 +1441,7 @@ ${r}`),this.inline?`{${i}}`:i}},E(By,"JSDocTagImpl"),By);function rpe(t,e,r){var .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${cge.has(r)?t.strokeWidth:8}; + stroke-width: ${jve.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -1444,12 +1450,12 @@ ${r}`),this.inline?`{${i}}`:i}},E(By,"JSDocTagImpl"),By);function rpe(t,e,r){var font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),Fst=Bst,zst={parser:cst,db:ige,renderer:Lst,styles:Fst};const Gst=Object.freeze(Object.defineProperty({__proto__:null,diagram:zst},Symbol.toStringTag,{value:"Module"}));var mS={exports:{}},qst=mS.exports,uge;function Vst(){return uge||(uge=1,(function(t,e){(function(r,n){t.exports=n()})(qst,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(mS)),mS.exports}var Wst=Vst();const Ust=Ns(Wst);var yS={exports:{}},Hst=yS.exports,hge;function Yst(){return hge||(hge=1,(function(t,e){(function(r,n){t.exports=n()})(Hst,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var x,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){x=w>12;break}}else x=y===(v?"pm":"PM");return x},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,x=y.match(/\d+/);if(this.day=x[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(O,D,z){var F=z&&z.toUpperCase();return D||x[z]||r[z]||x[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,R,N){return R||N.slice(1)}))}))).match(n),w=b.length,k=0;k-1)return new Date((I==="X"?1e3:1)*M);var B=m(I)(M),q=B.year,V=B.month,X=B.day,W=B.hours,ie=B.minutes,K=B.seconds,se=B.milliseconds,te=B.zone,Z=B.week,ee=new Date,ne=X||(q||V?1:ee.getDate()),oe=q||ee.getFullYear(),fe=0;q&&!V||(fe=V>0?V-1:ee.getMonth());var Ae,Re=W||0,Ge=ie||0,Ce=K||0,be=se||0;return te?new Date(Date.UTC(oe,fe,ne,Re,Ge,Ce,be+60*te.offset*1e3)):$?new Date(Date.UTC(oe,fe,ne,Re,Ge,Ce,be)):(Ae=new Date(oe,fe,ne,Re,Ge,Ce,be),Z&&(Ae=P(Ae).week(Z).toDate()),Ae)}catch{return new Date("")}})(S,L,C,x),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),z&&S!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var A=L.length,R=1;R<=A;R+=1){_[1]=L[R-1];var N=x.apply(this,_);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}R===A&&(this.$d=new Date(""))}else w.call(this,k)}}}))})(yS)),yS.exports}var Xst=Yst();const Kst=Ns(Xst);var vS={exports:{}},jst=vS.exports,dge;function Zst(){return dge||(dge=1,(function(t,e){(function(r,n){t.exports=n()})(jst,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(vS)),vS.exports}var Qst=Zst();const Jst=Ns(Qst);var bS={exports:{}},eot=bS.exports,fge;function tot(){return fge||(fge=1,(function(t,e){(function(r,n){t.exports=n()})(eot,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,C,_){return new w(S,_,C.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},x=function(S){return Math.abs(S)},b=function(S,C){return S?y(S)?{negative:!0,format:""+x(S)+C}:{negative:!1,format:""+S+C}:{negative:!1,format:""}},w=(function(){function S(_,L,O){var D=this;if(this.$d={},this.$l=O,_===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(_*f[m(L)],this);if(typeof _=="number")return this.$ms=_,this.parseFromMilliseconds(),this;if(typeof _=="object")return Object.keys(_).forEach((function(A){D.$d[m(A)]=_[A]})),this.calMilliseconds(),this;if(typeof _=="string"){var z=_.match(h);if(z){var F=z.slice(2).map((function(A){return A!=null?Number(A):0}));return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var C=S.prototype;return C.calMilliseconds=function(){var _=this;this.$ms=Object.keys(this.$d).reduce((function(L,O){return L+(_.$d[O]||0)*f[O]}),0)},C.parseFromMilliseconds=function(){var _=this.$ms;this.$d.years=v(_/l),_%=l,this.$d.months=v(_/u),_%=u,this.$d.days=v(_/o),_%=o,this.$d.hours=v(_/s),_%=s,this.$d.minutes=v(_/a),_%=a,this.$d.seconds=v(_/i),_%=i,this.$d.milliseconds=_},C.toISOString=function(){var _=b(this.$d.years,"Y"),L=b(this.$d.months,"M"),O=+this.$d.days||0;this.$d.weeks&&(O+=7*this.$d.weeks);var D=b(O,"D"),z=b(this.$d.hours,"H"),F=b(this.$d.minutes,"M"),A=this.$d.seconds||0;this.$d.milliseconds&&(A+=this.$d.milliseconds/1e3,A=Math.round(1e3*A)/1e3);var R=b(A,"S"),N=_.negative||L.negative||D.negative||z.negative||F.negative||R.negative,M=z.format||F.format||R.format?"T":"",I=(N?"-":"")+"P"+_.format+L.format+D.format+M+z.format+F.format+R.format;return I==="P"||I==="-P"?"P0D":I},C.toJSON=function(){return this.toISOString()},C.format=function(_){var L=_||"YYYY-MM-DDTHH:mm:ss",O={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(D,z){return z||String(O[D])}))},C.as=function(_){return this.$ms/f[m(_)]},C.get=function(_){var L=this.$ms,O=m(_);return O==="milliseconds"?L%=1e3:L=O==="weeks"?v(L/f[O]):this.$d[O],L||0},C.add=function(_,L,O){var D;return D=L?_*f[m(L)]:p(_)?_.$ms:g(_,this).$ms,g(this.$ms+D*(O?-1:1),this)},C.subtract=function(_,L){return this.add(_,L,!0)},C.locale=function(_){var L=this.clone();return L.$l=_,L},C.clone=function(){return g(this.$ms,this)},C.humanize=function(_){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!_)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},S})(),k=function(S,C,_){return S.add(C.years()*_,"y").add(C.months()*_,"M").add(C.days()*_,"d").add(C.hours()*_,"h").add(C.minutes()*_,"m").add(C.seconds()*_,"s").add(C.milliseconds()*_,"ms")};return function(S,C,_){r=_,n=_().$utils(),_.duration=function(D,z){var F=_.locale();return g(D,{$l:F},z)},_.isDuration=p;var L=C.prototype.add,O=C.prototype.subtract;C.prototype.add=function(D,z){return p(D)?k(this,D,1):L.bind(this)(D,z)},C.prototype.subtract=function(D,z){return p(D)?k(this,D,-1):O.bind(this)(D,z)}}}))})(bS)),bS.exports}var rot=tot();const not=Ns(rot);var QO=(function(){var t=T(function(F,A,R,N){for(R=R||{},N=F.length;N--;R[F[N]]=A);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],k=[1,21],S=[1,22],C=[1,23],_=[1,25],L=[1,35],O={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:T(function(A,R,N,M,I,$,P){var B=$.length-1;switch(I){case 1:return $[B-1];case 2:this.$=[];break;case 3:$[B-1].push($[B]),this.$=$[B-1];break;case 4:case 5:this.$=$[B];break;case 6:case 7:this.$=[];break;case 8:M.setWeekday("monday");break;case 9:M.setWeekday("tuesday");break;case 10:M.setWeekday("wednesday");break;case 11:M.setWeekday("thursday");break;case 12:M.setWeekday("friday");break;case 13:M.setWeekday("saturday");break;case 14:M.setWeekday("sunday");break;case 15:M.setWeekend("friday");break;case 16:M.setWeekend("saturday");break;case 17:M.setDateFormat($[B].substr(11)),this.$=$[B].substr(11);break;case 18:M.enableInclusiveEndDates(),this.$=$[B].substr(18);break;case 19:M.TopAxis(),this.$=$[B].substr(8);break;case 20:M.setAxisFormat($[B].substr(11)),this.$=$[B].substr(11);break;case 21:M.setTickInterval($[B].substr(13)),this.$=$[B].substr(13);break;case 22:M.setExcludes($[B].substr(9)),this.$=$[B].substr(9);break;case 23:M.setIncludes($[B].substr(9)),this.$=$[B].substr(9);break;case 24:M.setTodayMarker($[B].substr(12)),this.$=$[B].substr(12);break;case 27:M.setDiagramTitle($[B].substr(6)),this.$=$[B].substr(6);break;case 28:this.$=$[B].trim(),M.setAccTitle(this.$);break;case 29:case 30:this.$=$[B].trim(),M.setAccDescription(this.$);break;case 31:M.addSection($[B].substr(8)),this.$=$[B].substr(8);break;case 33:M.addTask($[B-1],$[B]),this.$="task";break;case 34:this.$=$[B-1],M.setClickEvent($[B-1],$[B],null);break;case 35:this.$=$[B-2],M.setClickEvent($[B-2],$[B-1],$[B]);break;case 36:this.$=$[B-2],M.setClickEvent($[B-2],$[B-1],null),M.setLink($[B-2],$[B]);break;case 37:this.$=$[B-3],M.setClickEvent($[B-3],$[B-2],$[B-1]),M.setLink($[B-3],$[B]);break;case 38:this.$=$[B-2],M.setClickEvent($[B-2],$[B],null),M.setLink($[B-2],$[B-1]);break;case 39:this.$=$[B-3],M.setClickEvent($[B-3],$[B-1],$[B]),M.setLink($[B-3],$[B-2]);break;case 40:this.$=$[B-1],M.setLink($[B-1],$[B]);break;case 41:case 47:this.$=$[B-1]+" "+$[B];break;case 42:case 43:case 45:this.$=$[B-2]+" "+$[B-1]+" "+$[B];break;case 44:case 46:this.$=$[B-3]+" "+$[B-2]+" "+$[B-1]+" "+$[B];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:S,36:C,37:24,38:_,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:S,36:C,37:24,38:_,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:T(function(A,R){if(R.recoverable)this.trace(A);else{var N=new Error(A);throw N.hash=R,N}},"parseError"),parse:T(function(A){var R=this,N=[0],M=[],I=[null],$=[],P=this.table,B="",q=0,V=0,X=2,W=1,ie=$.slice.call(arguments,1),K=Object.create(this.lexer),se={yy:{}};for(var te in this.yy)Object.prototype.hasOwnProperty.call(this.yy,te)&&(se.yy[te]=this.yy[te]);K.setInput(A,se.yy),se.yy.lexer=K,se.yy.parser=this,typeof K.yylloc>"u"&&(K.yylloc={});var Z=K.yylloc;$.push(Z);var ee=K.options&&K.options.ranges;typeof se.yy.parseError=="function"?this.parseError=se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(Ve){N.length=N.length-2*Ve,I.length=I.length-Ve,$.length=$.length-Ve}T(ne,"popStack");function oe(){var Ve;return Ve=M.pop()||K.lex()||W,typeof Ve!="number"&&(Ve instanceof Array&&(M=Ve,Ve=M.pop()),Ve=R.symbols_[Ve]||Ve),Ve}T(oe,"lex");for(var fe,Ae,Re,Ge,Ce={},be,Fe,ye,He;;){if(Ae=N[N.length-1],this.defaultActions[Ae]?Re=this.defaultActions[Ae]:((fe===null||typeof fe>"u")&&(fe=oe()),Re=P[Ae]&&P[Ae][fe]),typeof Re>"u"||!Re.length||!Re[0]){var xe="";He=[];for(be in P[Ae])this.terminals_[be]&&be>X&&He.push("'"+this.terminals_[be]+"'");K.showPosition?xe="Parse error on line "+(q+1)+`: -`+K.showPosition()+` -Expecting `+He.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":xe="Parse error on line "+(q+1)+": Unexpected "+(fe==W?"end of input":"'"+(this.terminals_[fe]||fe)+"'"),this.parseError(xe,{text:K.match,token:this.terminals_[fe]||fe,line:K.yylineno,loc:Z,expected:He})}if(Re[0]instanceof Array&&Re.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ae+", token: "+fe);switch(Re[0]){case 1:N.push(fe),I.push(K.yytext),$.push(K.yylloc),N.push(Re[1]),fe=null,V=K.yyleng,B=K.yytext,q=K.yylineno,Z=K.yylloc;break;case 2:if(Fe=this.productions_[Re[1]][1],Ce.$=I[I.length-Fe],Ce._$={first_line:$[$.length-(Fe||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(Fe||1)].first_column,last_column:$[$.length-1].last_column},ee&&(Ce._$.range=[$[$.length-(Fe||1)].range[0],$[$.length-1].range[1]]),Ge=this.performAction.apply(Ce,[B,V,q,se.yy,Re[1],I,$].concat(ie)),typeof Ge<"u")return Ge;Fe&&(N=N.slice(0,-1*Fe*2),I=I.slice(0,-1*Fe),$=$.slice(0,-1*Fe)),N.push(this.productions_[Re[1]][0]),I.push(Ce.$),$.push(Ce._$),ye=P[N[N.length-2]][N[N.length-1]],N.push(ye);break;case 3:return!0}}return!0},"parse")},D=(function(){var F={EOF:1,parseError:T(function(R,N){if(this.yy.parser)this.yy.parser.parseError(R,N);else throw new Error(R)},"parseError"),setInput:T(function(A,R){return this.yy=R||this.yy||{},this._input=A,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var R=A.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:T(function(A){var R=A.length,N=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===M.length?this.yylloc.first_column:0)+M[M.length-N.length].length-N[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(A){this.unput(this.match.slice(A))},"less"),pastInput:T(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var A=this.pastInput(),R=new Array(A.length+1).join("-");return A+this.upcomingInput()+` -`+R+"^"},"showPosition"),test_match:T(function(A,R){var N,M,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),M=A[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(A[0].length),this.matched+=A[0],N=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var $ in I)this[$]=I[$];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,R,N,M;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),$=0;$R[0].length)){if(R=N,M=$,this.options.backtrack_lexer){if(A=this.test_match(N,I[$]),A!==!1)return A;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(A=this.test_match(R,I[M]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var R=this.next();return R||this.lex()},"lex"),begin:T(function(R){this.conditionStack.push(R)},"begin"),popState:T(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:T(function(R){this.begin(R)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(R,N,M,I){switch(M){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return F})();O.lexer=D;function z(){this.yy={}}return T(z,"Parser"),z.prototype=O,O.Parser=z,new z})();QO.parser=QO;var iot=QO;Ui.extend(Ust),Ui.extend(Kst),Ui.extend(Jst);var pge={friday:5,saturday:6},nc="",JO="",e$=void 0,t$="",HT=[],YT=[],r$=new Map,n$=[],xS=[],Jg="",i$="",gge=["active","done","crit","milestone","vert"],a$=[],em="",XT=!1,s$=!1,o$="sunday",TS="saturday",l$=0,aot=T(function(){n$=[],xS=[],Jg="",a$=[],wS=0,u$=void 0,CS=void 0,qi=[],nc="",JO="",i$="",e$=void 0,t$="",HT=[],YT=[],XT=!1,s$=!1,l$=0,r$=new Map,em="",Dn(),o$="sunday",TS="saturday"},"clear"),sot=T(function(t){em=t},"setDiagramId"),oot=T(function(t){JO=t},"setAxisFormat"),lot=T(function(){return JO},"getAxisFormat"),cot=T(function(t){e$=t},"setTickInterval"),uot=T(function(){return e$},"getTickInterval"),hot=T(function(t){t$=t},"setTodayMarker"),dot=T(function(){return t$},"getTodayMarker"),fot=T(function(t){nc=t},"setDateFormat"),pot=T(function(){XT=!0},"enableInclusiveEndDates"),got=T(function(){return XT},"endDatesAreInclusive"),mot=T(function(){s$=!0},"enableTopAxis"),yot=T(function(){return s$},"topAxisEnabled"),vot=T(function(t){i$=t},"setDisplayMode"),bot=T(function(){return i$},"getDisplayMode"),xot=T(function(){return nc},"getDateFormat"),Tot=T(function(t){HT=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),wot=T(function(){return HT},"getIncludes"),Cot=T(function(t){YT=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),kot=T(function(){return YT},"getExcludes"),Eot=T(function(){return r$},"getLinks"),Sot=T(function(t){Jg=t,n$.push(t)},"addSection"),Aot=T(function(){return n$},"getSections"),_ot=T(function(){let t=Tge();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),c$=T(function(t,e,r){if(r=r.trim(),T(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Jf(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Ui(r,e.trim(),!0);if(s.isValid())return s.toDate();{ae.debug("Invalid date:"+r),ae.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),vge=T(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),bge=T(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Jf(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),r$.set(n,r))}),wge(t,"clickable")},"setLink"),wge=T(function(t,e){t.split(",").forEach(function(r){let n=Jf(r);n!==void 0&&n.classes.push(e)})},"setClass"),Bot=T(function(t,e,r){if($e().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Lr.runFunc(e,...n)})},"setClickFun"),Cge=T(function(t,e){a$.push(function(){const r=em?`${em}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=em?`${em}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),Fot=T(function(t,e,r){t.split(",").forEach(function(n){Bot(n,e,r)}),wge(t,"clickable")},"setClickEvent"),zot=T(function(t){a$.forEach(function(e){e(t)})},"bindFunctions"),Got={getConfig:T(()=>$e().gantt,"getConfig"),clear:aot,setDateFormat:fot,getDateFormat:xot,enableInclusiveEndDates:pot,endDatesAreInclusive:got,enableTopAxis:mot,topAxisEnabled:yot,setAxisFormat:oot,getAxisFormat:lot,setTickInterval:cot,getTickInterval:uot,setTodayMarker:hot,getTodayMarker:dot,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,setDiagramId:sot,setDisplayMode:vot,getDisplayMode:bot,setAccDescription:qn,getAccDescription:Vn,addSection:Sot,getSections:Aot,getTasks:_ot,addTask:Oot,findTaskById:Jf,addTaskOrg:$ot,setIncludes:Tot,getIncludes:wot,setExcludes:Cot,getExcludes:kot,setClickEvent:Fot,setLink:Pot,getLinks:Eot,bindFunctions:zot,parseDuration:vge,isInvalidDate:mge,setWeekday:Rot,getWeekday:Lot,setWeekend:Iot};function h$(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}T(h$,"getTaskTags"),Ui.extend(not);var qot=T(function(){ae.debug("Something is calling, setConf, remove the call")},"setConf"),kge={monday:R2,tuesday:az,wednesday:sz,thursday:rd,friday:oz,saturday:lz,sunday:_2},Vot=T((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),fu,d$=1e4,Wot=T(function(t,e,r,n){const i=$e().gantt;n.db.setDiagramId(e);const a=$e().securityLevel;let s;a==="sandbox"&&(s=pt("#i"+e));const o=pt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);fu=u.parentElement.offsetWidth,fu===void 0&&(fu=1200),i.useWidth!==void 0&&(fu=i.useWidth);const h=n.db.getTasks();let d=[];for(const L of h)d.push(L.type);d=_(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const L={};for(const D of h)L[D.section]===void 0?L[D.section]=[D]:L[D.section].push(D);let O=0;for(const D of Object.keys(L)){const z=Vot(L[D],O)+1;O+=z,p+=z*(i.barHeight+i.barGap),f[D]=z}}else{p+=h.length*(i.barHeight+i.barGap);for(const L of d)f[L]=h.filter(O=>O.type===L).length}u.setAttribute("viewBox","0 0 "+fu+" "+p);const g=o.select(`[id="${e}"]`),m=U3e().domain([rTe(h,function(L){return L.startTime}),tTe(h,function(L){return L.endTime})]).rangeRound([0,fu-i.leftPadding-i.rightPadding]);function y(L,O){const D=L.startTime,z=O.startTime;let F=0;return D>z?F=1:DB.vert===q.vert?0:B.vert?1:-1);const M=[...new Set(L.map(B=>B.order))].map(B=>L.find(q=>q.order===B));g.append("g").selectAll("rect").data(M).enter().append("rect").attr("x",0).attr("y",function(B,q){return q=B.order,q*O+D-2}).attr("width",function(){return R-i.rightPadding/2}).attr("height",O).attr("class",function(B){for(const[q,V]of d.entries())if(B.type===V)return"section section"+q%i.numberSectionStyles;return"section section0"}).enter();const I=g.append("g").selectAll("rect").data(L).enter(),$=n.db.getLinks();if(I.append("rect").attr("id",function(B){return e+"-"+B.id}).attr("rx",3).attr("ry",3).attr("x",function(B){return B.milestone?m(B.startTime)+z+.5*(m(B.endTime)-m(B.startTime))-.5*F:m(B.startTime)+z}).attr("y",function(B,q){return q=B.order,B.vert?i.gridLineStartPadding:q*O+D}).attr("width",function(B){return B.milestone?F:B.vert?.08*F:m(B.renderEndTime||B.endTime)-m(B.startTime)}).attr("height",function(B){return B.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:F}).attr("transform-origin",function(B,q){return q=B.order,(m(B.startTime)+z+.5*(m(B.endTime)-m(B.startTime))).toString()+"px "+(q*O+D+.5*F).toString()+"px"}).attr("class",function(B){const q="task";let V="";B.classes.length>0&&(V=B.classes.join(" "));let X=0;for(const[ie,K]of d.entries())B.type===K&&(X=ie%i.numberSectionStyles);let W="";return B.active?B.crit?W+=" activeCrit":W=" active":B.done?B.crit?W=" doneCrit":W=" done":B.crit&&(W+=" crit"),W.length===0&&(W=" task"),B.milestone&&(W=" milestone "+W),B.vert&&(W=" vert "+W),W+=X,W+=" "+V,q+W}),I.append("text").attr("id",function(B){return e+"-"+B.id+"-text"}).text(function(B){return B.task}).attr("font-size",i.fontSize).attr("x",function(B){let q=m(B.startTime),V=m(B.renderEndTime||B.endTime);if(B.milestone&&(q+=.5*(m(B.endTime)-m(B.startTime))-.5*F,V=q+F),B.vert)return m(B.startTime)+z;const X=this.getBBox().width;return X>V-q?V+X+1.5*i.leftPadding>R?q+z-5:V+z+5:(V-q)/2+q+z}).attr("y",function(B,q){return B.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(q=B.order,q*O+i.barHeight/2+(i.fontSize/2-2)+D)}).attr("text-height",F).attr("class",function(B){const q=m(B.startTime);let V=m(B.endTime);B.milestone&&(V=q+F);const X=this.getBBox().width;let W="";B.classes.length>0&&(W=B.classes.join(" "));let ie=0;for(const[se,te]of d.entries())B.type===te&&(ie=se%i.numberSectionStyles);let K="";return B.active&&(B.crit?K="activeCritText"+ie:K="activeText"+ie),B.done?B.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:B.crit&&(K=K+" critText"+ie),B.milestone&&(K+=" milestoneText"),B.vert&&(K+=" vertText"),X>V-q?V+X+1.5*i.leftPadding>R?W+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:W+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+X:W+" taskText taskText"+ie+" "+K+" width-"+X}),$e().securityLevel==="sandbox"){let B;B=pt("#i"+e);const q=B.nodes()[0].contentDocument;I.filter(function(V){return $.has(V.id)}).each(function(V){var X=q.querySelector("#"+CSS.escape(e+"-"+V.id)),W=q.querySelector("#"+CSS.escape(e+"-"+V.id+"-text"));const ie=X.parentNode;var K=q.createElement("a");K.setAttribute("xlink:href",$.get(V.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(X),K.appendChild(W)})}}T(x,"drawRects");function b(L,O,D,z,F,A,R,N){if(R.length===0&&N.length===0)return;let M,I;for(const{startTime:X,endTime:W}of A)(M===void 0||XI)&&(I=W);if(!M||!I)return;if(Ui(I).diff(Ui(M),"year")>5){ae.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const $=n.db.getDateFormat(),P=[];let B=null,q=Ui(M);for(;q.valueOf()<=I;)n.db.isInvalidDate(q,$,R,N)?B?B.end=q:B={start:q,end:q}:B&&(P.push(B),B=null),q=q.add(1,"d");g.append("g").selectAll("rect").data(P).enter().append("rect").attr("id",X=>e+"-exclude-"+X.start.format("YYYY-MM-DD")).attr("x",X=>m(X.start.startOf("day"))+D).attr("y",i.gridLineStartPadding).attr("width",X=>m(X.end.endOf("day"))-m(X.start.startOf("day"))).attr("height",F-O-i.gridLineStartPadding).attr("transform-origin",function(X,W){return(m(X.start)+D+.5*(m(X.end)-m(X.start))).toString()+"px "+(W*L+.5*F).toString()+"px"}).attr("class","exclude-range")}T(b,"drawExcludeDays");function w(L,O,D,z){if(D<=0||L>O)return 1/0;const F=O-L,A=Ui.duration({[z??"day"]:D}).asMilliseconds();return A<=0?1/0:Math.ceil(F/A)}T(w,"getEstimatedTickCount");function k(L,O,D,z){const F=n.db.getDateFormat(),A=n.db.getAxisFormat();let R;A?R=A:F==="D"?R="%d":R=i.axisFormat??"%Y-%m-%d";let N=hTe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(p4(R));const I=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(I!==null){const $=parseInt(I[1],10);if(isNaN($)||$<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const P=I[2],B=n.db.getWeekday()||i.weekday,q=m.domain(),V=q[0],X=q[1],W=w(V,X,$,P);if(W>d$)ae.warn(`The tick interval "${$}${P}" would generate ${W} ticks, which exceeds the maximum allowed (${d$}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(P){case"millisecond":N.ticks(Op.every($));break;case"second":N.ticks(Au.every($));break;case"minute":N.ticks(S2.every($));break;case"hour":N.ticks(A2.every($));break;case"day":N.ticks(ed.every($));break;case"week":N.ticks(kge[B].every($));break;case"month":N.ticks(L2.every($));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+L+", "+(z-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let $=uTe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(p4(R));if(I!==null){const P=parseInt(I[1],10);if(isNaN(P)||P<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const B=I[2],q=n.db.getWeekday()||i.weekday,V=m.domain(),X=V[0],W=V[1];if(w(X,W,P,B)<=d$)switch(B){case"millisecond":$.ticks(Op.every(P));break;case"second":$.ticks(Au.every(P));break;case"minute":$.ticks(S2.every(P));break;case"hour":$.ticks(A2.every(P));break;case"day":$.ticks(ed.every(P));break;case"week":$.ticks(kge[q].every(P));break;case"month":$.ticks(L2.every(P));break}}}g.append("g").attr("class","grid").attr("transform","translate("+L+", "+O+")").call($).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}T(k,"makeGrid");function S(L,O){let D=0;const z=Object.keys(f).map(F=>[F,f[F]]);g.append("g").selectAll("text").data(z).enter().append(function(F){const A=F[0].split(It.lineBreakRegex),R=-(A.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",R+"em");for(const[M,I]of A.entries()){const $=l.createElementNS("http://www.w3.org/2000/svg","tspan");$.setAttribute("alignment-baseline","central"),$.setAttribute("x","10"),M>0&&$.setAttribute("dy","1em"),$.textContent=I,N.appendChild($)}return N}).attr("x",10).attr("y",function(F,A){if(A>0)for(let R=0;R` +`},"getStyles"),zdt=Fdt,Gdt={parser:udt,db:Vve,renderer:Idt,styles:zdt};const Wdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gdt},Symbol.toStringTag,{value:"Module"}));var PA={exports:{}},qdt=PA.exports,Kve;function Vdt(){return Kve||(Kve=1,(function(t,e){(function(r,n){t.exports=n()})(qdt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(PA)),PA.exports}var Udt=Vdt();const Hdt=kd(Udt);var BA={exports:{}},Ydt=BA.exports,Zve;function Xdt(){return Zve||(Zve=1,(function(t,e){(function(r,n){t.exports=n()})(Ydt,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),x=60*T[1]+(+T[2]||0);return x===0?0:T[0]==="+"?-x:x})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,x=l.meridiem;if(x){for(var w=1;w<=24;w+=1)if(y.indexOf(x(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var x=1;x<=31;x+=1)v(x).replace(/\[|\]/g,"")===y&&(this.day=x)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(x){return x.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var x=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,I,P){var $=P&&P.toUpperCase();return I||T[P]||r[P]||T[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,R,O){return R||O.slice(1)}))}))).match(n),w=x.length,C=0;C-1)return new Date((N==="X"?1e3:1)*D);var G=m(N)(D),z=G.year,W=G.month,V=G.day,H=G.hours,te=G.minutes,Y=G.seconds,se=G.milliseconds,J=G.zone,Z=G.week,ee=new Date,re=V||(z||W?1:ee.getDate()),ge=z||ee.getFullYear(),ae=0;z&&!W||(ae=W>0?W-1:ee.getMonth());var _e,Fe=H||0,qe=te||0,ue=Y||0,de=se||0;return J?new Date(Date.UTC(ge,ae,re,Fe,qe,ue,de+60*J.offset*1e3)):B?new Date(Date.UTC(ge,ae,re,Fe,qe,ue,de)):(_e=new Date(ge,ae,re,Fe,qe,ue,de),Z&&(_e=F(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(k,L,S,T),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),P&&k!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var _=L.length,R=1;R<=_;R+=1){E[1]=L[R-1];var O=T.apply(this,E);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}R===_&&(this.$d=new Date(""))}else w.call(this,C)}}}))})(BA)),BA.exports}var jdt=Xdt();const Kdt=kd(jdt);var FA={exports:{}},Zdt=FA.exports,Qve;function Qdt(){return Qve||(Qve=1,(function(t,e){(function(r,n){t.exports=n()})(Zdt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(FA)),FA.exports}var Jdt=Qdt();const eft=kd(Jdt);var zA={exports:{}},tft=zA.exports,Jve;function rft(){return Jve||(Jve=1,(function(t,e){(function(r,n){t.exports=n()})(tft,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(k){return k instanceof w},g=function(k,S,E){return new w(k,E,S.$l)},m=function(k){return n.p(k)+"s"},y=function(k){return k<0},v=function(k){return y(k)?Math.ceil(k):Math.floor(k)},T=function(k){return Math.abs(k)},x=function(k,S){return k?y(k)?{negative:!0,format:""+T(k)+S}:{negative:!1,format:""+k+S}:{negative:!1,format:""}},w=(function(){function k(E,L,M){var I=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(E*f[m(L)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(_){I.$d[m(_)]=E[_]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var $=P.slice(2).map((function(_){return _!=null?Number(_):0}));return this.$d.years=$[0],this.$d.months=$[1],this.$d.weeks=$[2],this.$d.days=$[3],this.$d.hours=$[4],this.$d.minutes=$[5],this.$d.seconds=$[6],this.calMilliseconds(),this}}return this}var S=k.prototype;return S.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(L,M){return L+(E.$d[M]||0)*f[M]}),0)},S.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/s),E%=s,this.$d.minutes=v(E/a),E%=a,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},S.toISOString=function(){var E=x(this.$d.years,"Y"),L=x(this.$d.months,"M"),M=+this.$d.days||0;this.$d.weeks&&(M+=7*this.$d.weeks);var I=x(M,"D"),P=x(this.$d.hours,"H"),$=x(this.$d.minutes,"M"),_=this.$d.seconds||0;this.$d.milliseconds&&(_+=this.$d.milliseconds/1e3,_=Math.round(1e3*_)/1e3);var R=x(_,"S"),O=E.negative||L.negative||I.negative||P.negative||$.negative||R.negative,D=P.format||$.format||R.format?"T":"",N=(O?"-":"")+"P"+E.format+L.format+I.format+D+P.format+$.format+R.format;return N==="P"||N==="-P"?"P0D":N},S.toJSON=function(){return this.toISOString()},S.format=function(E){var L=E||"YYYY-MM-DDTHH:mm:ss",M={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(I,P){return P||String(M[I])}))},S.as=function(E){return this.$ms/f[m(E)]},S.get=function(E){var L=this.$ms,M=m(E);return M==="milliseconds"?L%=1e3:L=M==="weeks"?v(L/f[M]):this.$d[M],L||0},S.add=function(E,L,M){var I;return I=L?E*f[m(L)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+I*(M?-1:1),this)},S.subtract=function(E,L){return this.add(E,L,!0)},S.locale=function(E){var L=this.clone();return L.$l=E,L},S.clone=function(){return g(this.$ms,this)},S.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},S.valueOf=function(){return this.asMilliseconds()},S.milliseconds=function(){return this.get("milliseconds")},S.asMilliseconds=function(){return this.as("milliseconds")},S.seconds=function(){return this.get("seconds")},S.asSeconds=function(){return this.as("seconds")},S.minutes=function(){return this.get("minutes")},S.asMinutes=function(){return this.as("minutes")},S.hours=function(){return this.get("hours")},S.asHours=function(){return this.as("hours")},S.days=function(){return this.get("days")},S.asDays=function(){return this.as("days")},S.weeks=function(){return this.get("weeks")},S.asWeeks=function(){return this.as("weeks")},S.months=function(){return this.get("months")},S.asMonths=function(){return this.as("months")},S.years=function(){return this.get("years")},S.asYears=function(){return this.as("years")},k})(),C=function(k,S,E){return k.add(S.years()*E,"y").add(S.months()*E,"M").add(S.days()*E,"d").add(S.hours()*E,"h").add(S.minutes()*E,"m").add(S.seconds()*E,"s").add(S.milliseconds()*E,"ms")};return function(k,S,E){r=E,n=E().$utils(),E.duration=function(I,P){var $=E.locale();return g(I,{$l:$},P)},E.isDuration=p;var L=S.prototype.add,M=S.prototype.subtract;S.prototype.add=function(I,P){return p(I)?C(this,I,1):L.bind(this)(I,P)},S.prototype.subtract=function(I,P){return p(I)?C(this,I,-1):M.bind(this)(I,P)}}}))})(zA)),zA.exports}var nft=rft();const ift=kd(nft);var OB=(function(){var t=b(function($,_,R,O){for(R=R||{},O=$.length;O--;R[$[O]]=_);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],x=[1,19],w=[1,20],C=[1,21],k=[1,22],S=[1,23],E=[1,25],L=[1,35],M={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:b(function(_,R,O,D,N,B,F){var G=B.length-1;switch(N){case 1:return B[G-1];case 2:this.$=[];break;case 3:B[G-1].push(B[G]),this.$=B[G-1];break;case 4:case 5:this.$=B[G];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat(B[G].substr(11)),this.$=B[G].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=B[G].substr(18);break;case 19:D.TopAxis(),this.$=B[G].substr(8);break;case 20:D.setAxisFormat(B[G].substr(11)),this.$=B[G].substr(11);break;case 21:D.setTickInterval(B[G].substr(13)),this.$=B[G].substr(13);break;case 22:D.setExcludes(B[G].substr(9)),this.$=B[G].substr(9);break;case 23:D.setIncludes(B[G].substr(9)),this.$=B[G].substr(9);break;case 24:D.setTodayMarker(B[G].substr(12)),this.$=B[G].substr(12);break;case 27:D.setDiagramTitle(B[G].substr(6)),this.$=B[G].substr(6);break;case 28:this.$=B[G].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=B[G].trim(),D.setAccDescription(this.$);break;case 31:D.addSection(B[G].substr(8)),this.$=B[G].substr(8);break;case 33:D.addTask(B[G-1],B[G]),this.$="task";break;case 34:this.$=B[G-1],D.setClickEvent(B[G-1],B[G],null);break;case 35:this.$=B[G-2],D.setClickEvent(B[G-2],B[G-1],B[G]);break;case 36:this.$=B[G-2],D.setClickEvent(B[G-2],B[G-1],null),D.setLink(B[G-2],B[G]);break;case 37:this.$=B[G-3],D.setClickEvent(B[G-3],B[G-2],B[G-1]),D.setLink(B[G-3],B[G]);break;case 38:this.$=B[G-2],D.setClickEvent(B[G-2],B[G],null),D.setLink(B[G-2],B[G-1]);break;case 39:this.$=B[G-3],D.setClickEvent(B[G-3],B[G-1],B[G]),D.setLink(B[G-3],B[G-2]);break;case 40:this.$=B[G-1],D.setLink(B[G-1],B[G]);break;case 41:case 47:this.$=B[G-1]+" "+B[G];break;case 42:case 43:case 45:this.$=B[G-2]+" "+B[G-1]+" "+B[G];break;case 44:case 46:this.$=B[G-3]+" "+B[G-2]+" "+B[G-1]+" "+B[G];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:x,31:w,33:C,35:k,36:S,37:24,38:E,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:x,31:w,33:C,35:k,36:S,37:24,38:E,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:b(function(_,R){if(R.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=R,O}},"parseError"),parse:b(function(_){var R=this,O=[0],D=[],N=[null],B=[],F=this.table,G="",z=0,W=0,V=2,H=1,te=B.slice.call(arguments,1),Y=Object.create(this.lexer),se={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(se.yy[J]=this.yy[J]);Y.setInput(_,se.yy),se.yy.lexer=Y,se.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Z=Y.yylloc;B.push(Z);var ee=Y.options&&Y.options.ranges;typeof se.yy.parseError=="function"?this.parseError=se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(Le){O.length=O.length-2*Le,N.length=N.length-Le,B.length=B.length-Le}b(re,"popStack");function ge(){var Le;return Le=D.pop()||Y.lex()||H,typeof Le!="number"&&(Le instanceof Array&&(D=Le,Le=D.pop()),Le=R.symbols_[Le]||Le),Le}b(ge,"lex");for(var ae,_e,Fe,qe,ue={},de,Ce,me,$e;;){if(_e=O[O.length-1],this.defaultActions[_e]?Fe=this.defaultActions[_e]:((ae===null||typeof ae>"u")&&(ae=ge()),Fe=F[_e]&&F[_e][ae]),typeof Fe>"u"||!Fe.length||!Fe[0]){var we="";$e=[];for(de in F[_e])this.terminals_[de]&&de>V&&$e.push("'"+this.terminals_[de]+"'");Y.showPosition?we="Parse error on line "+(z+1)+`: +`+Y.showPosition()+` +Expecting `+$e.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":we="Parse error on line "+(z+1)+": Unexpected "+(ae==H?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(we,{text:Y.match,token:this.terminals_[ae]||ae,line:Y.yylineno,loc:Z,expected:$e})}if(Fe[0]instanceof Array&&Fe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+ae);switch(Fe[0]){case 1:O.push(ae),N.push(Y.yytext),B.push(Y.yylloc),O.push(Fe[1]),ae=null,W=Y.yyleng,G=Y.yytext,z=Y.yylineno,Z=Y.yylloc;break;case 2:if(Ce=this.productions_[Fe[1]][1],ue.$=N[N.length-Ce],ue._$={first_line:B[B.length-(Ce||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(Ce||1)].first_column,last_column:B[B.length-1].last_column},ee&&(ue._$.range=[B[B.length-(Ce||1)].range[0],B[B.length-1].range[1]]),qe=this.performAction.apply(ue,[G,W,z,se.yy,Fe[1],N,B].concat(te)),typeof qe<"u")return qe;Ce&&(O=O.slice(0,-1*Ce*2),N=N.slice(0,-1*Ce),B=B.slice(0,-1*Ce)),O.push(this.productions_[Fe[1]][0]),N.push(ue.$),B.push(ue._$),me=F[O[O.length-2]][O[O.length-1]],O.push(me);break;case 3:return!0}}return!0},"parse")},I=(function(){var $={EOF:1,parseError:b(function(R,O){if(this.yy.parser)this.yy.parser.parseError(R,O);else throw new Error(R)},"parseError"),setInput:b(function(_,R){return this.yy=R||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var R=_.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:b(function(_){var R=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===D.length?this.yylloc.first_column:0)+D[D.length-O.length].length-O[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(_){this.unput(this.match.slice(_))},"less"),pastInput:b(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var _=this.pastInput(),R=new Array(_.length+1).join("-");return _+this.upcomingInput()+` +`+R+"^"},"showPosition"),test_match:b(function(_,R){var O,D,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),D=_[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var B in N)this[B]=N[B];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,R,O,D;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),B=0;BR[0].length)){if(R=O,D=B,this.options.backtrack_lexer){if(_=this.test_match(O,N[B]),_!==!1)return _;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(_=this.test_match(R,N[D]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var R=this.next();return R||this.lex()},"lex"),begin:b(function(R){this.conditionStack.push(R)},"begin"),popState:b(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:b(function(R){this.begin(R)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(R,O,D,N){switch(D){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return $})();M.lexer=I;function P(){this.yy={}}return b(P,"Parser"),P.prototype=M,M.Parser=P,new P})();OB.parser=OB;var aft=OB;ca.extend(Hdt),ca.extend(Kdt),ca.extend(eft);var e2e={friday:5,saturday:6},Mc="",$B="",PB=void 0,BB="",Vm=[],Um=[],FB=new Map,zB=[],GA=[],Hm="",GB="",t2e=["active","done","crit","milestone","vert"],WB=[],Ym="",Vw=!1,qB=!1,VB="sunday",WA="saturday",UB=0,sft=b(function(){zB=[],GA=[],Hm="",WB=[],qA=0,YB=void 0,VA=void 0,oa=[],Mc="",$B="",GB="",PB=void 0,BB="",Vm=[],Um=[],Vw=!1,qB=!1,UB=0,FB=new Map,Ym="",zn(),VB="sunday",WA="saturday"},"clear"),oft=b(function(t){Ym=t},"setDiagramId"),lft=b(function(t){$B=t},"setAxisFormat"),cft=b(function(){return $B},"getAxisFormat"),uft=b(function(t){PB=t},"setTickInterval"),hft=b(function(){return PB},"getTickInterval"),dft=b(function(t){BB=t},"setTodayMarker"),fft=b(function(){return BB},"getTodayMarker"),pft=b(function(t){Mc=t},"setDateFormat"),gft=b(function(){Vw=!0},"enableInclusiveEndDates"),mft=b(function(){return Vw},"endDatesAreInclusive"),yft=b(function(){qB=!0},"enableTopAxis"),vft=b(function(){return qB},"topAxisEnabled"),bft=b(function(t){GB=t},"setDisplayMode"),xft=b(function(){return GB},"getDisplayMode"),Tft=b(function(){return Mc},"getDateFormat"),r2e=b((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),wft=b(function(t){Vm=r2e(Vm,t)},"setIncludes"),Cft=b(function(){return Vm},"getIncludes"),Sft=b(function(t){Um=r2e(Um,t)},"setExcludes"),kft=b(function(){return Um},"getExcludes"),Eft=b(function(){return FB},"getLinks"),Aft=b(function(t){Hm=t,zB.push(t)},"addSection"),_ft=b(function(){return zB},"getSections"),Rft=b(function(){let t=l2e();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),HB=b(function(t,e,r){if(r=r.trim(),b(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Gp(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=ca(r,e.trim(),!0);if(s.isValid())return s.toDate();{he.debug("Invalid date:"+r),he.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),a2e=b(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),s2e=b(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Gp(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),FB.set(n,r))}),c2e(t,"clickable")},"setLink"),c2e=b(function(t,e){t.split(",").forEach(function(r){let n=Gp(r);n!==void 0&&n.classes.push(e)})},"setClass"),Fft=b(function(t,e,r){if(Ve().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Er.runFunc(e,...n)})},"setClickFun"),u2e=b(function(t,e){WB.push(function(){const r=Ym?`${Ym}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=Ym?`${Ym}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),zft=b(function(t,e,r){t.split(",").forEach(function(n){Fft(n,e,r)}),c2e(t,"clickable")},"setClickEvent"),Gft=b(function(t){WB.forEach(function(e){e(t)})},"bindFunctions"),Wft={getConfig:b(()=>Ve().gantt,"getConfig"),clear:sft,setDateFormat:pft,getDateFormat:Tft,enableInclusiveEndDates:gft,endDatesAreInclusive:mft,enableTopAxis:yft,topAxisEnabled:vft,setAxisFormat:lft,getAxisFormat:cft,setTickInterval:uft,getTickInterval:hft,setTodayMarker:dft,getTodayMarker:fft,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,setDiagramId:oft,setDisplayMode:bft,getDisplayMode:xft,setAccDescription:Jn,getAccDescription:ei,addSection:Aft,getSections:_ft,getTasks:Rft,addTask:$ft,findTaskById:Gp,addTaskOrg:Pft,setIncludes:wft,getIncludes:Cft,setExcludes:Sft,getExcludes:kft,setClickEvent:zft,setLink:Bft,getLinks:Eft,bindFunctions:Gft,parseDuration:a2e,isInvalidDate:n2e,setWeekday:Lft,getWeekday:Ift,setWeekend:Mft};function XB(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}b(XB,"getTaskTags"),ca.extend(ift);var qft=b(function(){he.debug("Something is calling, setConf, remove the call")},"setConf"),h2e={monday:Sb,tuesday:JW,wednesday:eq,thursday:zd,friday:tq,saturday:rq,sunday:Cb},Vft=b((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Yu,jB=1e4,Uft=b(function(t,e,r,n){const i=Ve().gantt;n.db.setDiagramId(e);const a=Ve().securityLevel;let s;a==="sandbox"&&(s=mt("#i"+e));const o=mt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Yu=u.parentElement.offsetWidth,Yu===void 0&&(Yu=1200),i.useWidth!==void 0&&(Yu=i.useWidth);const h=n.db.getTasks(),d=h.filter(M=>!M.vert);let f=[];for(const M of d)f.push(M.type);f=L(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const M={};for(const P of d)M[P.section]===void 0?M[P.section]=[P]:M[P.section].push(P);let I=0;for(const P of Object.keys(M)){const $=Vft(M[P],I)+1;I+=$,g+=$*(i.barHeight+i.barGap),p[P]=$}}else{g+=d.length*(i.barHeight+i.barGap);for(const M of f)p[M]=d.filter(I=>I.type===M).length}u.setAttribute("viewBox","0 0 "+Yu+" "+g);const m=o.select(`[id="${e}"]`),y=u_e().domain([Tke(h,function(M){return M.startTime}),xke(h,function(M){return M.endTime})]).rangeRound([0,Yu-i.leftPadding-i.rightPadding]);function v(M,I){const P=M.startTime,$=I.startTime;let _=0;return P>$?_=1:P<$&&(_=-1),_}b(v,"taskCompare"),h.sort(v),T(h,Yu,g),bi(m,g,Yu,i.useMaxWidth),m.append("text").text(n.db.getDiagramTitle()).attr("x",Yu/2).attr("y",i.titleTopMargin).attr("class","titleText");function T(M,I,P){const $=i.barHeight,_=$+i.barGap,R=i.topPadding,O=i.leftPadding,D=b0().domain([0,f.length]).range(["#00B9FA","#F95002"]).interpolate(V5e);w(_,R,O,I,P,M,n.db.getExcludes(),n.db.getIncludes()),k(O,R,I,P),x(M,_,R,O,$,D,I),S(_,R),E(O,R,I,P)}b(T,"makeGantt");function x(M,I,P,$,_,R,O){M.sort((W,V)=>W.vert===V.vert?0:W.vert?1:-1);const D=M.filter(W=>!W.vert),B=[...new Set(D.map(W=>W.order))].map(W=>D.find(V=>V.order===W));m.append("g").selectAll("rect").data(B).enter().append("rect").attr("x",0).attr("y",function(W,V){return V=W.order,V*I+P-2}).attr("width",function(){return O-i.rightPadding/2}).attr("height",I).attr("class",function(W){for(const[V,H]of f.entries())if(W.type===H)return"section section"+V%i.numberSectionStyles;return"section section0"}).enter();const F=m.append("g").selectAll("rect").data(M).enter(),G=n.db.getLinks();if(F.append("rect").attr("id",function(W){return e+"-"+W.id}).attr("rx",3).attr("ry",3).attr("x",function(W){return W.milestone?y(W.startTime)+$+.5*(y(W.endTime)-y(W.startTime))-.5*_:y(W.startTime)+$}).attr("y",function(W,V){return V=W.order,W.vert?i.gridLineStartPadding:V*I+P}).attr("width",function(W){return W.milestone?_:W.vert?.08*_:y(W.renderEndTime||W.endTime)-y(W.startTime)}).attr("height",function(W){return W.vert?D.length*(i.barHeight+i.barGap)+i.barHeight*2:_}).attr("transform-origin",function(W,V){return V=W.order,(y(W.startTime)+$+.5*(y(W.endTime)-y(W.startTime))).toString()+"px "+(V*I+P+.5*_).toString()+"px"}).attr("class",function(W){const V="task";let H="";W.classes.length>0&&(H=W.classes.join(" "));let te=0;for(const[se,J]of f.entries())W.type===J&&(te=se%i.numberSectionStyles);let Y="";return W.active?W.crit?Y+=" activeCrit":Y=" active":W.done?W.crit?Y=" doneCrit":Y=" done":W.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),W.milestone&&(Y=" milestone "+Y),W.vert&&(Y=" vert "+Y),Y+=te,Y+=" "+H,V+Y}),F.append("text").attr("id",function(W){return e+"-"+W.id+"-text"}).text(function(W){return W.task}).attr("font-size",i.fontSize).attr("x",function(W){let V=y(W.startTime),H=y(W.renderEndTime||W.endTime);if(W.milestone&&(V+=.5*(y(W.endTime)-y(W.startTime))-.5*_,H=V+_),W.vert)return y(W.startTime)+$;const te=this.getBBox().width;return te>H-V?H+te+1.5*i.leftPadding>O?V+$-5:H+$+5:(H-V)/2+V+$}).attr("y",function(W,V){return W.vert?i.gridLineStartPadding+D.length*(i.barHeight+i.barGap)+60:(V=W.order,V*I+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",_).attr("class",function(W){const V=y(W.startTime);let H=y(W.endTime);W.milestone&&(H=V+_);const te=this.getBBox().width;let Y="";W.classes.length>0&&(Y=W.classes.join(" "));let se=0;for(const[Z,ee]of f.entries())W.type===ee&&(se=Z%i.numberSectionStyles);let J="";return W.active&&(W.crit?J="activeCritText"+se:J="activeText"+se),W.done?W.crit?J=J+" doneCritText"+se:J=J+" doneText"+se:W.crit&&(J=J+" critText"+se),W.milestone&&(J+=" milestoneText"),W.vert&&(J+=" vertText"),te>H-V?H+te+1.5*i.leftPadding>O?Y+" taskTextOutsideLeft taskTextOutside"+se+" "+J:Y+" taskTextOutsideRight taskTextOutside"+se+" "+J+" width-"+te:Y+" taskText taskText"+se+" "+J+" width-"+te}),Ve().securityLevel==="sandbox"){let W;W=mt("#i"+e);const V=W.nodes()[0].contentDocument;F.filter(function(H){return G.has(H.id)}).each(function(H){var te=V.querySelector("#"+CSS.escape(e+"-"+H.id)),Y=V.querySelector("#"+CSS.escape(e+"-"+H.id+"-text"));const se=te.parentNode;var J=V.createElement("a");J.setAttribute("xlink:href",G.get(H.id)),J.setAttribute("target","_top"),se.appendChild(J),J.appendChild(te),J.appendChild(Y)})}}b(x,"drawRects");function w(M,I,P,$,_,R,O,D){if(O.length===0&&D.length===0)return;let N,B;for(const{startTime:H,endTime:te}of R)(N===void 0||HB)&&(B=te);if(!N||!B)return;if(ca(B).diff(ca(N),"year")>5){he.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const F=n.db.getDateFormat(),G=[];let z=null,W=ca(N);for(;W.valueOf()<=B;)n.db.isInvalidDate(W,F,O,D)?z?z.end=W:z={start:W,end:W}:z&&(G.push(z),z=null),W=W.add(1,"d");m.append("g").selectAll("rect").data(G).enter().append("rect").attr("id",H=>e+"-exclude-"+H.start.format("YYYY-MM-DD")).attr("x",H=>y(H.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",H=>y(H.end.endOf("day"))-y(H.start.startOf("day"))).attr("height",_-I-i.gridLineStartPadding).attr("transform-origin",function(H,te){return(y(H.start)+P+.5*(y(H.end)-y(H.start))).toString()+"px "+(te*M+.5*_).toString()+"px"}).attr("class","exclude-range")}b(w,"drawExcludeDays");function C(M,I,P,$){if(P<=0||M>I)return 1/0;const _=I-M,R=ca.duration({[$??"day"]:P}).asMilliseconds();return R<=0?1/0:Math.ceil(_/R)}b(C,"getEstimatedTickCount");function k(M,I,P,$){const _=n.db.getDateFormat(),R=n.db.getAxisFormat();let O;R?O=R:_==="D"?O="%d":O=i.axisFormat??"%Y-%m-%d";let D=Lke(y).tickSize(-$+I+i.gridLineStartPadding).tickFormat(p4(O));const B=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(B!==null){const F=parseInt(B[1],10);if(isNaN(F)||F<=0)he.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const G=B[2],z=n.db.getWeekday()||i.weekday,W=y.domain(),V=W[0],H=W[1],te=C(V,H,F,G);if(te>jB)he.warn(`The tick interval "${F}${G}" would generate ${te} ticks, which exceeds the maximum allowed (${jB}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(G){case"millisecond":D.ticks(x0.every(F));break;case"second":D.ticks(sh.every(F));break;case"minute":D.ticks(Tb.every(F));break;case"hour":D.ticks(wb.every(F));break;case"day":D.ticks(Bd.every(F));break;case"week":D.ticks(h2e[z].every(F));break;case"month":D.ticks(kb.every(F));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+($-50)+")").call(D).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let F=Rke(y).tickSize(-$+I+i.gridLineStartPadding).tickFormat(p4(O));if(B!==null){const G=parseInt(B[1],10);if(isNaN(G)||G<=0)he.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const z=B[2],W=n.db.getWeekday()||i.weekday,V=y.domain(),H=V[0],te=V[1];if(C(H,te,G,z)<=jB)switch(z){case"millisecond":F.ticks(x0.every(G));break;case"second":F.ticks(sh.every(G));break;case"minute":F.ticks(Tb.every(G));break;case"hour":F.ticks(wb.every(G));break;case"day":F.ticks(Bd.every(G));break;case"week":F.ticks(h2e[W].every(G));break;case"month":F.ticks(kb.every(G));break}}}m.append("g").attr("class","grid").attr("transform","translate("+M+", "+I+")").call(F).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}b(k,"makeGrid");function S(M,I){let P=0;const $=Object.keys(p).map(_=>[_,p[_]]);m.append("g").selectAll("text").data($).enter().append(function(_){const R=_[0].split($t.lineBreakRegex),O=-(R.length-1)/2,D=l.createElementNS("http://www.w3.org/2000/svg","text");D.setAttribute("dy",O+"em");for(const[N,B]of R.entries()){const F=l.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttribute("alignment-baseline","central"),F.setAttribute("x","10"),N>0&&F.setAttribute("dy","1em"),F.textContent=B,D.appendChild(F)}return D}).attr("x",10).attr("y",function(_,R){if(R>0)for(let O=0;O` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -1735,13 +1741,22 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":xe="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),Yot=Hot,Xot={parser:iot,db:Got,renderer:Uot,styles:Yot};const Kot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xot},Symbol.toStringTag,{value:"Module"}));var jot={parse:T(async t=>{const e=await Qo("info",t);ae.debug(e)},"parse")},Zot={version:"11.15.0"},Qot=T(()=>Zot.version,"getVersion"),Jot={getVersion:Qot},elt=T((t,e,r)=>{ae.debug(`rendering info diagram -`+t);const n=ms(e);vi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),tlt={draw:elt},rlt={parser:jot,db:Jot,renderer:tlt};const nlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:rlt},Symbol.toStringTag,{value:"Module"}));var ilt=Fr.pie,f$={sections:new Map,showData:!1},kS=f$.sections,p$=f$.showData,alt=structuredClone(ilt),slt=T(()=>structuredClone(alt),"getConfig"),olt=T(()=>{kS=new Map,p$=f$.showData,Dn()},"clear"),llt=T(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);kS.has(t)||(kS.set(t,e),ae.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),clt=T(()=>kS,"getSections"),ult=T(t=>{p$=t},"setShowData"),hlt=T(()=>p$,"getShowData"),Ege={getConfig:slt,clear:olt,setDiagramTitle:Wn,getDiagramTitle:Nn,setAccTitle:Mn,getAccTitle:Gn,setAccDescription:qn,getAccDescription:Vn,addSection:llt,getSections:clt,setShowData:ult,getShowData:hlt},dlt=T((t,e)=>{Fl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),flt={parse:T(async t=>{const e=await Qo("pie",t);ae.debug(e),dlt(e,Ege)},"parse")},plt=T(t=>` +`,"getStyles"),Xft=Yft,jft={parser:aft,db:Wft,renderer:Hft,styles:Xft};const Kft=Object.freeze(Object.defineProperty({__proto__:null,diagram:jft},Symbol.toStringTag,{value:"Module"}));var Zft={parse:b(async t=>{const e=await Xo("info",t);he.debug(e)},"parse")},Qft={version:"11.16.0"},Jft=b(()=>Qft.version,"getVersion"),ept={getVersion:Jft},tpt=b((t,e,r)=>{he.debug(`rendering info diagram +`+t);const n=Ka(e);bi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),rpt={draw:tpt},npt={parser:Zft,db:ept,renderer:rpt};const ipt=Object.freeze(Object.defineProperty({__proto__:null,diagram:npt},Symbol.toStringTag,{value:"Module"}));var apt=jr.pie,KB={sections:new Map,showData:!1},UA=KB.sections,ZB=KB.showData,spt=structuredClone(apt),opt=b(()=>structuredClone(spt),"getConfig"),lpt=b(()=>{UA=new Map,ZB=KB.showData,zn()},"clear"),cpt=b(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);UA.has(t)||(UA.set(t,e),he.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),upt=b(()=>UA,"getSections"),hpt=b(t=>{ZB=t},"setShowData"),dpt=b(()=>ZB,"getShowData"),d2e={getConfig:opt,clear:lpt,setDiagramTitle:ti,getDiagramTitle:Vn,setAccTitle:qn,getAccTitle:Qn,setAccDescription:Jn,getAccDescription:ei,addSection:cpt,getSections:upt,setShowData:hpt,getShowData:dpt},fpt=b((t,e)=>{Cs(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),ppt={parse:b(async t=>{const e=await Xo("pie",t);he.debug(e),fpt(e,d2e)},"parse")},gpt=b(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; opacity : ${t.pieOpacity}; } + .pieCircle.highlighted{ + scale: 1.05; + opacity: 1; + } + .pieCircle.highlightedOnHover:hover{ + transition-duration: 250ms; + scale: 1.05; + opacity: 1; + } .pieOuterCircle{ stroke: ${t.pieOuterStrokeColor}; stroke-width: ${t.pieOuterStrokeWidth}; @@ -1764,25 +1779,25 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":xe="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),glt=plt,mlt=T(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return ske().value(i=>i.value).sort(null)(r)},"createPieArcs"),ylt=T((t,e,r,n)=>{var B;ae.debug(`rendering pie chart -`+t);const i=n.db,a=$e(),s=ti(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=ms(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Tc(g.pieOuterStrokeWidth);m??(m=2);const y=s.textPosition,v=Math.min(d,h)/2-o,x=Fp().innerRadius(0).outerRadius(v),b=Fp().innerRadius(v*y).outerRadius(v*y);p.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const w=i.getSections(),k=mlt(w),S=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let C=0;w.forEach(q=>{C+=q});const _=k.filter(q=>(q.data.value/C*100).toFixed(0)!=="0"),L=Jh(S).domain([...w.keys()]);p.selectAll("mySlices").data(_).enter().append("path").attr("d",x).attr("fill",q=>L(q.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(_).enter().append("text").text(q=>(q.data.value/C*100).toFixed(0)+"%").attr("transform",q=>"translate("+b.centroid(q)+")").style("text-anchor","middle").attr("class","slice");const O=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),D=[...w.entries()].map(([q,V])=>({label:q,value:V})),z=p.selectAll(".legend").data(D).enter().append("g").attr("class","legend").attr("transform",(q,V)=>{const X=l+u,W=X*D.length/2,ie=12*l,K=V*X-W;return"translate("+ie+","+K+")"});z.append("rect").attr("width",l).attr("height",l).style("fill",q=>L(q.label)).style("stroke",q=>L(q.label)),z.append("text").attr("x",l+u).attr("y",l-u).text(q=>i.getShowData()?`${q.label} [${q.value}]`:q.label);const F=Math.max(...z.selectAll("text").nodes().map(q=>(q==null?void 0:q.getBoundingClientRect().width)??0)),A=d+o+l+u+F,R=((B=O.node())==null?void 0:B.getBoundingClientRect().width)??0,N=d/2-R/2,M=d/2+R/2,I=Math.min(0,N),P=Math.max(A,M)-I;f.attr("viewBox",`${I} 0 ${P} ${h}`),vi(f,h,P,s.useMaxWidth)},"draw"),vlt={draw:ylt},blt={parser:flt,db:Ege,renderer:vlt,styles:glt};const xlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:blt},Symbol.toStringTag,{value:"Module"}));var g$=(function(){var t=T(function(j,pe,re,Pe){for(re=re||{},Pe=j.length;Pe--;re[j[Pe]]=pe);return re},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],x=[1,23],b=[1,18],w=[1,19],k=[1,20],S=[1,21],C=[1,22],_=[1,24],L=[1,25],O=[1,26],D=[1,27],z=[1,28],F=[1,29],A=[1,32],R=[1,33],N=[1,34],M=[1,39],I=[1,40],$=[1,42],P=[1,44],B=[1,63],q=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],X=[1,66],W=[1,67],ie=[1,68],K=[1,69],se=[1,70],te=[1,71],Z=[1,72],ee=[1,73],ne=[1,74],oe=[1,75],fe=[1,76],Ae=[1,77],Re=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ge=[1,91],Ce=[1,92],be=[1,93],Fe=[1,100],ye=[1,94],He=[1,97],xe=[1,95],Ve=[1,96],Je=[1,98],nt=[1,99],tt=[1,103],Ze=[10,55,56,57],Ee=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Se={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:T(function(pe,re,Pe,ve,Ue,Me,qe){var Le=Me.length-1;switch(Ue){case 23:this.$=Me[Le];break;case 24:this.$=Me[Le-1]+""+Me[Le];break;case 26:this.$=Me[Le-1]+Me[Le];break;case 27:this.$=[Me[Le].trim()];break;case 28:Me[Le-2].push(Me[Le].trim()),this.$=Me[Le-2];break;case 29:this.$=Me[Le-4],ve.addClass(Me[Le-2],Me[Le]);break;case 37:this.$=[];break;case 42:this.$=Me[Le].trim(),ve.setDiagramTitle(this.$);break;case 43:this.$=Me[Le].trim(),ve.setAccTitle(this.$);break;case 44:case 45:this.$=Me[Le].trim(),ve.setAccDescription(this.$);break;case 46:ve.addSection(Me[Le].substr(8)),this.$=Me[Le].substr(8);break;case 47:ve.addPoint(Me[Le-3],"",Me[Le-1],Me[Le],[]);break;case 48:ve.addPoint(Me[Le-4],Me[Le-3],Me[Le-1],Me[Le],[]);break;case 49:ve.addPoint(Me[Le-4],"",Me[Le-2],Me[Le-1],Me[Le]);break;case 50:ve.addPoint(Me[Le-5],Me[Le-4],Me[Le-2],Me[Le-1],Me[Le]);break;case 51:ve.setXAxisLeftText(Me[Le-2]),ve.setXAxisRightText(Me[Le]);break;case 52:Me[Le-1].text+=" ⟶ ",ve.setXAxisLeftText(Me[Le-1]);break;case 53:ve.setXAxisLeftText(Me[Le]);break;case 54:ve.setYAxisBottomText(Me[Le-2]),ve.setYAxisTopText(Me[Le]);break;case 55:Me[Le-1].text+=" ⟶ ",ve.setYAxisBottomText(Me[Le-1]);break;case 56:ve.setYAxisBottomText(Me[Le]);break;case 57:ve.setQuadrant1Text(Me[Le]);break;case 58:ve.setQuadrant2Text(Me[Le]);break;case 59:ve.setQuadrant3Text(Me[Le]);break;case 60:ve.setQuadrant4Text(Me[Le]);break;case 64:this.$={text:Me[Le],type:"text"};break;case 65:this.$={text:Me[Le-1].text+""+Me[Le],type:Me[Le-1].type};break;case 66:this.$={text:Me[Le],type:"text"};break;case 67:this.$={text:Me[Le],type:"markdown"};break;case 68:this.$=Me[Le];break;case 69:this.$=Me[Le-1]+""+Me[Le];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:k,41:S,42:C,48:_,50:L,51:O,52:D,53:z,54:F,60:A,61:R,63:N,64:M,65:I,66:$,67:P}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:k,41:S,42:C,48:_,50:L,51:O,52:D,53:z,54:F,60:A,61:R,63:N,64:M,65:I,66:$,67:P}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:A,61:R,63:N,64:M,65:I,66:$,67:P},{4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,44:[1,58],47:[1,59],58:61,59:60,63:N,64:M,65:I,66:$,67:P},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:X,5:W,6:ie,7:K,8:se,9:te,10:Z,11:ee,12:ne,13:oe,14:fe,15:Ae,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,49:[1,78],63:N,64:M,65:I,66:$,67:P}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,49:[1,79],63:N,64:M,65:I,66:$,67:P}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:X,5:W,6:ie,7:K,8:se,9:te,10:Z,11:ee,12:ne,13:oe,14:fe,15:Ae,18:[1,82]},t(Re,[2,23]),t(Re,[2,1]),t(Re,[2,2]),t(Re,[2,3]),t(Re,[2,4]),t(Re,[2,5]),t(Re,[2,6]),t(Re,[2,7]),t(Re,[2,8]),t(Re,[2,9]),t(Re,[2,10]),t(Re,[2,11]),t(Re,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:M,65:I,66:$,67:P}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:M,65:I,66:$,67:P}),{46:[1,86]},{45:[1,87]},{4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,16:90,17:xe,18:Ve,19:Je,20:nt,22:89,23:88},t(Re,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:B,10:f,12:p,13:g,14:m,15:y,18:q,63:N,64:M,65:I,66:$,67:P}),t(l,[2,47],{22:89,16:90,23:101,4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,17:xe,18:Ve,19:Je,20:nt}),{46:[1,102]},t(l,[2,29],{10:tt}),t(Ze,[2,27],{16:104,4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,17:xe,18:Ve,19:Je,20:nt}),t(Ee,[2,25]),t(Ee,[2,13]),t(Ee,[2,14]),t(Ee,[2,15]),t(Ee,[2,16]),t(Ee,[2,17]),t(Ee,[2,18]),t(Ee,[2,19]),t(Ee,[2,20]),t(Ee,[2,21]),t(Ee,[2,22]),t(l,[2,49],{10:tt}),t(l,[2,48],{22:89,16:90,23:105,4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,17:xe,18:Ve,19:Je,20:nt}),{4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,16:90,17:xe,18:Ve,19:Je,20:nt,22:106},t(Ee,[2,26]),t(l,[2,50],{10:tt}),t(Ze,[2,28],{16:104,4:Ge,5:Ce,6:be,8:Fe,11:ye,13:He,17:xe,18:Ve,19:Je,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:T(function(pe,re){if(re.recoverable)this.trace(pe);else{var Pe=new Error(pe);throw Pe.hash=re,Pe}},"parseError"),parse:T(function(pe){var re=this,Pe=[0],ve=[],Ue=[null],Me=[],qe=this.table,Le="",Ke=0,De=0,it=2,Te=1,ct=Me.slice.call(arguments,1),we=Object.create(this.lexer),Et={yy:{}};for(var yt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yt)&&(Et.yy[yt]=this.yy[yt]);we.setInput(pe,Et.yy),Et.yy.lexer=we,Et.yy.parser=this,typeof we.yylloc>"u"&&(we.yylloc={});var ot=we.yylloc;Me.push(ot);var Dt=we.options&&we.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(Ft){Pe.length=Pe.length-2*Ft,Ue.length=Ue.length-Ft,Me.length=Me.length-Ft}T(vt,"popStack");function ut(){var Ft;return Ft=ve.pop()||we.lex()||Te,typeof Ft!="number"&&(Ft instanceof Array&&(ve=Ft,Ft=ve.pop()),Ft=re.symbols_[Ft]||Ft),Ft}T(ut,"lex");for(var le,At,dt,ht,St={},Nr,me,et,lt;;){if(At=Pe[Pe.length-1],this.defaultActions[At]?dt=this.defaultActions[At]:((le===null||typeof le>"u")&&(le=ut()),dt=qe[At]&&qe[At][le]),typeof dt>"u"||!dt.length||!dt[0]){var Rt="";lt=[];for(Nr in qe[At])this.terminals_[Nr]&&Nr>it&<.push("'"+this.terminals_[Nr]+"'");we.showPosition?Rt="Parse error on line "+(Ke+1)+`: -`+we.showPosition()+` -Expecting `+lt.join(", ")+", got '"+(this.terminals_[le]||le)+"'":Rt="Parse error on line "+(Ke+1)+": Unexpected "+(le==Te?"end of input":"'"+(this.terminals_[le]||le)+"'"),this.parseError(Rt,{text:we.match,token:this.terminals_[le]||le,line:we.yylineno,loc:ot,expected:lt})}if(dt[0]instanceof Array&&dt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+le);switch(dt[0]){case 1:Pe.push(le),Ue.push(we.yytext),Me.push(we.yylloc),Pe.push(dt[1]),le=null,De=we.yyleng,Le=we.yytext,Ke=we.yylineno,ot=we.yylloc;break;case 2:if(me=this.productions_[dt[1]][1],St.$=Ue[Ue.length-me],St._$={first_line:Me[Me.length-(me||1)].first_line,last_line:Me[Me.length-1].last_line,first_column:Me[Me.length-(me||1)].first_column,last_column:Me[Me.length-1].last_column},Dt&&(St._$.range=[Me[Me.length-(me||1)].range[0],Me[Me.length-1].range[1]]),ht=this.performAction.apply(St,[Le,De,Ke,Et.yy,dt[1],Ue,Me].concat(ct)),typeof ht<"u")return ht;me&&(Pe=Pe.slice(0,-1*me*2),Ue=Ue.slice(0,-1*me),Me=Me.slice(0,-1*me)),Pe.push(this.productions_[dt[1]][0]),Ue.push(St.$),Me.push(St._$),et=qe[Pe[Pe.length-2]][Pe[Pe.length-1]],Pe.push(et);break;case 3:return!0}}return!0},"parse")},Y=(function(){var j={EOF:1,parseError:T(function(re,Pe){if(this.yy.parser)this.yy.parser.parseError(re,Pe);else throw new Error(re)},"parseError"),setInput:T(function(pe,re){return this.yy=re||this.yy||{},this._input=pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var re=pe.match(/(?:\r\n?|\n).*/g);return re?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:T(function(pe){var re=pe.length,Pe=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var ve=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Pe.length-1&&(this.yylineno-=Pe.length-1);var Ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Pe?(Pe.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-Pe.length].length-Pe[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[Ue[0],Ue[0]+this.yyleng-re]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:T(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var pe=this.pastInput(),re=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` -`+re+"^"},"showPosition"),test_match:T(function(pe,re){var Pe,ve,Ue;if(this.options.backtrack_lexer&&(Ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ue.yylloc.range=this.yylloc.range.slice(0))),ve=pe[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(pe[0].length),this.matched+=pe[0],Pe=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Pe)return Pe;if(this._backtrack){for(var Me in Ue)this[Me]=Ue[Me];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,re,Pe,ve;this._more||(this.yytext="",this.match="");for(var Ue=this._currentRules(),Me=0;Mere[0].length)){if(re=Pe,ve=Me,this.options.backtrack_lexer){if(pe=this.test_match(Pe,Ue[Me]),pe!==!1)return pe;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(pe=this.test_match(re,Ue[ve]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var re=this.next();return re||this.lex()},"lex"),begin:T(function(re){this.conditionStack.push(re)},"begin"),popState:T(function(){var re=this.conditionStack.length-1;return re>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:T(function(re){this.begin(re)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(re,Pe,ve,Ue){switch(ve){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();Se.lexer=Y;function ce(){this.yy={}}return T(ce,"Parser"),ce.prototype=Se,Se.Parser=ce,new ce})();g$.parser=g$;var Tlt=g$,ds=kp(),wlt=(Lv=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Fr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Fr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Fr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Fr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Fr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Fr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Fr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Fr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Fr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Fr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Fr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Fr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Fr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Fr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Fr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Fr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Fr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=Fr.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:ds.quadrant1Fill,quadrant2Fill:ds.quadrant2Fill,quadrant3Fill:ds.quadrant3Fill,quadrant4Fill:ds.quadrant4Fill,quadrant1TextFill:ds.quadrant1TextFill,quadrant2TextFill:ds.quadrant2TextFill,quadrant3TextFill:ds.quadrant3TextFill,quadrant4TextFill:ds.quadrant4TextFill,quadrantPointFill:ds.quadrantPointFill,quadrantPointTextFill:ds.quadrantPointTextFill,quadrantXAxisTextFill:ds.quadrantXAxisTextFill,quadrantYAxisTextFill:ds.quadrantYAxisTextFill,quadrantTitleFill:ds.quadrantTitleFill,quadrantInternalBorderStrokeFill:ds.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:ds.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ae.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){ae.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ae.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=Np().domain([0,1]).range([i,s+i]),l=Np().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},T(Lv,"QuadrantBuilder"),Lv),ES=(Iv=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},T(Iv,"InvalidStyleError"),Iv);function m$(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}T(m$,"validateHexCode");function Sge(t){return!/^\d+$/.test(t)}T(Sge,"validateNumber");function Age(t){return!/^\d+px$/.test(t)}T(Age,"validateSizeInPixels");var Clt=$e();function ic(t){return qr(t.trim(),Clt)}T(ic,"textSanitizer");var Ta=new wlt;function _ge(t){Ta.setData({quadrant1Text:ic(t.text)})}T(_ge,"setQuadrant1Text");function Rge(t){Ta.setData({quadrant2Text:ic(t.text)})}T(Rge,"setQuadrant2Text");function Lge(t){Ta.setData({quadrant3Text:ic(t.text)})}T(Lge,"setQuadrant3Text");function Ige(t){Ta.setData({quadrant4Text:ic(t.text)})}T(Ige,"setQuadrant4Text");function Dge(t){Ta.setData({xAxisLeftText:ic(t.text)})}T(Dge,"setXAxisLeftText");function Mge(t){Ta.setData({xAxisRightText:ic(t.text)})}T(Mge,"setXAxisRightText");function Nge(t){Ta.setData({yAxisTopText:ic(t.text)})}T(Nge,"setYAxisTopText");function Oge(t){Ta.setData({yAxisBottomText:ic(t.text)})}T(Oge,"setYAxisBottomText");function SS(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Sge(i))throw new ES(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(m$(i))throw new ES(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(m$(i))throw new ES(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Age(i))throw new ES(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}T(SS,"parseStyles");function $ge(t,e,r,n,i){const a=SS(i);Ta.addPoints([{x:r,y:n,text:ic(t.text),className:e,...a}])}T($ge,"addPoint");function Pge(t,e){Ta.addClass(t,SS(e))}T(Pge,"addClass");function Bge(t){Ta.setConfig({chartWidth:t})}T(Bge,"setWidth");function Fge(t){Ta.setConfig({chartHeight:t})}T(Fge,"setHeight");function zge(){const t=$e(),{themeVariables:e,quadrantChart:r}=t;return r&&Ta.setConfig(r),Ta.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Ta.setData({titleText:Nn()}),Ta.build()}T(zge,"getQuadrantData");var klt=T(function(){Ta.clear(),Dn()},"clear"),Elt={setWidth:Bge,setHeight:Fge,setQuadrant1Text:_ge,setQuadrant2Text:Rge,setQuadrant3Text:Lge,setQuadrant4Text:Ige,setXAxisLeftText:Dge,setXAxisRightText:Mge,setYAxisTopText:Nge,setYAxisBottomText:Oge,parseStyles:SS,addPoint:$ge,addClass:Pge,getQuadrantData:zge,clear:klt,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,getAccDescription:Vn,setAccDescription:qn},Slt=T((t,e,r,n)=>{var _,L,O;function i(D){return D==="top"?"hanging":"middle"}T(i,"getDominantBaseLine");function a(D){return D==="left"?"start":"middle"}T(a,"getTextAnchor");function s(D){return`translate(${D.x}, ${D.y}) rotate(${D.rotation||0})`}T(s,"getTransformation");const o=$e();ae.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const d=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((_=o.quadrantChart)==null?void 0:_.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;vi(d,g,p,((O=o.quadrantChart)==null?void 0:O.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",D=>D.x1).attr("y1",D=>D.y1).attr("x2",D=>D.x2).attr("y2",D=>D.y2).style("stroke",D=>D.strokeFill).style("stroke-width",D=>D.strokeWidth);const k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",D=>D.x).attr("y",D=>D.y).attr("width",D=>D.width).attr("height",D=>D.height).attr("fill",D=>D.fill),k.append("text").attr("x",0).attr("y",0).attr("fill",D=>D.text.fill).attr("font-size",D=>D.text.fontSize).attr("dominant-baseline",D=>i(D.text.horizontalPos)).attr("text-anchor",D=>a(D.text.verticalPos)).attr("transform",D=>s(D.text)).text(D=>D.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(D=>D.text).attr("fill",D=>D.fill).attr("font-size",D=>D.fontSize).attr("dominant-baseline",D=>i(D.horizontalPos)).attr("text-anchor",D=>a(D.verticalPos)).attr("transform",D=>s(D));const C=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",D=>D.x).attr("cy",D=>D.y).attr("r",D=>D.radius).attr("fill",D=>D.fill).attr("stroke",D=>D.strokeColor).attr("stroke-width",D=>D.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(D=>D.text.text).attr("fill",D=>D.text.fill).attr("font-size",D=>D.text.fontSize).attr("dominant-baseline",D=>i(D.text.horizontalPos)).attr("text-anchor",D=>a(D.text.verticalPos)).attr("transform",D=>s(D.text))},"draw"),Alt={draw:Slt},_lt={parser:Tlt,db:Elt,renderer:Alt,styles:T(()=>"","styles")};const Rlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_lt},Symbol.toStringTag,{value:"Module"}));var y$=(function(){var t=T(function(R,N,M,I){for(M=M||{},I=R.length;I--;M[R[I]]=N);return M},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],k=[1,42],S=[1,47],C=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],O=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],z={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:T(function(N,M,I,$,P,B,q){var V=B.length-1;switch(P){case 5:$.setOrientation(B[V]);break;case 9:$.setDiagramTitle(B[V].text.trim());break;case 12:$.setLineData({text:"",type:"text"},B[V]);break;case 13:$.setLineData(B[V-1],B[V]);break;case 14:$.setBarData({text:"",type:"text"},B[V]);break;case 15:$.setBarData(B[V-1],B[V]);break;case 16:this.$=B[V].trim(),$.setAccTitle(this.$);break;case 17:case 18:this.$=B[V].trim(),$.setAccDescription(this.$);break;case 19:this.$=B[V-1];break;case 20:this.$=[Number(B[V-2]),...B[V]];break;case 21:this.$=[Number(B[V])];break;case 22:$.setXAxisTitle(B[V]);break;case 23:$.setXAxisTitle(B[V-1]);break;case 24:$.setXAxisTitle({type:"text",text:""});break;case 25:$.setXAxisBand(B[V]);break;case 26:$.setXAxisRangeData(Number(B[V-2]),Number(B[V]));break;case 27:this.$=B[V-1];break;case 28:this.$=[B[V-2],...B[V]];break;case 29:this.$=[B[V]];break;case 30:$.setYAxisTitle(B[V]);break;case 31:$.setYAxisTitle(B[V-1]);break;case 32:$.setYAxisTitle({type:"text",text:""});break;case 33:$.setYAxisRangeData(Number(B[V-2]),Number(B[V]));break;case 37:this.$={text:B[V],type:"text"};break;case 38:this.$={text:B[V],type:"text"};break;case 39:this.$={text:B[V],type:"markdown"};break;case 40:this.$=B[V];break;case 41:this.$=B[V-1]+""+B[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:S,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(L,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b}),t(L,[2,38]),t(L,[2,39]),t(O,[2,40]),t(O,[2,42]),t(O,[2,43]),t(O,[2,44]),t(O,[2,45]),t(O,[2,46]),t(O,[2,47]),t(O,[2,48]),t(O,[2,49]),t(O,[2,50]),t(O,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:w,27:k}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(_,[2,11]),t(_,[2,30],{33:60,27:S}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:C},{25:63,27:D},t(_,[2,14]),{17:65,24:C},t(_,[2,16]),t(_,[2,17]),t(O,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(_,[2,33]),t(_,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:T(function(N,M){if(M.recoverable)this.trace(N);else{var I=new Error(N);throw I.hash=M,I}},"parseError"),parse:T(function(N){var M=this,I=[0],$=[],P=[null],B=[],q=this.table,V="",X=0,W=0,ie=2,K=1,se=B.slice.call(arguments,1),te=Object.create(this.lexer),Z={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(Z.yy[ee]=this.yy[ee]);te.setInput(N,Z.yy),Z.yy.lexer=te,Z.yy.parser=this,typeof te.yylloc>"u"&&(te.yylloc={});var ne=te.yylloc;B.push(ne);var oe=te.options&&te.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(nt){I.length=I.length-2*nt,P.length=P.length-nt,B.length=B.length-nt}T(fe,"popStack");function Ae(){var nt;return nt=$.pop()||te.lex()||K,typeof nt!="number"&&(nt instanceof Array&&($=nt,nt=$.pop()),nt=M.symbols_[nt]||nt),nt}T(Ae,"lex");for(var Re,Ge,Ce,be,Fe={},ye,He,xe,Ve;;){if(Ge=I[I.length-1],this.defaultActions[Ge]?Ce=this.defaultActions[Ge]:((Re===null||typeof Re>"u")&&(Re=Ae()),Ce=q[Ge]&&q[Ge][Re]),typeof Ce>"u"||!Ce.length||!Ce[0]){var Je="";Ve=[];for(ye in q[Ge])this.terminals_[ye]&&ye>ie&&Ve.push("'"+this.terminals_[ye]+"'");te.showPosition?Je="Parse error on line "+(X+1)+`: -`+te.showPosition()+` -Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Re]||Re)+"'":Je="Parse error on line "+(X+1)+": Unexpected "+(Re==K?"end of input":"'"+(this.terminals_[Re]||Re)+"'"),this.parseError(Je,{text:te.match,token:this.terminals_[Re]||Re,line:te.yylineno,loc:ne,expected:Ve})}if(Ce[0]instanceof Array&&Ce.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ge+", token: "+Re);switch(Ce[0]){case 1:I.push(Re),P.push(te.yytext),B.push(te.yylloc),I.push(Ce[1]),Re=null,W=te.yyleng,V=te.yytext,X=te.yylineno,ne=te.yylloc;break;case 2:if(He=this.productions_[Ce[1]][1],Fe.$=P[P.length-He],Fe._$={first_line:B[B.length-(He||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(He||1)].first_column,last_column:B[B.length-1].last_column},oe&&(Fe._$.range=[B[B.length-(He||1)].range[0],B[B.length-1].range[1]]),be=this.performAction.apply(Fe,[V,W,X,Z.yy,Ce[1],P,B].concat(se)),typeof be<"u")return be;He&&(I=I.slice(0,-1*He*2),P=P.slice(0,-1*He),B=B.slice(0,-1*He)),I.push(this.productions_[Ce[1]][0]),P.push(Fe.$),B.push(Fe._$),xe=q[I[I.length-2]][I[I.length-1]],I.push(xe);break;case 3:return!0}}return!0},"parse")},F=(function(){var R={EOF:1,parseError:T(function(M,I){if(this.yy.parser)this.yy.parser.parseError(M,I);else throw new Error(M)},"parseError"),setInput:T(function(N,M){return this.yy=M||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var M=N.match(/(?:\r\n?|\n).*/g);return M?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:T(function(N){var M=N.length,I=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-M),this.offset-=M;var $=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),I.length-1&&(this.yylineno-=I.length-1);var P=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===$.length?this.yylloc.first_column:0)+$[$.length-I.length].length-I[0].length:this.yylloc.first_column-M},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-M]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(N){this.unput(this.match.slice(N))},"less"),pastInput:T(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var N=this.pastInput(),M=new Array(N.length+1).join("-");return N+this.upcomingInput()+` -`+M+"^"},"showPosition"),test_match:T(function(N,M){var I,$,P;if(this.options.backtrack_lexer&&(P={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(P.yylloc.range=this.yylloc.range.slice(0))),$=N[0].match(/(?:\r\n?|\n).*/g),$&&(this.yylineno+=$.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:$?$[$.length-1].length-$[$.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(N[0].length),this.matched+=N[0],I=this.performAction.call(this,this.yy,this,M,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),I)return I;if(this._backtrack){for(var B in P)this[B]=P[B];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,M,I,$;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),B=0;BM[0].length)){if(M=I,$=B,this.options.backtrack_lexer){if(N=this.test_match(I,P[B]),N!==!1)return N;if(this._backtrack){M=!1;continue}else return!1}else if(!this.options.flex)break}return M?(N=this.test_match(M,P[$]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var M=this.next();return M||this.lex()},"lex"),begin:T(function(M){this.conditionStack.push(M)},"begin"),popState:T(function(){var M=this.conditionStack.length-1;return M>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(M){return M=this.conditionStack.length-1-Math.abs(M||0),M>=0?this.conditionStack[M]:"INITIAL"},"topState"),pushState:T(function(M){this.begin(M)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(M,I,$,P){switch($){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R})();z.lexer=F;function A(){this.yy={}}return T(A,"Parser"),A.prototype=z,z.Parser=A,new A})();y$.parser=y$;var Llt=y$;function v$(t){return t.type==="bar"}T(v$,"isBarPlot");function b$(t){return t.type==="band"}T(b$,"isBandAxisData");function rm(t){return t.type==="linear"}T(rm,"isLinearAxisData");var Gge=(Dv=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=oW(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},T(Dv,"TextDimensionCalculatorWithFont"),Dv),qge=.7,Vge=.2,Wge=(Mv=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){qge*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(qge*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Vge*e.width;this.outerPadding=Math.min(n.width/2,i);const a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Vge*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},T(Mv,"BaseAxis"),Mv),Ilt=(Nv=class extends Wge{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=TA().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=TA().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ae.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},T(Nv,"BandAxis"),Nv),Dlt=(Ov=class extends Wge{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Np().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Np().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},T(Ov,"LinearAxis"),Ov);function x$(t,e,r,n){const i=new Gge(n);return b$(t)?new Ilt(e,r,t.categories,t.title,i):new Dlt(e,r,[t.min,t.max],t.title,i)}T(x$,"getAxis");var Mlt=($v=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},T($v,"ChartTitle"),$v);function Uge(t,e,r,n){const i=new Gge(n);return new Mlt(i,t,e,r)}T(Uge,"getChartTitleComponent");var Nlt=(Pv=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let r;return this.orientation==="horizontal"?r=$2().y(n=>n[0]).x(n=>n[1])(e):r=$2().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},T(Pv,"LinePlot"),Pv),Olt=(Bv=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},T(Bv,"BarPlot"),Bv),$lt=(Fv=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Nlt(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Olt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},T(Fv,"BasePlot"),Fv);function Hge(t,e,r){return new $lt(t,e,r)}T(Hge,"getPlotComponent");var Plt=(zv=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Uge(e,r,n,i),plot:Hge(e,r,n),xAxis:x$(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:x$(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>v$(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>v$(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},T(zv,"Orchestrator"),zv),Blt=(Gv=class{static build(e,r,n,i){return new Plt(e,r,n,i).getDrawableElement()}},T(Gv,"XYChartBuilder"),Gv),KT=0,Yge,jT=k$(),ZT=C$(),fn=E$(),T$=ZT.plotColorPalette.split(",").map(t=>t.trim()),AS=!1,w$=!1;function C$(){const t=kp(),e=lr();return ti(t.xyChart,e.themeVariables.xyChart)}T(C$,"getChartDefaultThemeConfig");function k$(){const t=lr();return ti(Fr.xyChart,t.xyChart)}T(k$,"getChartDefaultConfig");function E$(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}T(E$,"getChartDefaultData");function _S(t){const e=lr();return qr(t.trim(),e)}T(_S,"textSanitizer");function Xge(t){Yge=t}T(Xge,"setTmpSVGG");function Kge(t){t==="horizontal"?jT.chartOrientation="horizontal":jT.chartOrientation="vertical"}T(Kge,"setOrientation");function jge(t){fn.xAxis.title=_S(t.text)}T(jge,"setXAxisTitle");function S$(t,e){fn.xAxis={type:"linear",title:fn.xAxis.title,min:t,max:e},AS=!0}T(S$,"setXAxisRangeData");function Zge(t){fn.xAxis={type:"band",title:fn.xAxis.title,categories:t.map(e=>_S(e.text))},AS=!0}T(Zge,"setXAxisBand");function Qge(t){fn.yAxis.title=_S(t.text)}T(Qge,"setYAxisTitle");function Jge(t,e){fn.yAxis={type:"linear",title:fn.yAxis.title,min:t,max:e},w$=!0}T(Jge,"setYAxisRangeData");function eme(t){const e=Math.min(...t),r=Math.max(...t),n=rm(fn.yAxis)?fn.yAxis.min:1/0,i=rm(fn.yAxis)?fn.yAxis.max:-1/0;fn.yAxis={type:"linear",title:fn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}T(eme,"setYAxisRangeFromPlotData");function A$(t){let e=[];if(t.length===0)return e;if(!AS){const r=rm(fn.xAxis)?fn.xAxis.min:1/0,n=rm(fn.xAxis)?fn.xAxis.max:-1/0;S$(Math.min(r,1),Math.max(n,t.length))}if(w$||eme(t),b$(fn.xAxis)&&(e=fn.xAxis.categories.map((r,n)=>[r,t[n]])),rm(fn.xAxis)){const r=fn.xAxis.min,n=fn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}T(A$,"transformDataWithoutCategory");function _$(t){return T$[t===0?0:t%T$.length]}T(_$,"getPlotColorFromPalette");function tme(t,e){const r=A$(e);fn.plots.push({type:"line",strokeFill:_$(KT),strokeWidth:2,data:r}),KT++}T(tme,"setLineData");function rme(t,e){const r=A$(e);fn.plots.push({type:"bar",fill:_$(KT),data:r}),KT++}T(rme,"setBarData");function nme(){if(fn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return fn.title=Nn(),Blt.build(jT,fn,ZT,Yge)}T(nme,"getDrawableElem");function ime(){return ZT}T(ime,"getChartThemeConfig");function ame(){return jT}T(ame,"getChartConfig");function sme(){return fn}T(sme,"getXYChartData");var Flt=T(function(){Dn(),KT=0,jT=k$(),fn=E$(),ZT=C$(),T$=ZT.plotColorPalette.split(",").map(t=>t.trim()),AS=!1,w$=!1},"clear"),zlt={getDrawableElem:nme,clear:Flt,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,getAccDescription:Vn,setAccDescription:qn,setOrientation:Kge,setXAxisTitle:jge,setXAxisRangeData:S$,setXAxisBand:Zge,setYAxisTitle:Qge,setYAxisRangeData:Jge,setLineData:tme,setBarData:rme,setTmpSVGG:Xge,getChartThemeConfig:ime,getChartConfig:ame,getXYChartData:sme},Glt=T((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}T(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}T(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}T(h,"getTextTransformation"),ae.debug(`Rendering xychart chart -`+t);const d=ms(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");vi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let x=f,b="";for(const[w]of v.entries()){let k=f;w>0&&m[b]&&(k=m[b]),b+=v[w],x=m[b],x||(x=m[b]=k.append("g").attr("class",v[w]))}return x}T(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(D,z){const{data:F,label:A}=D;return z*A.length*k<=F.width-S};T(w,"fitsHorizontally");const k=.7,S=10,C=v.data.map((D,z)=>({data:D,label:o[z].toString()})).filter(D=>D.data.width>0&&D.data.height>0),_=C.map(D=>{const{data:z}=D;let F=z.height*.7;for(;!w(D,F)&&F>0;)F-=1;return F}),L=Math.floor(Math.min(..._)),O=T(D=>b?D.data.x+D.data.width+S:D.data.x+D.data.width-S,"determineLabelXPosition");x.selectAll("text").data(C).enter().append("text").attr("x",O).attr("y",D=>D.data.y+D.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(D=>D.label)}else{let w=function(O,D,z){const{data:F,label:A}=O,N=D*A.length*.7,M=F.x+F.width/2,I=M-N/2,$=M+N/2,P=I>=F.x&&$<=F.x+F.width,B=F.y+z+D<=F.y+F.height;return P&&B};T(w,"fitsInBar");const k=10,S=v.data.map((O,D)=>({data:O,label:o[D].toString()})).filter(O=>O.data.width>0&&O.data.height>0),C=S.map(O=>{const{data:D,label:z}=O;let F=D.width/(z.length*.7);for(;!w(O,F,k)&&F>0;)F-=1;return F}),_=Math.floor(Math.min(...C)),L=T(O=>b?O.data.y-k:O.data.y+k,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",O=>O.data.x+O.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(O=>O.label)}}break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),qlt={draw:Glt},Vlt={parser:Llt,db:zlt,renderer:qlt};const Wlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vlt},Symbol.toStringTag,{value:"Module"}));var R$=(function(){var t=T(function(Ee,Se,Y,ce){for(Y=Y||{},ce=Ee.length;ce--;Y[Ee[ce]]=Se);return Y},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],w=[1,32],k=[1,30],S=[1,39],C=[1,40],_=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],O=[89,90],D=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],z=[27,29],F=[1,70],A=[1,71],R=[1,72],N=[1,73],M=[1,74],I=[1,75],$=[1,76],P=[1,83],B=[1,80],q=[1,84],V=[1,85],X=[1,86],W=[1,87],ie=[1,88],K=[1,89],se=[1,90],te=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ne=[63,64],oe=[1,101],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Ae=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Re=[1,110],Ge=[1,106],Ce=[1,107],be=[1,108],Fe=[1,109],ye=[1,111],He=[1,116],xe=[1,117],Ve=[1,114],Je=[1,115],nt={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:T(function(Se,Y,ce,j,pe,re,Pe){var ve=re.length-1;switch(pe){case 4:this.$=re[ve].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=re[ve].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(re[ve-3],re[ve-4]);break;case 22:j.addRequirement(re[ve-5],re[ve-6]),j.setClass([re[ve-5]],re[ve-3]);break;case 23:j.setNewReqId(re[ve-2]);break;case 24:j.setNewReqText(re[ve-2]);break;case 25:j.setNewReqRisk(re[ve-2]);break;case 26:j.setNewReqVerifyMethod(re[ve-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(re[ve-3]);break;case 43:j.addElement(re[ve-5]),j.setClass([re[ve-5]],re[ve-3]);break;case 44:j.setNewElementType(re[ve-2]);break;case 45:j.setNewElementDocRef(re[ve-2]);break;case 48:j.addRelationship(re[ve-2],re[ve],re[ve-4]);break;case 49:j.addRelationship(re[ve-2],re[ve-4],re[ve]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=re[ve-2],j.defineClass(re[ve-1],re[ve]);break;case 58:j.setClass(re[ve-1],re[ve]);break;case 59:j.setClass([re[ve-2]],re[ve]);break;case 60:case 62:this.$=[re[ve]];break;case 61:case 63:this.$=re[ve-2].concat([re[ve]]);break;case 64:this.$=re[ve-2],j.setCssStyle(re[ve-1],re[ve]);break;case 65:this.$=[re[ve]];break;case 66:re[ve-2].push(re[ve]),this.$=re[ve-2];break;case 68:this.$=re[ve-1]+re[ve];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(_,[2,17]),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),{30:60,33:62,75:L,89:S,90:C},{30:63,33:62,75:L,89:S,90:C},{30:64,33:62,75:L,89:S,90:C},t(O,[2,29]),t(O,[2,30]),t(O,[2,31]),t(O,[2,32]),t(O,[2,33]),t(O,[2,34]),t(D,[2,81]),t(D,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(z,[2,79]),t(z,[2,80]),{27:[1,67],29:[1,68]},t(z,[2,85]),t(z,[2,86]),{62:69,65:F,66:A,67:R,68:N,69:M,70:I,71:$},{62:77,65:F,66:A,67:R,68:N,69:M,70:I,71:$},{30:78,33:62,75:L,89:S,90:C},{73:79,75:P,76:B,78:81,79:82,80:q,81:V,82:X,83:W,84:ie,85:K,86:se,87:te,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:P,76:B,78:81,79:82,80:q,81:V,82:X,83:W,84:ie,85:K,86:se,87:te,88:Z},{30:94,33:62,75:L,76:B,89:S,90:C},{5:[1,95]},{30:96,33:62,75:L,89:S,90:C},{5:[1,97]},{30:98,33:62,75:L,89:S,90:C},{63:[1,99]},t(ne,[2,50]),t(ne,[2,51]),t(ne,[2,52]),t(ne,[2,53]),t(ne,[2,54]),t(ne,[2,55]),t(ne,[2,56]),{64:[1,100]},t(_,[2,59],{76:B}),t(_,[2,64],{76:oe}),{33:103,75:[1,102],89:S,90:C},t(fe,[2,65],{79:104,75:P,80:q,81:V,82:X,83:W,84:ie,85:K,86:se,87:te,88:Z}),t(Ae,[2,67]),t(Ae,[2,69]),t(Ae,[2,70]),t(Ae,[2,71]),t(Ae,[2,72]),t(Ae,[2,73]),t(Ae,[2,74]),t(Ae,[2,75]),t(Ae,[2,76]),t(Ae,[2,77]),t(Ae,[2,78]),t(_,[2,57],{76:oe}),t(_,[2,58],{76:B}),{5:Re,28:105,31:Ge,34:Ce,36:be,38:Fe,40:ye},{27:[1,112],76:B},{5:He,40:xe,56:113,57:Ve,59:Je},{27:[1,118],76:B},{33:119,89:S,90:C},{33:120,89:S,90:C},{75:P,78:121,79:82,80:q,81:V,82:X,83:W,84:ie,85:K,86:se,87:te,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(Ae,[2,68]),t(_,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Re,28:126,31:Ge,34:Ce,36:be,38:Fe,40:ye},t(_,[2,28]),{5:[1,127]},t(_,[2,42]),{32:[1,128]},{32:[1,129]},{5:He,40:xe,56:130,57:Ve,59:Je},t(_,[2,47]),{5:[1,131]},t(_,[2,48]),t(_,[2,49]),t(fe,[2,66],{79:104,75:P,80:q,81:V,82:X,83:W,84:ie,85:K,86:se,87:te,88:Z}),{33:132,89:S,90:C},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(_,[2,27]),{5:Re,28:145,31:Ge,34:Ce,36:be,38:Fe,40:ye},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(_,[2,46]),{5:He,40:xe,56:152,57:Ve,59:Je},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(_,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(_,[2,43]),{5:Re,28:159,31:Ge,34:Ce,36:be,38:Fe,40:ye},{5:Re,28:160,31:Ge,34:Ce,36:be,38:Fe,40:ye},{5:Re,28:161,31:Ge,34:Ce,36:be,38:Fe,40:ye},{5:Re,28:162,31:Ge,34:Ce,36:be,38:Fe,40:ye},{5:He,40:xe,56:163,57:Ve,59:Je},{5:He,40:xe,56:164,57:Ve,59:Je},t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,44]),t(_,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:T(function(Se,Y){if(Y.recoverable)this.trace(Se);else{var ce=new Error(Se);throw ce.hash=Y,ce}},"parseError"),parse:T(function(Se){var Y=this,ce=[0],j=[],pe=[null],re=[],Pe=this.table,ve="",Ue=0,Me=0,qe=2,Le=1,Ke=re.slice.call(arguments,1),De=Object.create(this.lexer),it={yy:{}};for(var Te in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Te)&&(it.yy[Te]=this.yy[Te]);De.setInput(Se,it.yy),it.yy.lexer=De,it.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var ct=De.yylloc;re.push(ct);var we=De.options&&De.options.ranges;typeof it.yy.parseError=="function"?this.parseError=it.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(me){ce.length=ce.length-2*me,pe.length=pe.length-me,re.length=re.length-me}T(Et,"popStack");function yt(){var me;return me=j.pop()||De.lex()||Le,typeof me!="number"&&(me instanceof Array&&(j=me,me=j.pop()),me=Y.symbols_[me]||me),me}T(yt,"lex");for(var ot,Dt,vt,ut,le={},At,dt,ht,St;;){if(Dt=ce[ce.length-1],this.defaultActions[Dt]?vt=this.defaultActions[Dt]:((ot===null||typeof ot>"u")&&(ot=yt()),vt=Pe[Dt]&&Pe[Dt][ot]),typeof vt>"u"||!vt.length||!vt[0]){var Nr="";St=[];for(At in Pe[Dt])this.terminals_[At]&&At>qe&&St.push("'"+this.terminals_[At]+"'");De.showPosition?Nr="Parse error on line "+(Ue+1)+`: -`+De.showPosition()+` -Expecting `+St.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Nr="Parse error on line "+(Ue+1)+": Unexpected "+(ot==Le?"end of input":"'"+(this.terminals_[ot]||ot)+"'"),this.parseError(Nr,{text:De.match,token:this.terminals_[ot]||ot,line:De.yylineno,loc:ct,expected:St})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Dt+", token: "+ot);switch(vt[0]){case 1:ce.push(ot),pe.push(De.yytext),re.push(De.yylloc),ce.push(vt[1]),ot=null,Me=De.yyleng,ve=De.yytext,Ue=De.yylineno,ct=De.yylloc;break;case 2:if(dt=this.productions_[vt[1]][1],le.$=pe[pe.length-dt],le._$={first_line:re[re.length-(dt||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(dt||1)].first_column,last_column:re[re.length-1].last_column},we&&(le._$.range=[re[re.length-(dt||1)].range[0],re[re.length-1].range[1]]),ut=this.performAction.apply(le,[ve,Me,Ue,it.yy,vt[1],pe,re].concat(Ke)),typeof ut<"u")return ut;dt&&(ce=ce.slice(0,-1*dt*2),pe=pe.slice(0,-1*dt),re=re.slice(0,-1*dt)),ce.push(this.productions_[vt[1]][0]),pe.push(le.$),re.push(le._$),ht=Pe[ce[ce.length-2]][ce[ce.length-1]],ce.push(ht);break;case 3:return!0}}return!0},"parse")},tt=(function(){var Ee={EOF:1,parseError:T(function(Y,ce){if(this.yy.parser)this.yy.parser.parseError(Y,ce);else throw new Error(Y)},"parseError"),setInput:T(function(Se,Y){return this.yy=Y||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var Y=Se.match(/(?:\r\n?|\n).*/g);return Y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:T(function(Se){var Y=Se.length,ce=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Y),this.offset-=Y;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var pe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===j.length?this.yylloc.first_column:0)+j[j.length-ce.length].length-ce[0].length:this.yylloc.first_column-Y},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-Y]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:T(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Se=this.pastInput(),Y=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+` -`+Y+"^"},"showPosition"),test_match:T(function(Se,Y){var ce,j,pe;if(this.options.backtrack_lexer&&(pe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pe.yylloc.range=this.yylloc.range.slice(0))),j=Se[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],ce=this.performAction.call(this,this.yy,this,Y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var re in pe)this[re]=pe[re];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,Y,ce,j;this._more||(this.yytext="",this.match="");for(var pe=this._currentRules(),re=0;reY[0].length)){if(Y=ce,j=re,this.options.backtrack_lexer){if(Se=this.test_match(ce,pe[re]),Se!==!1)return Se;if(this._backtrack){Y=!1;continue}else return!1}else if(!this.options.flex)break}return Y?(Se=this.test_match(Y,pe[j]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Y=this.next();return Y||this.lex()},"lex"),begin:T(function(Y){this.conditionStack.push(Y)},"begin"),popState:T(function(){var Y=this.conditionStack.length-1;return Y>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Y){return Y=this.conditionStack.length-1-Math.abs(Y||0),Y>=0?this.conditionStack[Y]:"INITIAL"},"topState"),pushState:T(function(Y){this.begin(Y)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Y,ce,j,pe){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return ce.yytext=ce.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return Ee})();nt.lexer=tt;function Ze(){this.yy={}}return T(Ze,"Parser"),Ze.prototype=nt,nt.Parser=Ze,new Ze})();R$.parser=R$;var Ult=R$,Hlt=(qv=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Mn,this.getAccTitle=Gn,this.setAccDescription=qn,this.getAccDescription=Vn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getConfig=T(()=>$e().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ae.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Dn()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=$e(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},T(qv,"RequirementDB"),qv),Ylt=T(t=>{const e=lr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return k_e().value(i=>i.value).sort(null)(r)},"createPieArcs"),vpt=b((t,e,r,n)=>{var Y;he.debug(`rendering pie chart +`+t);const i=n.db,a=Ve(),s=ri(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=Ka(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Zc(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,T=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,x=Math.min(d,h)/2-o,w=S0().innerRadius(T*x).outerRadius(x),C=S0().innerRadius(x*v).outerRadius(x*v),k=p.append("g");k.append("circle").attr("cx",0).attr("cy",0).attr("r",x+m/2).attr("class","pieOuterCircle");const S=i.getSections(),E=ypt(S),L=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let M=0;S.forEach(se=>{M+=se});const I=E.filter(se=>(se.data.value/M*100).toFixed(0)!=="0"),P=Pd(L).domain([...S.keys()]);k.selectAll("mySlices").data(I).enter().append("path").attr("d",w).attr("fill",se=>P(se.data.label)).attr("class",se=>{let J="pieCircle";return s.highlightSlice==="hover"?J+=" highlightedOnHover":s.highlightSlice===se.data.label&&(J+=" highlighted"),J}),k.selectAll("mySlices").data(I).enter().append("text").text(se=>(se.data.value/M*100).toFixed(0)+"%").attr("transform",se=>"translate("+C.centroid(se)+")").style("text-anchor","middle").attr("class","slice");const $=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),_=[...S.entries()].map(([se,J])=>({label:se,value:J})),R=p.selectAll(".legend").data(_).enter().append("g").attr("class","legend");R.append("rect").attr("width",l).attr("height",l).style("fill",se=>P(se.label)).style("stroke",se=>P(se.label)),R.append("text").attr("x",l+u).attr("y",l-u).text(se=>i.getShowData()?`${se.label} [${se.value}]`:se.label);const O=Math.max(...R.selectAll("text").nodes().map(se=>(se==null?void 0:se.getBoundingClientRect().width)??0));let D=h,N=d+o;const B=l+u,F=_.length*B;switch(y){case"center":R.attr("transform",(se,J)=>{const Z=B*_.length/2,ee=-O/2-(l+u),re=J*B-Z;return"translate("+ee+","+re+")"});break;case"top":D+=F,R.attr("transform",(se,J)=>{const Z=x,ee=-O/2-(l+u),re=J*B-Z;return`translate(${ee}, ${re})`}),k.attr("transform",()=>`translate(0, ${F+B})`);break;case"bottom":D+=F,R.attr("transform",(se,J)=>{const Z=-x-B,ee=-O/2-(l+u),re=J*B-Z;return"translate("+ee+","+re+")"});break;case"left":N+=l+u+O,R.attr("transform",(se,J)=>{const Z=B*_.length/2,ee=-x-(l+u),re=J*B-Z;return"translate("+ee+","+re+")"}),k.attr("transform",()=>`translate(${O+l+u}, 0)`);break;case"right":default:N+=l+u+O,R.attr("transform",(se,J)=>{const Z=B*_.length/2,ee=12*l,re=J*B-Z;return"translate("+ee+","+re+")"});break}const G=((Y=$.node())==null?void 0:Y.getBoundingClientRect().width)??0,z=d/2-G/2,W=d/2+G/2,V=Math.min(0,z),te=Math.max(N,W)-V;f.attr("viewBox",`${V} 0 ${te} ${D}`),bi(f,D,te,s.useMaxWidth)},"draw"),bpt={draw:vpt},xpt={parser:ppt,db:d2e,renderer:bpt,styles:mpt};const Tpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:xpt},Symbol.toStringTag,{value:"Module"}));var QB=(function(){var t=b(function(Q,fe,j,Be){for(j=j||{},Be=Q.length;Be--;j[Q[Be]]=fe);return j},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],x=[1,18],w=[1,19],C=[1,20],k=[1,21],S=[1,22],E=[1,24],L=[1,25],M=[1,26],I=[1,27],P=[1,28],$=[1,29],_=[1,32],R=[1,33],O=[1,34],D=[1,39],N=[1,40],B=[1,42],F=[1,44],G=[1,63],z=[1,62],W=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],V=[1,66],H=[1,67],te=[1,68],Y=[1,69],se=[1,70],J=[1,71],Z=[1,72],ee=[1,73],re=[1,74],ge=[1,75],ae=[1,76],_e=[1,77],Fe=[4,5,6,7,8,9,10,11,12,13,14,15,18],qe=[1,91],ue=[1,92],de=[1,93],Ce=[1,100],me=[1,94],$e=[1,97],we=[1,95],Le=[1,96],Ye=[1,98],ce=[1,99],ye=[1,103],ke=[10,55,56,57],le=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],pe={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:b(function(fe,j,Be,Se,He,De,We){var Ne=De.length-1;switch(He){case 23:this.$=De[Ne];break;case 24:this.$=De[Ne-1]+""+De[Ne];break;case 26:this.$=De[Ne-1]+De[Ne];break;case 27:this.$=[De[Ne].trim()];break;case 28:De[Ne-2].push(De[Ne].trim()),this.$=De[Ne-2];break;case 29:this.$=De[Ne-4],Se.addClass(De[Ne-2],De[Ne]);break;case 37:this.$=[];break;case 42:this.$=De[Ne].trim(),Se.setDiagramTitle(this.$);break;case 43:this.$=De[Ne].trim(),Se.setAccTitle(this.$);break;case 44:case 45:this.$=De[Ne].trim(),Se.setAccDescription(this.$);break;case 46:Se.addSection(De[Ne].substr(8)),this.$=De[Ne].substr(8);break;case 47:Se.addPoint(De[Ne-3],"",De[Ne-1],De[Ne],[]);break;case 48:Se.addPoint(De[Ne-4],De[Ne-3],De[Ne-1],De[Ne],[]);break;case 49:Se.addPoint(De[Ne-4],"",De[Ne-2],De[Ne-1],De[Ne]);break;case 50:Se.addPoint(De[Ne-5],De[Ne-4],De[Ne-2],De[Ne-1],De[Ne]);break;case 51:Se.setXAxisLeftText(De[Ne-2]),Se.setXAxisRightText(De[Ne]);break;case 52:De[Ne-1].text+=" ⟶ ",Se.setXAxisLeftText(De[Ne-1]);break;case 53:Se.setXAxisLeftText(De[Ne]);break;case 54:Se.setYAxisBottomText(De[Ne-2]),Se.setYAxisTopText(De[Ne]);break;case 55:De[Ne-1].text+=" ⟶ ",Se.setYAxisBottomText(De[Ne-1]);break;case 56:Se.setYAxisBottomText(De[Ne]);break;case 57:Se.setQuadrant1Text(De[Ne]);break;case 58:Se.setQuadrant2Text(De[Ne]);break;case 59:Se.setQuadrant3Text(De[Ne]);break;case 60:Se.setQuadrant4Text(De[Ne]);break;case 64:this.$={text:De[Ne],type:"text"};break;case 65:this.$={text:De[Ne-1].text+""+De[Ne],type:De[Ne-1].type};break;case 66:this.$={text:De[Ne],type:"text"};break;case 67:this.$={text:De[Ne],type:"markdown"};break;case 68:this.$=De[Ne];break;case 69:this.$=De[Ne-1]+""+De[Ne];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:x,37:w,39:C,41:k,42:S,48:E,50:L,51:M,52:I,53:P,54:$,60:_,61:R,63:O,64:D,65:N,66:B,67:F}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:x,37:w,39:C,41:k,42:S,48:E,50:L,51:M,52:I,53:P,54:$,60:_,61:R,63:O,64:D,65:N,66:B,67:F}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:_,61:R,63:O,64:D,65:N,66:B,67:F},{4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,44:[1,58],47:[1,59],58:61,59:60,63:O,64:D,65:N,66:B,67:F},t(W,[2,64]),t(W,[2,66]),t(W,[2,67]),t(W,[2,70]),t(W,[2,71]),t(W,[2,72]),t(W,[2,73]),t(W,[2,74]),t(W,[2,75]),t(W,[2,76]),t(W,[2,77]),t(W,[2,78]),t(W,[2,79]),t(W,[2,80]),t(W,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:V,5:H,6:te,7:Y,8:se,9:J,10:Z,11:ee,12:re,13:ge,14:ae,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,49:[1,78],63:O,64:D,65:N,66:B,67:F}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,49:[1,79],63:O,64:D,65:N,66:B,67:F}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),{45:[1,80]},{44:[1,81]},t(W,[2,65]),t(W,[2,82]),t(W,[2,83]),t(W,[2,84]),{3:83,4:V,5:H,6:te,7:Y,8:se,9:J,10:Z,11:ee,12:re,13:ge,14:ae,15:_e,18:[1,82]},t(Fe,[2,23]),t(Fe,[2,1]),t(Fe,[2,2]),t(Fe,[2,3]),t(Fe,[2,4]),t(Fe,[2,5]),t(Fe,[2,6]),t(Fe,[2,7]),t(Fe,[2,8]),t(Fe,[2,9]),t(Fe,[2,10]),t(Fe,[2,11]),t(Fe,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:_,61:R,63:O,64:D,65:N,66:B,67:F}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:_,61:R,63:O,64:D,65:N,66:B,67:F}),{46:[1,86]},{45:[1,87]},{4:qe,5:ue,6:de,8:Ce,11:me,13:$e,16:90,17:we,18:Le,19:Ye,20:ce,22:89,23:88},t(Fe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:G,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:D,65:N,66:B,67:F}),t(l,[2,47],{22:89,16:90,23:101,4:qe,5:ue,6:de,8:Ce,11:me,13:$e,17:we,18:Le,19:Ye,20:ce}),{46:[1,102]},t(l,[2,29],{10:ye}),t(ke,[2,27],{16:104,4:qe,5:ue,6:de,8:Ce,11:me,13:$e,17:we,18:Le,19:Ye,20:ce}),t(le,[2,25]),t(le,[2,13]),t(le,[2,14]),t(le,[2,15]),t(le,[2,16]),t(le,[2,17]),t(le,[2,18]),t(le,[2,19]),t(le,[2,20]),t(le,[2,21]),t(le,[2,22]),t(l,[2,49],{10:ye}),t(l,[2,48],{22:89,16:90,23:105,4:qe,5:ue,6:de,8:Ce,11:me,13:$e,17:we,18:Le,19:Ye,20:ce}),{4:qe,5:ue,6:de,8:Ce,11:me,13:$e,16:90,17:we,18:Le,19:Ye,20:ce,22:106},t(le,[2,26]),t(l,[2,50],{10:ye}),t(ke,[2,28],{16:104,4:qe,5:ue,6:de,8:Ce,11:me,13:$e,17:we,18:Le,19:Ye,20:ce})],defaultActions:{8:[2,30],9:[2,31]},parseError:b(function(fe,j){if(j.recoverable)this.trace(fe);else{var Be=new Error(fe);throw Be.hash=j,Be}},"parseError"),parse:b(function(fe){var j=this,Be=[0],Se=[],He=[null],De=[],We=this.table,Ne="",Ze=0,Pe=0,nt=2,Ie=1,pt=De.slice.call(arguments,1),Re=Object.create(this.lexer),kt={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&(kt.yy[bt]=this.yy[bt]);Re.setInput(fe,kt.yy),kt.yy.lexer=Re,kt.yy.parser=this,typeof Re.yylloc>"u"&&(Re.yylloc={});var lt=Re.yylloc;De.push(lt);var Nt=Re.options&&Re.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(Wt){Be.length=Be.length-2*Wt,He.length=He.length-Wt,De.length=De.length-Wt}b(Ct,"popStack");function dt(){var Wt;return Wt=Se.pop()||Re.lex()||Ie,typeof Wt!="number"&&(Wt instanceof Array&&(Se=Wt,Wt=Se.pop()),Wt=j.symbols_[Wt]||Wt),Wt}b(dt,"lex");for(var ve,_t,gt,ft,Et={},Nr,Ae,tt,ct;;){if(_t=Be[Be.length-1],this.defaultActions[_t]?gt=this.defaultActions[_t]:((ve===null||typeof ve>"u")&&(ve=dt()),gt=We[_t]&&We[_t][ve]),typeof gt>"u"||!gt.length||!gt[0]){var Mt="";ct=[];for(Nr in We[_t])this.terminals_[Nr]&&Nr>nt&&ct.push("'"+this.terminals_[Nr]+"'");Re.showPosition?Mt="Parse error on line "+(Ze+1)+`: +`+Re.showPosition()+` +Expecting `+ct.join(", ")+", got '"+(this.terminals_[ve]||ve)+"'":Mt="Parse error on line "+(Ze+1)+": Unexpected "+(ve==Ie?"end of input":"'"+(this.terminals_[ve]||ve)+"'"),this.parseError(Mt,{text:Re.match,token:this.terminals_[ve]||ve,line:Re.yylineno,loc:lt,expected:ct})}if(gt[0]instanceof Array&>.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_t+", token: "+ve);switch(gt[0]){case 1:Be.push(ve),He.push(Re.yytext),De.push(Re.yylloc),Be.push(gt[1]),ve=null,Pe=Re.yyleng,Ne=Re.yytext,Ze=Re.yylineno,lt=Re.yylloc;break;case 2:if(Ae=this.productions_[gt[1]][1],Et.$=He[He.length-Ae],Et._$={first_line:De[De.length-(Ae||1)].first_line,last_line:De[De.length-1].last_line,first_column:De[De.length-(Ae||1)].first_column,last_column:De[De.length-1].last_column},Nt&&(Et._$.range=[De[De.length-(Ae||1)].range[0],De[De.length-1].range[1]]),ft=this.performAction.apply(Et,[Ne,Pe,Ze,kt.yy,gt[1],He,De].concat(pt)),typeof ft<"u")return ft;Ae&&(Be=Be.slice(0,-1*Ae*2),He=He.slice(0,-1*Ae),De=De.slice(0,-1*Ae)),Be.push(this.productions_[gt[1]][0]),He.push(Et.$),De.push(Et._$),tt=We[Be[Be.length-2]][Be[Be.length-1]],Be.push(tt);break;case 3:return!0}}return!0},"parse")},U=(function(){var Q={EOF:1,parseError:b(function(j,Be){if(this.yy.parser)this.yy.parser.parseError(j,Be);else throw new Error(j)},"parseError"),setInput:b(function(fe,j){return this.yy=j||this.yy||{},this._input=fe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var fe=this._input[0];this.yytext+=fe,this.yyleng++,this.offset++,this.match+=fe,this.matched+=fe;var j=fe.match(/(?:\r\n?|\n).*/g);return j?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),fe},"input"),unput:b(function(fe){var j=fe.length,Be=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j),this.offset-=j;var Se=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Be.length-1&&(this.yylineno-=Be.length-1);var He=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Be?(Be.length===Se.length?this.yylloc.first_column:0)+Se[Se.length-Be.length].length-Be[0].length:this.yylloc.first_column-j},this.options.ranges&&(this.yylloc.range=[He[0],He[0]+this.yyleng-j]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(fe){this.unput(this.match.slice(fe))},"less"),pastInput:b(function(){var fe=this.matched.substr(0,this.matched.length-this.match.length);return(fe.length>20?"...":"")+fe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var fe=this.match;return fe.length<20&&(fe+=this._input.substr(0,20-fe.length)),(fe.substr(0,20)+(fe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var fe=this.pastInput(),j=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+` +`+j+"^"},"showPosition"),test_match:b(function(fe,j){var Be,Se,He;if(this.options.backtrack_lexer&&(He={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(He.yylloc.range=this.yylloc.range.slice(0))),Se=fe[0].match(/(?:\r\n?|\n).*/g),Se&&(this.yylineno+=Se.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Se?Se[Se.length-1].length-Se[Se.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+fe[0].length},this.yytext+=fe[0],this.match+=fe[0],this.matches=fe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(fe[0].length),this.matched+=fe[0],Be=this.performAction.call(this,this.yy,this,j,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Be)return Be;if(this._backtrack){for(var De in He)this[De]=He[De];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,j,Be,Se;this._more||(this.yytext="",this.match="");for(var He=this._currentRules(),De=0;Dej[0].length)){if(j=Be,Se=De,this.options.backtrack_lexer){if(fe=this.test_match(Be,He[De]),fe!==!1)return fe;if(this._backtrack){j=!1;continue}else return!1}else if(!this.options.flex)break}return j?(fe=this.test_match(j,He[Se]),fe!==!1?fe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var j=this.next();return j||this.lex()},"lex"),begin:b(function(j){this.conditionStack.push(j)},"begin"),popState:b(function(){var j=this.conditionStack.length-1;return j>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(j){return j=this.conditionStack.length-1-Math.abs(j||0),j>=0?this.conditionStack[j]:"INITIAL"},"topState"),pushState:b(function(j){this.begin(j)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(j,Be,Se,He){switch(Se){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Q})();pe.lexer=U;function oe(){this.yy={}}return b(oe,"Parser"),oe.prototype=pe,pe.Parser=oe,new oe})();QB.parser=QB;var wpt=QB,Os=Gc(),Cpt=(k2=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=jr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=jr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=jr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=jr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=jr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=jr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=jr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=jr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=jr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=jr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=jr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=jr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=jr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=jr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=jr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=jr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=jr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=jr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Os.quadrant1Fill,quadrant2Fill:Os.quadrant2Fill,quadrant3Fill:Os.quadrant3Fill,quadrant4Fill:Os.quadrant4Fill,quadrant1TextFill:Os.quadrant1TextFill,quadrant2TextFill:Os.quadrant2TextFill,quadrant3TextFill:Os.quadrant3TextFill,quadrant4TextFill:Os.quadrant4TextFill,quadrantPointFill:Os.quadrantPointFill,quadrantPointTextFill:Os.quadrantPointTextFill,quadrantXAxisTextFill:Os.quadrantXAxisTextFill,quadrantYAxisTextFill:Os.quadrantYAxisTextFill,quadrantTitleFill:Os.quadrantTitleFill,quadrantInternalBorderStrokeFill:Os.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Os.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,he.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){he.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){he.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=b0().domain([0,1]).range([i,s+i]),l=b0().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},b(k2,"QuadrantBuilder"),k2),HA=(E2=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},b(E2,"InvalidStyleError"),E2);function JB(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}b(JB,"validateHexCode");function f2e(t){return!/^\d+$/.test(t)}b(f2e,"validateNumber");function p2e(t){return!/^\d+px$/.test(t)}b(p2e,"validateSizeInPixels");function Dc(t){return Qr(t.trim(),Ve())}b(Dc,"textSanitizer");var qa=new Cpt;function g2e(t){qa.setData({quadrant1Text:Dc(t.text)})}b(g2e,"setQuadrant1Text");function m2e(t){qa.setData({quadrant2Text:Dc(t.text)})}b(m2e,"setQuadrant2Text");function y2e(t){qa.setData({quadrant3Text:Dc(t.text)})}b(y2e,"setQuadrant3Text");function v2e(t){qa.setData({quadrant4Text:Dc(t.text)})}b(v2e,"setQuadrant4Text");function b2e(t){qa.setData({xAxisLeftText:Dc(t.text)})}b(b2e,"setXAxisLeftText");function x2e(t){qa.setData({xAxisRightText:Dc(t.text)})}b(x2e,"setXAxisRightText");function T2e(t){qa.setData({yAxisTopText:Dc(t.text)})}b(T2e,"setYAxisTopText");function w2e(t){qa.setData({yAxisBottomText:Dc(t.text)})}b(w2e,"setYAxisBottomText");function YA(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(f2e(i))throw new HA(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(JB(i))throw new HA(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(JB(i))throw new HA(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(p2e(i))throw new HA(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}b(YA,"parseStyles");function C2e(t,e,r,n,i){const a=YA(i);qa.addPoints([{x:r,y:n,text:Dc(t.text),className:e,...a}])}b(C2e,"addPoint");function S2e(t,e){qa.addClass(t,YA(e))}b(S2e,"addClass");function k2e(t){qa.setConfig({chartWidth:t})}b(k2e,"setWidth");function E2e(t){qa.setConfig({chartHeight:t})}b(E2e,"setHeight");function A2e(){const t=Ve(),{themeVariables:e,quadrantChart:r}=t;return r&&qa.setConfig(r),qa.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),qa.setData({titleText:Vn()}),qa.build()}b(A2e,"getQuadrantData");var Spt=b(function(){qa.clear(),zn()},"clear"),kpt={setWidth:k2e,setHeight:E2e,setQuadrant1Text:g2e,setQuadrant2Text:m2e,setQuadrant3Text:y2e,setQuadrant4Text:v2e,setXAxisLeftText:b2e,setXAxisRightText:x2e,setYAxisTopText:T2e,setYAxisBottomText:w2e,parseStyles:YA,addPoint:C2e,addClass:S2e,getQuadrantData:A2e,clear:Spt,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn},Ept=b((t,e,r,n)=>{var E,L,M;function i(I){return I==="top"?"hanging":"middle"}b(i,"getDominantBaseLine");function a(I){return I==="left"?"start":"middle"}b(a,"getTextAnchor");function s(I){return`translate(${I.x}, ${I.y}) rotate(${I.rotation||0})`}b(s,"getTransformation");const o=Ve();he.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=mt("#i"+e));const d=mt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;bi(d,g,p,((M=o.quadrantChart)==null?void 0:M.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),x=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",I=>I.x1).attr("y1",I=>I.y1).attr("x2",I=>I.x2).attr("y2",I=>I.y2).style("stroke",I=>I.strokeFill).style("stroke-width",I=>I.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",I=>I.x).attr("y",I=>I.y).attr("width",I=>I.width).attr("height",I=>I.height).attr("fill",I=>I.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",I=>I.text.fill).attr("font-size",I=>I.text.fontSize).attr("dominant-baseline",I=>i(I.text.horizontalPos)).attr("text-anchor",I=>a(I.text.verticalPos)).attr("transform",I=>s(I.text)).text(I=>I.text.text),x.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(I=>I.text).attr("fill",I=>I.fill).attr("font-size",I=>I.fontSize).attr("dominant-baseline",I=>i(I.horizontalPos)).attr("text-anchor",I=>a(I.verticalPos)).attr("transform",I=>s(I));const S=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");S.append("circle").attr("cx",I=>I.x).attr("cy",I=>I.y).attr("r",I=>I.radius).attr("fill",I=>I.fill).attr("stroke",I=>I.strokeColor).attr("stroke-width",I=>I.strokeWidth),S.append("text").attr("x",0).attr("y",0).text(I=>I.text.text).attr("fill",I=>I.text.fill).attr("font-size",I=>I.text.fontSize).attr("dominant-baseline",I=>i(I.text.horizontalPos)).attr("text-anchor",I=>a(I.text.verticalPos)).attr("transform",I=>s(I.text))},"draw"),Apt={draw:Ept},_pt={parser:wpt,db:kpt,renderer:Apt,styles:b(()=>"","styles")};const Rpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_pt},Symbol.toStringTag,{value:"Module"}));var eF=(function(){var t=b(function(O,D,N,B){for(N=N||{},B=O.length;B--;N[O[B]]=D);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],x=[1,37],w=[1,43],C=[1,42],k=[1,47],S=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],L=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],M=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],I=[1,65],P=[26,28],$={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:b(function(D,N,B,F,G,z,W){var V=z.length-1;switch(G){case 5:F.setOrientation(z[V]);break;case 9:F.setDiagramTitle(z[V].text.trim());break;case 12:F.setLineData({text:"",type:"text"},z[V]);break;case 13:F.setLineData(z[V-1],z[V]);break;case 14:F.setBarData({text:"",type:"text"},z[V]);break;case 15:F.setBarData(z[V-1],z[V]);break;case 16:this.$=z[V].trim(),F.setAccTitle(this.$);break;case 17:case 18:this.$=z[V].trim(),F.setAccDescription(this.$);break;case 19:this.$=z[V-1];break;case 20:case 30:this.$=[z[V-2],...z[V]];break;case 21:case 31:this.$=[z[V]];break;case 22:this.$={value:Number(z[V-1]),label:z[V]};break;case 23:this.$={value:Number(z[V]),label:""};break;case 24:F.setXAxisTitle(z[V]);break;case 25:F.setXAxisTitle(z[V-1]);break;case 26:F.setXAxisTitle({type:"text",text:""});break;case 27:F.setXAxisBand(z[V]);break;case 28:F.setXAxisRangeData(Number(z[V-2]),Number(z[V]));break;case 29:this.$=z[V-1];break;case 32:F.setYAxisTitle(z[V]);break;case 33:F.setYAxisTitle(z[V-1]);break;case 34:F.setYAxisTitle({type:"text",text:""});break;case 35:F.setYAxisRangeData(Number(z[V-2]),Number(z[V]));break;case 39:this.$={text:z[V],type:"text"};break;case 40:this.$={text:z[V],type:"text"};break;case 41:this.$={text:z[V],type:"markdown"};break;case 42:this.$=z[V];break;case 43:this.$=z[V-1]+""+z[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},{11:39,13:38,24:w,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},{11:45,15:44,29:k,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},{11:49,17:48,24:S,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},{11:52,17:51,24:S,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(L,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x}),t(L,[2,40]),t(L,[2,41]),t(M,[2,42]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(M,[2,52]),t(M,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:w,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},t(E,[2,11]),t(E,[2,32],{35:60,29:k}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:S},{25:63,27:64,29:I},t(E,[2,14]),{17:66,24:S},t(E,[2,16]),t(E,[2,17]),t(M,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:x},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:I},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:b(function(D,N){if(N.recoverable)this.trace(D);else{var B=new Error(D);throw B.hash=N,B}},"parseError"),parse:b(function(D){var N=this,B=[0],F=[],G=[null],z=[],W=this.table,V="",H=0,te=0,Y=2,se=1,J=z.slice.call(arguments,1),Z=Object.create(this.lexer),ee={yy:{}};for(var re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,re)&&(ee.yy[re]=this.yy[re]);Z.setInput(D,ee.yy),ee.yy.lexer=Z,ee.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var ge=Z.yylloc;z.push(ge);var ae=Z.options&&Z.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(ye){B.length=B.length-2*ye,G.length=G.length-ye,z.length=z.length-ye}b(_e,"popStack");function Fe(){var ye;return ye=F.pop()||Z.lex()||se,typeof ye!="number"&&(ye instanceof Array&&(F=ye,ye=F.pop()),ye=N.symbols_[ye]||ye),ye}b(Fe,"lex");for(var qe,ue,de,Ce,me={},$e,we,Le,Ye;;){if(ue=B[B.length-1],this.defaultActions[ue]?de=this.defaultActions[ue]:((qe===null||typeof qe>"u")&&(qe=Fe()),de=W[ue]&&W[ue][qe]),typeof de>"u"||!de.length||!de[0]){var ce="";Ye=[];for($e in W[ue])this.terminals_[$e]&&$e>Y&&Ye.push("'"+this.terminals_[$e]+"'");Z.showPosition?ce="Parse error on line "+(H+1)+`: +`+Z.showPosition()+` +Expecting `+Ye.join(", ")+", got '"+(this.terminals_[qe]||qe)+"'":ce="Parse error on line "+(H+1)+": Unexpected "+(qe==se?"end of input":"'"+(this.terminals_[qe]||qe)+"'"),this.parseError(ce,{text:Z.match,token:this.terminals_[qe]||qe,line:Z.yylineno,loc:ge,expected:Ye})}if(de[0]instanceof Array&&de.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ue+", token: "+qe);switch(de[0]){case 1:B.push(qe),G.push(Z.yytext),z.push(Z.yylloc),B.push(de[1]),qe=null,te=Z.yyleng,V=Z.yytext,H=Z.yylineno,ge=Z.yylloc;break;case 2:if(we=this.productions_[de[1]][1],me.$=G[G.length-we],me._$={first_line:z[z.length-(we||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(we||1)].first_column,last_column:z[z.length-1].last_column},ae&&(me._$.range=[z[z.length-(we||1)].range[0],z[z.length-1].range[1]]),Ce=this.performAction.apply(me,[V,te,H,ee.yy,de[1],G,z].concat(J)),typeof Ce<"u")return Ce;we&&(B=B.slice(0,-1*we*2),G=G.slice(0,-1*we),z=z.slice(0,-1*we)),B.push(this.productions_[de[1]][0]),G.push(me.$),z.push(me._$),Le=W[B[B.length-2]][B[B.length-1]],B.push(Le);break;case 3:return!0}}return!0},"parse")},_=(function(){var O={EOF:1,parseError:b(function(N,B){if(this.yy.parser)this.yy.parser.parseError(N,B);else throw new Error(N)},"parseError"),setInput:b(function(D,N){return this.yy=N||this.yy||{},this._input=D,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var N=D.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),D},"input"),unput:b(function(D){var N=D.length,B=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var F=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),B.length-1&&(this.yylineno-=B.length-1);var G=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:B?(B.length===F.length?this.yylloc.first_column:0)+F[F.length-B.length].length-B[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(D){this.unput(this.match.slice(D))},"less"),pastInput:b(function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var D=this.match;return D.length<20&&(D+=this._input.substr(0,20-D.length)),(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var D=this.pastInput(),N=new Array(D.length+1).join("-");return D+this.upcomingInput()+` +`+N+"^"},"showPosition"),test_match:b(function(D,N){var B,F,G;if(this.options.backtrack_lexer&&(G={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(G.yylloc.range=this.yylloc.range.slice(0))),F=D[0].match(/(?:\r\n?|\n).*/g),F&&(this.yylineno+=F.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:F?F[F.length-1].length-F[F.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(D[0].length),this.matched+=D[0],B=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var z in G)this[z]=G[z];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var D,N,B,F;this._more||(this.yytext="",this.match="");for(var G=this._currentRules(),z=0;zN[0].length)){if(N=B,F=z,this.options.backtrack_lexer){if(D=this.test_match(B,G[z]),D!==!1)return D;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(D=this.test_match(N,G[F]),D!==!1?D:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var N=this.next();return N||this.lex()},"lex"),begin:b(function(N){this.conditionStack.push(N)},"begin"),popState:b(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:b(function(N){this.begin(N)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(N,B,F,G){switch(F){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O})();$.lexer=_;function R(){this.yy={}}return b(R,"Parser"),R.prototype=$,$.Parser=R,new R})();eF.parser=eF;var Lpt=eF;function tF(t){return t.type==="bar"}b(tF,"isBarPlot");function XA(t){return t.type==="band"}b(XA,"isBandAxisData");function jm(t){return t.type==="linear"}b(jm,"isLinearAxisData");var _2e=(A2=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=QH(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},b(A2,"TextDimensionCalculatorWithFont"),A2),R2e=.7,L2e=.2,I2e=(_2=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){R2e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(R2e*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=L2e*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=L2e*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},b(_2,"BaseAxis"),_2),Ipt=(R2=class extends I2e{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=Y_().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Y_().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),he.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},b(R2,"BandAxis"),R2),Mpt=(L2=class extends I2e{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=b0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=b0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},b(L2,"LinearAxis"),L2);function rF(t,e,r,n){const i=new _2e(n);return XA(t)?new Ipt(e,r,t.categories,t.title,i):new Mpt(e,r,[t.min,t.max],t.title,i)}b(rF,"getAxis");var Dpt=(I2=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},b(I2,"ChartTitle"),I2);function M2e(t,e,r,n){const i=new _2e(n);return new Dpt(i,t,e,r)}b(M2e,"getChartTitleComponent");var Npt=(M2=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=Ib().y(i=>i[0]).x(i=>i[1])(e):r=Ib().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},b(M2,"LinePlot"),M2),Opt=(D2=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},b(D2,"BarPlot"),D2),$pt=(N2=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Npt(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Opt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},b(N2,"BasePlot"),N2);function D2e(t,e,r){return new $pt(t,e,r)}b(D2e,"getPlotComponent");var Ppt=(O2=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:M2e(e,r,n,i),plot:D2e(e,r,n),xAxis:rF(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:rF(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>tF(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>tF(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},b(O2,"Orchestrator"),O2),Bpt=($2=class{static build(e,r,n,i){return new Ppt(e,r,n,i).getDrawableElement()}},b($2,"XYChartBuilder"),$2),Uw=0,N2e,Hw=sF(),Yw=aF(),vn=oF(),nF=Yw.plotColorPalette.split(",").map(t=>t.trim()),jA=!1,iF=!1;function aF(){const t=Gc(),e=sr();return ri(t.xyChart,e.themeVariables.xyChart)}b(aF,"getChartDefaultThemeConfig");function sF(){const t=sr();return ri(jr.xyChart,t.xyChart)}b(sF,"getChartDefaultConfig");function oF(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}b(oF,"getChartDefaultData");function Xw(t){const e=sr();return Qr(t.trim(),e)}b(Xw,"textSanitizer");function O2e(t){N2e=t}b(O2e,"setTmpSVGG");function $2e(t){t==="horizontal"?Hw.chartOrientation="horizontal":Hw.chartOrientation="vertical"}b($2e,"setOrientation");function P2e(t){vn.xAxis.title=Xw(t.text)}b(P2e,"setXAxisTitle");function lF(t,e){vn.xAxis={type:"linear",title:vn.xAxis.title,min:t,max:e},jA=!0}b(lF,"setXAxisRangeData");function B2e(t){vn.xAxis={type:"band",title:vn.xAxis.title,categories:t.map(e=>Xw(e.text))},jA=!0}b(B2e,"setXAxisBand");function F2e(t){vn.yAxis.title=Xw(t.text)}b(F2e,"setYAxisTitle");function z2e(t,e){vn.yAxis={type:"linear",title:vn.yAxis.title,min:t,max:e},iF=!0}b(z2e,"setYAxisRangeData");function G2e(t){const e=Math.min(...t),r=Math.max(...t),n=jm(vn.yAxis)?vn.yAxis.min:1/0,i=jm(vn.yAxis)?vn.yAxis.max:-1/0;vn.yAxis={type:"linear",title:vn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}b(G2e,"setYAxisRangeFromPlotData");function cF(t){let e=[];if(t.length===0)return e;if(!jA){const r=jm(vn.xAxis)?vn.xAxis.min:1/0,n=jm(vn.xAxis)?vn.xAxis.max:-1/0;lF(Math.min(r,1),Math.max(n,t.length))}if(XA(vn.xAxis)&&t.length>vn.xAxis.categories.length&&(t=t.slice(0,vn.xAxis.categories.length)),iF||G2e(t),XA(vn.xAxis)&&(e=vn.xAxis.categories.map((r,n)=>[r,t[n]])),jm(vn.xAxis)){const r=vn.xAxis.min,n=vn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}b(cF,"transformDataWithoutCategory");function uF(t){return nF[t===0?0:t%nF.length]}b(uF,"getPlotColorFromPalette");function W2e(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?Xw(s.label):""),i=cF(r),a=n.some(s=>s!=="");vn.plots.push({type:"line",strokeFill:uF(Uw),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),Uw++}b(W2e,"setLineData");function q2e(t,e){const r=e.map(i=>i.value),n=cF(r);vn.plots.push({type:"bar",fill:uF(Uw),data:n}),Uw++}b(q2e,"setBarData");function V2e(){if(vn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return vn.title=Vn(),Bpt.build(Hw,vn,Yw,N2e)}b(V2e,"getDrawableElem");function U2e(){return Yw}b(U2e,"getChartThemeConfig");function H2e(){return Hw}b(H2e,"getChartConfig");function Y2e(){return vn}b(Y2e,"getXYChartData");var Fpt=b(function(){zn(),Uw=0,Hw=sF(),vn=oF(),Yw=aF(),nF=Yw.plotColorPalette.split(",").map(t=>t.trim()),jA=!1,iF=!1},"clear"),zpt={getDrawableElem:V2e,clear:Fpt,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn,setOrientation:$2e,setXAxisTitle:P2e,setXAxisRangeData:lF,setXAxisBand:B2e,setYAxisTitle:F2e,setYAxisRangeData:z2e,setLineData:W2e,setBarData:q2e,setTmpSVGG:O2e,getChartThemeConfig:U2e,getChartConfig:H2e,getXYChartData:Y2e},Gpt=b((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}b(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}b(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}b(h,"getTextTransformation"),he.debug(`Rendering xychart chart +`+t);const d=Ka(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");bi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,x="";for(const[w]of v.entries()){let C=f;w>0&&m[x]&&(C=m[x]),x+=v[w],T=m[x],T||(T=m[x]=C.append("g").attr("class",v[w]))}return T}b(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",x=>x.x).attr("y",x=>x.y).attr("width",x=>x.width).attr("height",x=>x.height).attr("fill",x=>x.fill).attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth),s.showDataLabel){const x=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(I,P){const{data:$,label:_}=I;return P*_.length*C<=$.width-k};b(w,"fitsHorizontally");const C=.7,k=10,S=v.data.map((I,P)=>({data:I,label:o[P].toString()})).filter(I=>I.data.width>0&&I.data.height>0),E=S.map(I=>{const{data:P}=I;let $=P.height*.7;for(;!w(I,$)&&$>0;)$-=1;return $}),L=Math.floor(Math.min(...E)),M=b(I=>x?I.data.x+I.data.width+k:I.data.x+I.data.width-k,"determineLabelXPosition");T.selectAll("text").data(S).enter().append("text").attr("x",M).attr("y",I=>I.data.y+I.data.height/2).attr("text-anchor",x?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(I=>I.label)}else{let w=function(M,I,P){const{data:$,label:_}=M,O=I*_.length*.7,D=$.x+$.width/2,N=D-O/2,B=D+O/2,F=N>=$.x&&B<=$.x+$.width,G=$.y+P+I<=$.y+$.height;return F&&G};b(w,"fitsInBar");const C=10,k=v.data.map((M,I)=>({data:M,label:o[I].toString()})).filter(M=>M.data.width>0&&M.data.height>0),S=k.map(M=>{const{data:I,label:P}=M;let $=I.width/(P.length*.7);for(;!w(M,$,C)&&$>0;)$-=1;return $}),E=Math.floor(Math.min(...S)),L=b(M=>x?M.data.y-C:M.data.y+C,"determineLabelYPosition");T.selectAll("text").data(k).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",x?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${E}px`).text(M=>M.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",x=>x.fill).attr("font-size",x=>x.fontSize).attr("dominant-baseline",x=>l(x.verticalPos)).attr("text-anchor",x=>u(x.horizontalPos)).attr("transform",x=>h(x)).text(x=>x.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",x=>x.path).attr("fill",x=>x.fill?x.fill:"none").attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth);break}}},"draw"),Wpt={draw:Gpt},qpt={parser:Lpt,db:zpt,renderer:Wpt};const Vpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:qpt},Symbol.toStringTag,{value:"Module"}));var hF=(function(){var t=b(function(le,pe,U,oe){for(U=U||{},oe=le.length;oe--;U[le[oe]]=pe);return U},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],x=[1,31],w=[1,32],C=[1,30],k=[1,39],S=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],M=[89,90],I=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],$=[1,70],_=[1,71],R=[1,72],O=[1,73],D=[1,74],N=[1,75],B=[1,76],F=[1,83],G=[1,80],z=[1,84],W=[1,85],V=[1,86],H=[1,87],te=[1,88],Y=[1,89],se=[1,90],J=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],re=[63,64],ge=[1,101],ae=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Fe=[1,110],qe=[1,106],ue=[1,107],de=[1,108],Ce=[1,109],me=[1,111],$e=[1,116],we=[1,117],Le=[1,114],Ye=[1,115],ce={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:b(function(pe,U,oe,Q,fe,j,Be){var Se=j.length-1;switch(fe){case 4:this.$=j[Se].trim(),Q.setAccTitle(this.$);break;case 5:case 6:this.$=j[Se].trim(),Q.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:Q.setDirection("TB");break;case 18:Q.setDirection("BT");break;case 19:Q.setDirection("RL");break;case 20:Q.setDirection("LR");break;case 21:Q.addRequirement(j[Se-3],j[Se-4]);break;case 22:Q.addRequirement(j[Se-5],j[Se-6]),Q.setClass([j[Se-5]],j[Se-3]);break;case 23:Q.setNewReqId(j[Se-2]);break;case 24:Q.setNewReqText(j[Se-2]);break;case 25:Q.setNewReqRisk(j[Se-2]);break;case 26:Q.setNewReqVerifyMethod(j[Se-2]);break;case 29:this.$=Q.RequirementType.REQUIREMENT;break;case 30:this.$=Q.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=Q.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=Q.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=Q.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=Q.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=Q.RiskLevel.LOW_RISK;break;case 36:this.$=Q.RiskLevel.MED_RISK;break;case 37:this.$=Q.RiskLevel.HIGH_RISK;break;case 38:this.$=Q.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=Q.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=Q.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=Q.VerifyType.VERIFY_TEST;break;case 42:Q.addElement(j[Se-3]);break;case 43:Q.addElement(j[Se-5]),Q.setClass([j[Se-5]],j[Se-3]);break;case 44:Q.setNewElementType(j[Se-2]);break;case 45:Q.setNewElementDocRef(j[Se-2]);break;case 48:Q.addRelationship(j[Se-2],j[Se],j[Se-4]);break;case 49:Q.addRelationship(j[Se-2],j[Se-4],j[Se]);break;case 50:this.$=Q.Relationships.CONTAINS;break;case 51:this.$=Q.Relationships.COPIES;break;case 52:this.$=Q.Relationships.DERIVES;break;case 53:this.$=Q.Relationships.SATISFIES;break;case 54:this.$=Q.Relationships.VERIFIES;break;case 55:this.$=Q.Relationships.REFINES;break;case 56:this.$=Q.Relationships.TRACES;break;case 57:this.$=j[Se-2],Q.defineClass(j[Se-1],j[Se]);break;case 58:Q.setClass(j[Se-1],j[Se]);break;case 59:Q.setClass([j[Se-2]],j[Se]);break;case 60:case 62:this.$=[j[Se]];break;case 61:case 63:this.$=j[Se-2].concat([j[Se]]);break;case 64:this.$=j[Se-2],Q.setCssStyle(j[Se-1],j[Se]);break;case 65:this.$=[j[Se]];break;case 66:j[Se-2].push(j[Se]),this.$=j[Se-2];break;case 68:this.$=j[Se-1]+j[Se];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:x,74:w,77:C,89:k,90:S},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:L,89:k,90:S},{30:63,33:62,75:L,89:k,90:S},{30:64,33:62,75:L,89:k,90:S},t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(M,[2,32]),t(M,[2,33]),t(M,[2,34]),t(I,[2,81]),t(I,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:$,66:_,67:R,68:O,69:D,70:N,71:B},{62:77,65:$,66:_,67:R,68:O,69:D,70:N,71:B},{30:78,33:62,75:L,89:k,90:S},{73:79,75:F,76:G,78:81,79:82,80:z,81:W,82:V,83:H,84:te,85:Y,86:se,87:J,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:F,76:G,78:81,79:82,80:z,81:W,82:V,83:H,84:te,85:Y,86:se,87:J,88:Z},{30:94,33:62,75:L,76:G,89:k,90:S},{5:[1,95]},{30:96,33:62,75:L,89:k,90:S},{5:[1,97]},{30:98,33:62,75:L,89:k,90:S},{63:[1,99]},t(re,[2,50]),t(re,[2,51]),t(re,[2,52]),t(re,[2,53]),t(re,[2,54]),t(re,[2,55]),t(re,[2,56]),{64:[1,100]},t(E,[2,59],{76:G}),t(E,[2,64],{76:ge}),{33:103,75:[1,102],89:k,90:S},t(ae,[2,65],{79:104,75:F,80:z,81:W,82:V,83:H,84:te,85:Y,86:se,87:J,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(E,[2,57],{76:ge}),t(E,[2,58],{76:G}),{5:Fe,28:105,31:qe,34:ue,36:de,38:Ce,40:me},{27:[1,112],76:G},{5:$e,40:we,56:113,57:Le,59:Ye},{27:[1,118],76:G},{33:119,89:k,90:S},{33:120,89:k,90:S},{75:F,78:121,79:82,80:z,81:W,82:V,83:H,84:te,85:Y,86:se,87:J,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(_e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Fe,28:126,31:qe,34:ue,36:de,38:Ce,40:me},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:$e,40:we,56:130,57:Le,59:Ye},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(ae,[2,66],{79:104,75:F,80:z,81:W,82:V,83:H,84:te,85:Y,86:se,87:J,88:Z}),{33:132,89:k,90:S},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:Fe,28:145,31:qe,34:ue,36:de,38:Ce,40:me},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:$e,40:we,56:152,57:Le,59:Ye},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:Fe,28:159,31:qe,34:ue,36:de,38:Ce,40:me},{5:Fe,28:160,31:qe,34:ue,36:de,38:Ce,40:me},{5:Fe,28:161,31:qe,34:ue,36:de,38:Ce,40:me},{5:Fe,28:162,31:qe,34:ue,36:de,38:Ce,40:me},{5:$e,40:we,56:163,57:Le,59:Ye},{5:$e,40:we,56:164,57:Le,59:Ye},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:b(function(pe,U){if(U.recoverable)this.trace(pe);else{var oe=new Error(pe);throw oe.hash=U,oe}},"parseError"),parse:b(function(pe){var U=this,oe=[0],Q=[],fe=[null],j=[],Be=this.table,Se="",He=0,De=0,We=2,Ne=1,Ze=j.slice.call(arguments,1),Pe=Object.create(this.lexer),nt={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(nt.yy[Ie]=this.yy[Ie]);Pe.setInput(pe,nt.yy),nt.yy.lexer=Pe,nt.yy.parser=this,typeof Pe.yylloc>"u"&&(Pe.yylloc={});var pt=Pe.yylloc;j.push(pt);var Re=Pe.options&&Pe.options.ranges;typeof nt.yy.parseError=="function"?this.parseError=nt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(Ae){oe.length=oe.length-2*Ae,fe.length=fe.length-Ae,j.length=j.length-Ae}b(kt,"popStack");function bt(){var Ae;return Ae=Q.pop()||Pe.lex()||Ne,typeof Ae!="number"&&(Ae instanceof Array&&(Q=Ae,Ae=Q.pop()),Ae=U.symbols_[Ae]||Ae),Ae}b(bt,"lex");for(var lt,Nt,Ct,dt,ve={},_t,gt,ft,Et;;){if(Nt=oe[oe.length-1],this.defaultActions[Nt]?Ct=this.defaultActions[Nt]:((lt===null||typeof lt>"u")&&(lt=bt()),Ct=Be[Nt]&&Be[Nt][lt]),typeof Ct>"u"||!Ct.length||!Ct[0]){var Nr="";Et=[];for(_t in Be[Nt])this.terminals_[_t]&&_t>We&&Et.push("'"+this.terminals_[_t]+"'");Pe.showPosition?Nr="Parse error on line "+(He+1)+`: +`+Pe.showPosition()+` +Expecting `+Et.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Nr="Parse error on line "+(He+1)+": Unexpected "+(lt==Ne?"end of input":"'"+(this.terminals_[lt]||lt)+"'"),this.parseError(Nr,{text:Pe.match,token:this.terminals_[lt]||lt,line:Pe.yylineno,loc:pt,expected:Et})}if(Ct[0]instanceof Array&&Ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Nt+", token: "+lt);switch(Ct[0]){case 1:oe.push(lt),fe.push(Pe.yytext),j.push(Pe.yylloc),oe.push(Ct[1]),lt=null,De=Pe.yyleng,Se=Pe.yytext,He=Pe.yylineno,pt=Pe.yylloc;break;case 2:if(gt=this.productions_[Ct[1]][1],ve.$=fe[fe.length-gt],ve._$={first_line:j[j.length-(gt||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(gt||1)].first_column,last_column:j[j.length-1].last_column},Re&&(ve._$.range=[j[j.length-(gt||1)].range[0],j[j.length-1].range[1]]),dt=this.performAction.apply(ve,[Se,De,He,nt.yy,Ct[1],fe,j].concat(Ze)),typeof dt<"u")return dt;gt&&(oe=oe.slice(0,-1*gt*2),fe=fe.slice(0,-1*gt),j=j.slice(0,-1*gt)),oe.push(this.productions_[Ct[1]][0]),fe.push(ve.$),j.push(ve._$),ft=Be[oe[oe.length-2]][oe[oe.length-1]],oe.push(ft);break;case 3:return!0}}return!0},"parse")},ye=(function(){var le={EOF:1,parseError:b(function(U,oe){if(this.yy.parser)this.yy.parser.parseError(U,oe);else throw new Error(U)},"parseError"),setInput:b(function(pe,U){return this.yy=U||this.yy||{},this._input=pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var U=pe.match(/(?:\r\n?|\n).*/g);return U?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:b(function(pe){var U=pe.length,oe=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-U),this.offset-=U;var Q=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),oe.length-1&&(this.yylineno-=oe.length-1);var fe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:oe?(oe.length===Q.length?this.yylloc.first_column:0)+Q[Q.length-oe.length].length-oe[0].length:this.yylloc.first_column-U},this.options.ranges&&(this.yylloc.range=[fe[0],fe[0]+this.yyleng-U]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:b(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var pe=this.pastInput(),U=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` +`+U+"^"},"showPosition"),test_match:b(function(pe,U){var oe,Q,fe;if(this.options.backtrack_lexer&&(fe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(fe.yylloc.range=this.yylloc.range.slice(0))),Q=pe[0].match(/(?:\r\n?|\n).*/g),Q&&(this.yylineno+=Q.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Q?Q[Q.length-1].length-Q[Q.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(pe[0].length),this.matched+=pe[0],oe=this.performAction.call(this,this.yy,this,U,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),oe)return oe;if(this._backtrack){for(var j in fe)this[j]=fe[j];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,U,oe,Q;this._more||(this.yytext="",this.match="");for(var fe=this._currentRules(),j=0;jU[0].length)){if(U=oe,Q=j,this.options.backtrack_lexer){if(pe=this.test_match(oe,fe[j]),pe!==!1)return pe;if(this._backtrack){U=!1;continue}else return!1}else if(!this.options.flex)break}return U?(pe=this.test_match(U,fe[Q]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var U=this.next();return U||this.lex()},"lex"),begin:b(function(U){this.conditionStack.push(U)},"begin"),popState:b(function(){var U=this.conditionStack.length-1;return U>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(U){return U=this.conditionStack.length-1-Math.abs(U||0),U>=0?this.conditionStack[U]:"INITIAL"},"topState"),pushState:b(function(U){this.begin(U)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(U,oe,Q,fe){switch(Q){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return oe.yytext=oe.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return le})();ce.lexer=ye;function ke(){this.yy={}}return b(ke,"Parser"),ke.prototype=ce,ce.Parser=ke,new ke})();hF.parser=hF;var Upt=hF,Hpt=(P2=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=qn,this.getAccTitle=Qn,this.setAccDescription=Jn,this.getAccDescription=ei,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getConfig=b(()=>Ve().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),he.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,zn()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Ve(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},b(P2,"RequirementDB"),P2),Ypt=b(t=>{const e=sr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=lr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${Ylt(t)} + `;return s},"genColor"),Xpt=b(t=>{const e=sr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${Ypt(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -1860,16 +1875,16 @@ Expecting `+St.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Nr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Klt=Xlt,ome={};Ew(ome,{draw:()=>jlt});var jlt=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=$e(),l=n.db.getData(),u=Z0(e,i);l.type=n.type,l.layoutAlgorithm=cb(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await Jp(l,u);const h=8;Lr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Ud(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Zlt={parser:Ult,get db(){return new Hlt},renderer:ome,styles:Klt};const Qlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zlt},Symbol.toStringTag,{value:"Module"}));var L$=(function(){var t=T(function(Me,qe,Le,Ke){for(Le=Le||{},Ke=Me.length;Ke--;Le[Me[Ke]]=qe);return Le},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],k=[1,33],S=[1,34],C=[1,35],_=[1,36],L=[1,37],O=[1,38],D=[1,39],z=[1,40],F=[1,42],A=[1,43],R=[1,44],N=[1,45],M=[1,46],I=[1,47],$=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],P=[1,74],B=[1,80],q=[1,81],V=[1,82],X=[1,83],W=[1,84],ie=[1,85],K=[1,86],se=[1,87],te=[1,88],Z=[1,89],ee=[1,90],ne=[1,91],oe=[1,92],fe=[1,93],Ae=[1,94],Re=[1,95],Ge=[1,96],Ce=[1,97],be=[1,98],Fe=[1,99],ye=[1,100],He=[1,101],xe=[1,102],Ve=[1,103],Je=[1,104],nt=[1,105],tt=[2,78],Ze=[4,5,17,51,53,54],Ee=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Y=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],pe=[70,71,72,73],re=[1,151],Pe={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:T(function(qe,Le,Ke,De,it,Te,ct){var we=Te.length-1;switch(it){case 3:return De.apply(Te[we]),Te[we];case 4:case 10:this.$=[];break;case 5:case 11:Te[we-1].push(Te[we]),this.$=Te[we-1];break;case 6:case 7:case 12:case 13:this.$=Te[we];break;case 8:case 9:case 14:this.$=[];break;case 16:Te[we].type="createParticipant",this.$=Te[we];break;case 17:Te[we-1].unshift({type:"boxStart",boxData:De.parseBoxData(Te[we-2])}),Te[we-1].push({type:"boxEnd",boxText:Te[we-2]}),this.$=Te[we-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Te[we-2]),sequenceIndexStep:Number(Te[we-1]),sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Te[we-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:De.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Te[we-1].actor};break;case 24:this.$={type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Te[we-1].actor};break;case 30:De.setDiagramTitle(Te[we].substring(6)),this.$=Te[we].substring(6);break;case 31:De.setDiagramTitle(Te[we].substring(7)),this.$=Te[we].substring(7);break;case 32:this.$=Te[we].trim(),De.setAccTitle(this.$);break;case 33:case 34:this.$=Te[we].trim(),De.setAccDescription(this.$);break;case 35:Te[we-1].unshift({type:"loopStart",loopText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.LOOP_START}),Te[we-1].push({type:"loopEnd",loopText:Te[we-2],signalType:De.LINETYPE.LOOP_END}),this.$=Te[we-1];break;case 36:Te[we-1].unshift({type:"rectStart",color:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.RECT_START}),Te[we-1].push({type:"rectEnd",color:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.RECT_END}),this.$=Te[we-1];break;case 37:Te[we-1].unshift({type:"optStart",optText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.OPT_START}),Te[we-1].push({type:"optEnd",optText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.OPT_END}),this.$=Te[we-1];break;case 38:Te[we-1].unshift({type:"altStart",altText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.ALT_START}),Te[we-1].push({type:"altEnd",signalType:De.LINETYPE.ALT_END}),this.$=Te[we-1];break;case 39:Te[we-1].unshift({type:"parStart",parText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.PAR_START}),Te[we-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Te[we-1];break;case 40:Te[we-1].unshift({type:"parStart",parText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.PAR_OVER_START}),Te[we-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Te[we-1];break;case 41:Te[we-1].unshift({type:"criticalStart",criticalText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.CRITICAL_START}),Te[we-1].push({type:"criticalEnd",signalType:De.LINETYPE.CRITICAL_END}),this.$=Te[we-1];break;case 42:Te[we-1].unshift({type:"breakStart",breakText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.BREAK_START}),Te[we-1].push({type:"breakEnd",optText:De.parseMessage(Te[we-2]),signalType:De.LINETYPE.BREAK_END}),this.$=Te[we-1];break;case 44:this.$=Te[we-3].concat([{type:"option",optionText:De.parseMessage(Te[we-1]),signalType:De.LINETYPE.CRITICAL_OPTION},Te[we]]);break;case 46:this.$=Te[we-3].concat([{type:"and",parText:De.parseMessage(Te[we-1]),signalType:De.LINETYPE.PAR_AND},Te[we]]);break;case 48:this.$=Te[we-3].concat([{type:"else",altText:De.parseMessage(Te[we-1]),signalType:De.LINETYPE.ALT_ELSE},Te[we]]);break;case 49:Te[we-3].draw="participant",Te[we-3].type="addParticipant",Te[we-3].description=De.parseMessage(Te[we-1]),this.$=Te[we-3];break;case 50:Te[we-1].draw="participant",Te[we-1].type="addParticipant",this.$=Te[we-1];break;case 51:Te[we-3].draw="actor",Te[we-3].type="addParticipant",Te[we-3].description=De.parseMessage(Te[we-1]),this.$=Te[we-3];break;case 52:case 57:Te[we-1].draw="actor",Te[we-1].type="addParticipant",this.$=Te[we-1];break;case 53:Te[we-1].type="destroyParticipant",this.$=Te[we-1];break;case 54:Te[we-3].draw="participant",Te[we-3].type="addParticipant",Te[we-3].description=De.parseMessage(Te[we-1]),this.$=Te[we-3];break;case 55:Te[we-1].draw="participant",Te[we-1].type="addParticipant",this.$=Te[we-1];break;case 56:Te[we-3].draw="actor",Te[we-3].type="addParticipant",Te[we-3].description=De.parseMessage(Te[we-1]),this.$=Te[we-3];break;case 58:this.$=[Te[we-1],{type:"addNote",placement:Te[we-2],actor:Te[we-1].actor,text:Te[we]}];break;case 59:Te[we-2]=[].concat(Te[we-1],Te[we-1]).slice(0,2),Te[we-2][0]=Te[we-2][0].actor,Te[we-2][1]=Te[we-2][1].actor,this.$=[Te[we-1],{type:"addNote",placement:De.PLACEMENT.OVER,actor:Te[we-2].slice(0,2),text:Te[we]}];break;case 60:this.$=[Te[we-1],{type:"addLinks",actor:Te[we-1].actor,text:Te[we]}];break;case 61:this.$=[Te[we-1],{type:"addALink",actor:Te[we-1].actor,text:Te[we]}];break;case 62:this.$=[Te[we-1],{type:"addProperties",actor:Te[we-1].actor,text:Te[we]}];break;case 63:this.$=[Te[we-1],{type:"addDetails",actor:Te[we-1].actor,text:Te[we]}];break;case 66:this.$=[Te[we-2],Te[we]];break;case 67:this.$=Te[we];break;case 68:this.$=De.PLACEMENT.LEFTOF;break;case 69:this.$=De.PLACEMENT.RIGHTOF;break;case 70:this.$=[Te[we-4],Te[we-1],{type:"addMessage",from:Te[we-4].actor,to:Te[we-1].actor,signalType:Te[we-3],msg:Te[we],activate:!0},{type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Te[we-1].actor}];break;case 71:this.$=[Te[we-4],Te[we-1],{type:"addMessage",from:Te[we-4].actor,to:Te[we-1].actor,signalType:Te[we-3],msg:Te[we]},{type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Te[we-4].actor}];break;case 72:this.$=[Te[we-4],Te[we-1],{type:"addMessage",from:Te[we-4].actor,to:Te[we-1].actor,signalType:Te[we-3],msg:Te[we],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Te[we-1].actor}];break;case 73:this.$=[Te[we-4],Te[we-1],{type:"addMessage",from:Te[we-4].actor,to:Te[we-1].actor,signalType:Te[we-2],msg:Te[we],activate:!1,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Te[we-4].actor}];break;case 74:this.$=[Te[we-5],Te[we-1],{type:"addMessage",from:Te[we-5].actor,to:Te[we-1].actor,signalType:Te[we-3],msg:Te[we],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Te[we-1].actor},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Te[we-5].actor}];break;case 75:this.$=[Te[we-3],Te[we-1],{type:"addMessage",from:Te[we-3].actor,to:Te[we-1].actor,signalType:Te[we-2],msg:Te[we]}];break;case 76:this.$={type:"addParticipant",actor:Te[we-1],config:Te[we]};break;case 77:this.$=Te[we-1].trim();break;case 78:this.$={type:"addParticipant",actor:Te[we]};break;case 79:this.$=De.LINETYPE.SOLID_OPEN;break;case 80:this.$=De.LINETYPE.DOTTED_OPEN;break;case 81:this.$=De.LINETYPE.SOLID;break;case 82:this.$=De.LINETYPE.SOLID_TOP;break;case 83:this.$=De.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=De.LINETYPE.STICK_TOP;break;case 85:this.$=De.LINETYPE.STICK_BOTTOM;break;case 86:this.$=De.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=De.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=De.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=De.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=De.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=De.LINETYPE.DOTTED;break;case 100:this.$=De.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=De.LINETYPE.SOLID_CROSS;break;case 102:this.$=De.LINETYPE.DOTTED_CROSS;break;case 103:this.$=De.LINETYPE.SOLID_POINT;break;case 104:this.$=De.LINETYPE.DOTTED_POINT;break;case 105:this.$=De.parseMessage(Te[we].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},t($,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,15]),{13:49,51:O,53:D,54:z},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t($,[2,30]),t($,[2,31]),{33:[1,62]},{35:[1,63]},t($,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:P},{23:75,55:76,73:P},{23:77,73:I},{69:78,72:[1,79],78:B,79:q,80:V,81:X,82:W,83:ie,84:K,85:se,86:te,87:Z,88:ee,89:ne,90:oe,91:fe,92:Ae,93:Re,94:Ge,95:Ce,96:be,97:Fe,98:ye,99:He,100:xe,101:Ve,102:Je,103:nt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],tt),t($,[2,6]),t($,[2,16]),t(Ze,[2,10],{11:114}),t($,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t($,[2,22]),{5:[1,118]},{5:[1,119]},t($,[2,25]),t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,32]),t($,[2,33]),t(Ee,i,{7:120}),t(Ee,i,{7:121}),t(Ee,i,{7:122}),t(Se,i,{41:123,7:124}),t(Y,i,{43:125,7:126}),t(Y,i,{7:126,43:127}),t(ce,i,{46:128,7:129}),t(Ee,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,tt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:I},{69:146,78:B,79:q,80:V,81:X,82:W,83:ie,84:K,85:se,86:te,87:Z,88:ee,89:ne,90:oe,91:fe,92:Ae,93:Re,94:Ge,95:Ce,96:be,97:Fe,98:ye,99:He,100:xe,101:Ve,102:Je,103:nt},t(pe,[2,79]),t(pe,[2,80]),t(pe,[2,81]),t(pe,[2,82]),t(pe,[2,83]),t(pe,[2,84]),t(pe,[2,85]),t(pe,[2,86]),t(pe,[2,87]),t(pe,[2,88]),t(pe,[2,89]),t(pe,[2,90]),t(pe,[2,91]),t(pe,[2,92]),t(pe,[2,93]),t(pe,[2,94]),t(pe,[2,95]),t(pe,[2,96]),t(pe,[2,97]),t(pe,[2,98]),t(pe,[2,99]),t(pe,[2,100]),t(pe,[2,101]),t(pe,[2,102]),t(pe,[2,103]),t(pe,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:re},{58:152,104:re},{58:153,104:re},{58:154,104:re},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:O,53:D,54:z},{5:[1,160]},t($,[2,20]),t($,[2,21]),t($,[2,23]),t($,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,50:[1,165],51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,49:[1,167],51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,48:[1,170],51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:D,54:z,56:F,61:A,62:R,63:N,64:M,73:I},{16:[1,172]},t($,[2,50]),{16:[1,173]},t($,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t($,[2,52]),{16:[1,176]},t($,[2,57]),t($,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:re},{23:181,72:[1,182],73:I},{58:183,104:re},{58:184,104:re},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t($,[2,17]),t(Ze,[2,11]),{13:186,51:O,53:D,54:z},t(Ze,[2,13]),t(Ze,[2,14]),t($,[2,19]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t($,[2,38]),{16:[1,187]},t($,[2,39]),{16:[1,188]},t($,[2,40]),t($,[2,41]),{16:[1,189]},t($,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:re},{58:196,104:re},{58:197,104:re},{5:[2,75]},{58:198,104:re},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},t(Ze,[2,12]),t(Se,i,{7:124,41:201}),t(Y,i,{7:126,43:202}),t(ce,i,{7:129,46:203}),t($,[2,49]),t($,[2,54]),t(j,[2,77]),t($,[2,51]),t($,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:re},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:T(function(qe,Le){if(Le.recoverable)this.trace(qe);else{var Ke=new Error(qe);throw Ke.hash=Le,Ke}},"parseError"),parse:T(function(qe){var Le=this,Ke=[0],De=[],it=[null],Te=[],ct=this.table,we="",Et=0,yt=0,ot=2,Dt=1,vt=Te.slice.call(arguments,1),ut=Object.create(this.lexer),le={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(le.yy[At]=this.yy[At]);ut.setInput(qe,le.yy),le.yy.lexer=ut,le.yy.parser=this,typeof ut.yylloc>"u"&&(ut.yylloc={});var dt=ut.yylloc;Te.push(dt);var ht=ut.options&&ut.options.ranges;typeof le.yy.parseError=="function"?this.parseError=le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(Jt){Ke.length=Ke.length-2*Jt,it.length=it.length-Jt,Te.length=Te.length-Jt}T(St,"popStack");function Nr(){var Jt;return Jt=De.pop()||ut.lex()||Dt,typeof Jt!="number"&&(Jt instanceof Array&&(De=Jt,Jt=De.pop()),Jt=Le.symbols_[Jt]||Jt),Jt}T(Nr,"lex");for(var me,et,lt,Rt,Ft={},or,ir,xr,sr;;){if(et=Ke[Ke.length-1],this.defaultActions[et]?lt=this.defaultActions[et]:((me===null||typeof me>"u")&&(me=Nr()),lt=ct[et]&&ct[et][me]),typeof lt>"u"||!lt.length||!lt[0]){var Rr="";sr=[];for(or in ct[et])this.terminals_[or]&&or>ot&&sr.push("'"+this.terminals_[or]+"'");ut.showPosition?Rr="Parse error on line "+(Et+1)+`: -`+ut.showPosition()+` -Expecting `+sr.join(", ")+", got '"+(this.terminals_[me]||me)+"'":Rr="Parse error on line "+(Et+1)+": Unexpected "+(me==Dt?"end of input":"'"+(this.terminals_[me]||me)+"'"),this.parseError(Rr,{text:ut.match,token:this.terminals_[me]||me,line:ut.yylineno,loc:dt,expected:sr})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+et+", token: "+me);switch(lt[0]){case 1:Ke.push(me),it.push(ut.yytext),Te.push(ut.yylloc),Ke.push(lt[1]),me=null,yt=ut.yyleng,we=ut.yytext,Et=ut.yylineno,dt=ut.yylloc;break;case 2:if(ir=this.productions_[lt[1]][1],Ft.$=it[it.length-ir],Ft._$={first_line:Te[Te.length-(ir||1)].first_line,last_line:Te[Te.length-1].last_line,first_column:Te[Te.length-(ir||1)].first_column,last_column:Te[Te.length-1].last_column},ht&&(Ft._$.range=[Te[Te.length-(ir||1)].range[0],Te[Te.length-1].range[1]]),Rt=this.performAction.apply(Ft,[we,yt,Et,le.yy,lt[1],it,Te].concat(vt)),typeof Rt<"u")return Rt;ir&&(Ke=Ke.slice(0,-1*ir*2),it=it.slice(0,-1*ir),Te=Te.slice(0,-1*ir)),Ke.push(this.productions_[lt[1]][0]),it.push(Ft.$),Te.push(Ft._$),xr=ct[Ke[Ke.length-2]][Ke[Ke.length-1]],Ke.push(xr);break;case 3:return!0}}return!0},"parse")},ve=(function(){var Me={EOF:1,parseError:T(function(Le,Ke){if(this.yy.parser)this.yy.parser.parseError(Le,Ke);else throw new Error(Le)},"parseError"),setInput:T(function(qe,Le){return this.yy=Le||this.yy||{},this._input=qe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var Le=qe.match(/(?:\r\n?|\n).*/g);return Le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:T(function(qe){var Le=qe.length,Ke=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Le),this.offset-=Le;var De=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Ke.length-1&&(this.yylineno-=Ke.length-1);var it=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ke?(Ke.length===De.length?this.yylloc.first_column:0)+De[De.length-Ke.length].length-Ke[0].length:this.yylloc.first_column-Le},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Le]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(qe){this.unput(this.match.slice(qe))},"less"),pastInput:T(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var qe=this.pastInput(),Le=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` -`+Le+"^"},"showPosition"),test_match:T(function(qe,Le){var Ke,De,it;if(this.options.backtrack_lexer&&(it={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(it.yylloc.range=this.yylloc.range.slice(0))),De=qe[0].match(/(?:\r\n?|\n).*/g),De&&(this.yylineno+=De.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:De?De[De.length-1].length-De[De.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(qe[0].length),this.matched+=qe[0],Ke=this.performAction.call(this,this.yy,this,Le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ke)return Ke;if(this._backtrack){for(var Te in it)this[Te]=it[Te];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,Le,Ke,De;this._more||(this.yytext="",this.match="");for(var it=this._currentRules(),Te=0;TeLe[0].length)){if(Le=Ke,De=Te,this.options.backtrack_lexer){if(qe=this.test_match(Ke,it[Te]),qe!==!1)return qe;if(this._backtrack){Le=!1;continue}else return!1}else if(!this.options.flex)break}return Le?(qe=this.test_match(Le,it[De]),qe!==!1?qe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Le=this.next();return Le||this.lex()},"lex"),begin:T(function(Le){this.conditionStack.push(Le)},"begin"),popState:T(function(){var Le=this.conditionStack.length-1;return Le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Le){return Le=this.conditionStack.length-1-Math.abs(Le||0),Le>=0?this.conditionStack[Le]:"INITIAL"},"topState"),pushState:T(function(Le){this.begin(Le)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Le,Ke,De,it){switch(De){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Ke.yytext=Ke.yytext.trim(),73;case 12:return Ke.yytext=Ke.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ke.yytext=Ke.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ke.yytext=Ke.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Ke.yytext=Ke.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Me})();Pe.lexer=ve;function Ue(){this.yy={}}return T(Ue,"Parser"),Ue.prototype=Pe,Pe.Parser=Ue,new Ue})();L$.parser=L$;var Jlt=L$,ect={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},tct={FILLED:0,OPEN:1},rct={LEFTOF:0,RIGHTOF:1,OVER:2},RS={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},nct=(Vv=class{constructor(){this.state=new II(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Mn,this.setAccDescription=qn,this.setDiagramTitle=Wn,this.getAccTitle=Gn,this.getAccDescription=Vn,this.getDiagramTitle=Nn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($e().wrap),this.LINETYPE=ect,this.ARROWTYPE=tct,this.PLACEMENT=rct}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` +`},"getStyles"),jpt=Xpt,X2e={};Bc(X2e,{draw:()=>Kpt});var Kpt=b(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Ve(),l=n.db.getData(),u=Wg(e,i);l.type=n.type,l.layoutAlgorithm=ax(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await B0(l,u);const h=8;Er.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Nf(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Zpt={parser:Upt,get db(){return new Hpt},renderer:X2e,styles:jpt};const Qpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zpt},Symbol.toStringTag,{value:"Module"}));var dF=(function(){var t=b(function(De,We,Ne,Ze){for(Ne=Ne||{},Ze=De.length;Ze--;Ne[De[Ze]]=We);return Ne},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],x=[1,31],w=[1,32],C=[1,33],k=[1,34],S=[1,35],E=[1,36],L=[1,37],M=[1,38],I=[1,39],P=[1,40],$=[1,42],_=[1,43],R=[1,44],O=[1,45],D=[1,46],N=[1,47],B=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],F=[1,74],G=[1,80],z=[1,81],W=[1,82],V=[1,83],H=[1,84],te=[1,85],Y=[1,86],se=[1,87],J=[1,88],Z=[1,89],ee=[1,90],re=[1,91],ge=[1,92],ae=[1,93],_e=[1,94],Fe=[1,95],qe=[1,96],ue=[1,97],de=[1,98],Ce=[1,99],me=[1,100],$e=[1,101],we=[1,102],Le=[1,103],Ye=[1,104],ce=[1,105],ye=[2,78],ke=[4,5,17,51,53,54],le=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],pe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],U=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],oe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Q=[5,52],fe=[70,71,72,73],j=[1,151],Be={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:b(function(We,Ne,Ze,Pe,nt,Ie,pt){var Re=Ie.length-1;switch(nt){case 3:return Pe.apply(Ie[Re]),Ie[Re];case 4:case 10:this.$=[];break;case 5:case 11:Ie[Re-1].push(Ie[Re]),this.$=Ie[Re-1];break;case 6:case 7:case 12:case 13:this.$=Ie[Re];break;case 8:case 9:case 14:this.$=[];break;case 16:Ie[Re].type="createParticipant",this.$=Ie[Re];break;case 17:Ie[Re-1].unshift({type:"boxStart",boxData:Pe.parseBoxData(Ie[Re-2])}),Ie[Re-1].push({type:"boxEnd",boxText:Ie[Re-2]}),this.$=Ie[Re-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Ie[Re-2]),sequenceIndexStep:Number(Ie[Re-1]),sequenceVisible:!0,signalType:Pe.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ie[Re-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Pe.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Pe.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Pe.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Pe.LINETYPE.ACTIVE_START,actor:Ie[Re-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Pe.LINETYPE.ACTIVE_END,actor:Ie[Re-1].actor};break;case 30:Pe.setDiagramTitle(Ie[Re].substring(6)),this.$=Ie[Re].substring(6);break;case 31:Pe.setDiagramTitle(Ie[Re].substring(7)),this.$=Ie[Re].substring(7);break;case 32:this.$=Ie[Re].trim(),Pe.setAccTitle(this.$);break;case 33:case 34:this.$=Ie[Re].trim(),Pe.setAccDescription(this.$);break;case 35:Ie[Re-1].unshift({type:"loopStart",loopText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.LOOP_START}),Ie[Re-1].push({type:"loopEnd",loopText:Ie[Re-2],signalType:Pe.LINETYPE.LOOP_END}),this.$=Ie[Re-1];break;case 36:Ie[Re-1].unshift({type:"rectStart",color:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.RECT_START}),Ie[Re-1].push({type:"rectEnd",color:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.RECT_END}),this.$=Ie[Re-1];break;case 37:Ie[Re-1].unshift({type:"optStart",optText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.OPT_START}),Ie[Re-1].push({type:"optEnd",optText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.OPT_END}),this.$=Ie[Re-1];break;case 38:Ie[Re-1].unshift({type:"altStart",altText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.ALT_START}),Ie[Re-1].push({type:"altEnd",signalType:Pe.LINETYPE.ALT_END}),this.$=Ie[Re-1];break;case 39:Ie[Re-1].unshift({type:"parStart",parText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.PAR_START}),Ie[Re-1].push({type:"parEnd",signalType:Pe.LINETYPE.PAR_END}),this.$=Ie[Re-1];break;case 40:Ie[Re-1].unshift({type:"parStart",parText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.PAR_OVER_START}),Ie[Re-1].push({type:"parEnd",signalType:Pe.LINETYPE.PAR_END}),this.$=Ie[Re-1];break;case 41:Ie[Re-1].unshift({type:"criticalStart",criticalText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.CRITICAL_START}),Ie[Re-1].push({type:"criticalEnd",signalType:Pe.LINETYPE.CRITICAL_END}),this.$=Ie[Re-1];break;case 42:Ie[Re-1].unshift({type:"breakStart",breakText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.BREAK_START}),Ie[Re-1].push({type:"breakEnd",optText:Pe.parseMessage(Ie[Re-2]),signalType:Pe.LINETYPE.BREAK_END}),this.$=Ie[Re-1];break;case 44:this.$=Ie[Re-3].concat([{type:"option",optionText:Pe.parseMessage(Ie[Re-1]),signalType:Pe.LINETYPE.CRITICAL_OPTION},Ie[Re]]);break;case 46:this.$=Ie[Re-3].concat([{type:"and",parText:Pe.parseMessage(Ie[Re-1]),signalType:Pe.LINETYPE.PAR_AND},Ie[Re]]);break;case 48:this.$=Ie[Re-3].concat([{type:"else",altText:Pe.parseMessage(Ie[Re-1]),signalType:Pe.LINETYPE.ALT_ELSE},Ie[Re]]);break;case 49:Ie[Re-3].draw="participant",Ie[Re-3].type="addParticipant",Ie[Re-3].description=Pe.parseMessage(Ie[Re-1]),this.$=Ie[Re-3];break;case 50:Ie[Re-1].draw="participant",Ie[Re-1].type="addParticipant",this.$=Ie[Re-1];break;case 51:Ie[Re-3].draw="actor",Ie[Re-3].type="addParticipant",Ie[Re-3].description=Pe.parseMessage(Ie[Re-1]),this.$=Ie[Re-3];break;case 52:case 57:Ie[Re-1].draw="actor",Ie[Re-1].type="addParticipant",this.$=Ie[Re-1];break;case 53:Ie[Re-1].type="destroyParticipant",this.$=Ie[Re-1];break;case 54:Ie[Re-3].draw="participant",Ie[Re-3].type="addParticipant",Ie[Re-3].description=Pe.parseMessage(Ie[Re-1]),this.$=Ie[Re-3];break;case 55:Ie[Re-1].draw="participant",Ie[Re-1].type="addParticipant",this.$=Ie[Re-1];break;case 56:Ie[Re-3].draw="actor",Ie[Re-3].type="addParticipant",Ie[Re-3].description=Pe.parseMessage(Ie[Re-1]),this.$=Ie[Re-3];break;case 58:this.$=[Ie[Re-1],{type:"addNote",placement:Ie[Re-2],actor:Ie[Re-1].actor,text:Ie[Re]}];break;case 59:Ie[Re-2]=[].concat(Ie[Re-1],Ie[Re-1]).slice(0,2),Ie[Re-2][0]=Ie[Re-2][0].actor,Ie[Re-2][1]=Ie[Re-2][1].actor,this.$=[Ie[Re-1],{type:"addNote",placement:Pe.PLACEMENT.OVER,actor:Ie[Re-2].slice(0,2),text:Ie[Re]}];break;case 60:this.$=[Ie[Re-1],{type:"addLinks",actor:Ie[Re-1].actor,text:Ie[Re]}];break;case 61:this.$=[Ie[Re-1],{type:"addALink",actor:Ie[Re-1].actor,text:Ie[Re]}];break;case 62:this.$=[Ie[Re-1],{type:"addProperties",actor:Ie[Re-1].actor,text:Ie[Re]}];break;case 63:this.$=[Ie[Re-1],{type:"addDetails",actor:Ie[Re-1].actor,text:Ie[Re]}];break;case 66:this.$=[Ie[Re-2],Ie[Re]];break;case 67:this.$=Ie[Re];break;case 68:this.$=Pe.PLACEMENT.LEFTOF;break;case 69:this.$=Pe.PLACEMENT.RIGHTOF;break;case 70:this.$=[Ie[Re-4],Ie[Re-1],{type:"addMessage",from:Ie[Re-4].actor,to:Ie[Re-1].actor,signalType:Ie[Re-3],msg:Ie[Re],activate:!0},{type:"activeStart",signalType:Pe.LINETYPE.ACTIVE_START,actor:Ie[Re-1].actor}];break;case 71:this.$=[Ie[Re-4],Ie[Re-1],{type:"addMessage",from:Ie[Re-4].actor,to:Ie[Re-1].actor,signalType:Ie[Re-3],msg:Ie[Re]},{type:"activeEnd",signalType:Pe.LINETYPE.ACTIVE_END,actor:Ie[Re-4].actor}];break;case 72:this.$=[Ie[Re-4],Ie[Re-1],{type:"addMessage",from:Ie[Re-4].actor,to:Ie[Re-1].actor,signalType:Ie[Re-3],msg:Ie[Re],activate:!0,centralConnection:Pe.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Pe.LINETYPE.CENTRAL_CONNECTION,actor:Ie[Re-1].actor}];break;case 73:this.$=[Ie[Re-4],Ie[Re-1],{type:"addMessage",from:Ie[Re-4].actor,to:Ie[Re-1].actor,signalType:Ie[Re-2],msg:Ie[Re],activate:!1,centralConnection:Pe.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Pe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ie[Re-4].actor}];break;case 74:this.$=[Ie[Re-5],Ie[Re-1],{type:"addMessage",from:Ie[Re-5].actor,to:Ie[Re-1].actor,signalType:Ie[Re-3],msg:Ie[Re],activate:!0,centralConnection:Pe.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Pe.LINETYPE.CENTRAL_CONNECTION,actor:Ie[Re-1].actor},{type:"centralConnectionReverse",signalType:Pe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ie[Re-5].actor}];break;case 75:this.$=[Ie[Re-3],Ie[Re-1],{type:"addMessage",from:Ie[Re-3].actor,to:Ie[Re-1].actor,signalType:Ie[Re-2],msg:Ie[Re]}];break;case 76:this.$={type:"addParticipant",actor:Ie[Re-1],config:Ie[Re]};break;case 77:this.$=Ie[Re-1].trim();break;case 78:this.$={type:"addParticipant",actor:Ie[Re]};break;case 79:this.$=Pe.LINETYPE.SOLID_OPEN;break;case 80:this.$=Pe.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Pe.LINETYPE.SOLID;break;case 82:this.$=Pe.LINETYPE.SOLID_TOP;break;case 83:this.$=Pe.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Pe.LINETYPE.STICK_TOP;break;case 85:this.$=Pe.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Pe.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Pe.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Pe.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Pe.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Pe.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Pe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Pe.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Pe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Pe.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Pe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Pe.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Pe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Pe.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Pe.LINETYPE.DOTTED;break;case 100:this.$=Pe.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Pe.LINETYPE.SOLID_CROSS;break;case 102:this.$=Pe.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Pe.LINETYPE.SOLID_POINT;break;case 104:this.$=Pe.LINETYPE.DOTTED_POINT;break;case 105:this.$=Pe.parseMessage(Ie[Re].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},t(B,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),t(B,[2,15]),{13:49,51:M,53:I,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(B,[2,30]),t(B,[2,31]),{33:[1,62]},{35:[1,63]},t(B,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:F},{23:75,55:76,73:F},{23:77,73:N},{69:78,72:[1,79],78:G,79:z,80:W,81:V,82:H,83:te,84:Y,85:se,86:J,87:Z,88:ee,89:re,90:ge,91:ae,92:_e,93:Fe,94:qe,95:ue,96:de,97:Ce,98:me,99:$e,100:we,101:Le,102:Ye,103:ce},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ye),t(B,[2,6]),t(B,[2,16]),t(ke,[2,10],{11:114}),t(B,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(B,[2,22]),{5:[1,118]},{5:[1,119]},t(B,[2,25]),t(B,[2,26]),t(B,[2,27]),t(B,[2,28]),t(B,[2,29]),t(B,[2,32]),t(B,[2,33]),t(le,i,{7:120}),t(le,i,{7:121}),t(le,i,{7:122}),t(pe,i,{41:123,7:124}),t(U,i,{43:125,7:126}),t(U,i,{7:126,43:127}),t(oe,i,{46:128,7:129}),t(le,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(Q,ye,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:G,79:z,80:W,81:V,82:H,83:te,84:Y,85:se,86:J,87:Z,88:ee,89:re,90:ge,91:ae,92:_e,93:Fe,94:qe,95:ue,96:de,97:Ce,98:me,99:$e,100:we,101:Le,102:Ye,103:ce},t(fe,[2,79]),t(fe,[2,80]),t(fe,[2,81]),t(fe,[2,82]),t(fe,[2,83]),t(fe,[2,84]),t(fe,[2,85]),t(fe,[2,86]),t(fe,[2,87]),t(fe,[2,88]),t(fe,[2,89]),t(fe,[2,90]),t(fe,[2,91]),t(fe,[2,92]),t(fe,[2,93]),t(fe,[2,94]),t(fe,[2,95]),t(fe,[2,96]),t(fe,[2,97]),t(fe,[2,98]),t(fe,[2,99]),t(fe,[2,100]),t(fe,[2,101]),t(fe,[2,102]),t(fe,[2,103]),t(fe,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:j},{58:152,104:j},{58:153,104:j},{58:154,104:j},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:M,53:I,54:P},{5:[1,160]},t(B,[2,20]),t(B,[2,21]),t(B,[2,23]),t(B,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,50:[1,165],51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,49:[1,167],51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,48:[1,170],51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:x,39:w,40:C,42:k,44:S,45:E,47:L,51:M,53:I,54:P,56:$,61:_,62:R,63:O,64:D,73:N},{16:[1,172]},t(B,[2,50]),{16:[1,173]},t(B,[2,55]),t(Q,[2,76]),{76:[1,174]},{16:[1,175]},t(B,[2,52]),{16:[1,176]},t(B,[2,57]),t(B,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:j},{23:181,72:[1,182],73:N},{58:183,104:j},{58:184,104:j},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(B,[2,17]),t(ke,[2,11]),{13:186,51:M,53:I,54:P},t(ke,[2,13]),t(ke,[2,14]),t(B,[2,19]),t(B,[2,35]),t(B,[2,36]),t(B,[2,37]),t(B,[2,38]),{16:[1,187]},t(B,[2,39]),{16:[1,188]},t(B,[2,40]),t(B,[2,41]),{16:[1,189]},t(B,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:j},{58:196,104:j},{58:197,104:j},{5:[2,75]},{58:198,104:j},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(ke,[2,12]),t(pe,i,{7:124,41:201}),t(U,i,{7:126,43:202}),t(oe,i,{7:129,46:203}),t(B,[2,49]),t(B,[2,54]),t(Q,[2,77]),t(B,[2,51]),t(B,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:j},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:b(function(We,Ne){if(Ne.recoverable)this.trace(We);else{var Ze=new Error(We);throw Ze.hash=Ne,Ze}},"parseError"),parse:b(function(We){var Ne=this,Ze=[0],Pe=[],nt=[null],Ie=[],pt=this.table,Re="",kt=0,bt=0,lt=2,Nt=1,Ct=Ie.slice.call(arguments,1),dt=Object.create(this.lexer),ve={yy:{}};for(var _t in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_t)&&(ve.yy[_t]=this.yy[_t]);dt.setInput(We,ve.yy),ve.yy.lexer=dt,ve.yy.parser=this,typeof dt.yylloc>"u"&&(dt.yylloc={});var gt=dt.yylloc;Ie.push(gt);var ft=dt.options&&dt.options.ranges;typeof ve.yy.parseError=="function"?this.parseError=ve.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(ir){Ze.length=Ze.length-2*ir,nt.length=nt.length-ir,Ie.length=Ie.length-ir}b(Et,"popStack");function Nr(){var ir;return ir=Pe.pop()||dt.lex()||Nt,typeof ir!="number"&&(ir instanceof Array&&(Pe=ir,ir=Pe.pop()),ir=Ne.symbols_[ir]||ir),ir}b(Nr,"lex");for(var Ae,tt,ct,Mt,Wt={},gr,lr,Tr,fr;;){if(tt=Ze[Ze.length-1],this.defaultActions[tt]?ct=this.defaultActions[tt]:((Ae===null||typeof Ae>"u")&&(Ae=Nr()),ct=pt[tt]&&pt[tt][Ae]),typeof ct>"u"||!ct.length||!ct[0]){var Or="";fr=[];for(gr in pt[tt])this.terminals_[gr]&&gr>lt&&fr.push("'"+this.terminals_[gr]+"'");dt.showPosition?Or="Parse error on line "+(kt+1)+`: +`+dt.showPosition()+` +Expecting `+fr.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Or="Parse error on line "+(kt+1)+": Unexpected "+(Ae==Nt?"end of input":"'"+(this.terminals_[Ae]||Ae)+"'"),this.parseError(Or,{text:dt.match,token:this.terminals_[Ae]||Ae,line:dt.yylineno,loc:gt,expected:fr})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+tt+", token: "+Ae);switch(ct[0]){case 1:Ze.push(Ae),nt.push(dt.yytext),Ie.push(dt.yylloc),Ze.push(ct[1]),Ae=null,bt=dt.yyleng,Re=dt.yytext,kt=dt.yylineno,gt=dt.yylloc;break;case 2:if(lr=this.productions_[ct[1]][1],Wt.$=nt[nt.length-lr],Wt._$={first_line:Ie[Ie.length-(lr||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(lr||1)].first_column,last_column:Ie[Ie.length-1].last_column},ft&&(Wt._$.range=[Ie[Ie.length-(lr||1)].range[0],Ie[Ie.length-1].range[1]]),Mt=this.performAction.apply(Wt,[Re,bt,kt,ve.yy,ct[1],nt,Ie].concat(Ct)),typeof Mt<"u")return Mt;lr&&(Ze=Ze.slice(0,-1*lr*2),nt=nt.slice(0,-1*lr),Ie=Ie.slice(0,-1*lr)),Ze.push(this.productions_[ct[1]][0]),nt.push(Wt.$),Ie.push(Wt._$),Tr=pt[Ze[Ze.length-2]][Ze[Ze.length-1]],Ze.push(Tr);break;case 3:return!0}}return!0},"parse")},Se=(function(){var De={EOF:1,parseError:b(function(Ne,Ze){if(this.yy.parser)this.yy.parser.parseError(Ne,Ze);else throw new Error(Ne)},"parseError"),setInput:b(function(We,Ne){return this.yy=Ne||this.yy||{},this._input=We,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var We=this._input[0];this.yytext+=We,this.yyleng++,this.offset++,this.match+=We,this.matched+=We;var Ne=We.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),We},"input"),unput:b(function(We){var Ne=We.length,Ze=We.split(/(?:\r\n?|\n)/g);this._input=We+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var Pe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Ze.length-1&&(this.yylineno-=Ze.length-1);var nt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ze?(Ze.length===Pe.length?this.yylloc.first_column:0)+Pe[Pe.length-Ze.length].length-Ze[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[nt[0],nt[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(We){this.unput(this.match.slice(We))},"less"),pastInput:b(function(){var We=this.matched.substr(0,this.matched.length-this.match.length);return(We.length>20?"...":"")+We.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var We=this.match;return We.length<20&&(We+=this._input.substr(0,20-We.length)),(We.substr(0,20)+(We.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var We=this.pastInput(),Ne=new Array(We.length+1).join("-");return We+this.upcomingInput()+` +`+Ne+"^"},"showPosition"),test_match:b(function(We,Ne){var Ze,Pe,nt;if(this.options.backtrack_lexer&&(nt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(nt.yylloc.range=this.yylloc.range.slice(0))),Pe=We[0].match(/(?:\r\n?|\n).*/g),Pe&&(this.yylineno+=Pe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Pe?Pe[Pe.length-1].length-Pe[Pe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+We[0].length},this.yytext+=We[0],this.match+=We[0],this.matches=We,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(We[0].length),this.matched+=We[0],Ze=this.performAction.call(this,this.yy,this,Ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ze)return Ze;if(this._backtrack){for(var Ie in nt)this[Ie]=nt[Ie];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var We,Ne,Ze,Pe;this._more||(this.yytext="",this.match="");for(var nt=this._currentRules(),Ie=0;IeNe[0].length)){if(Ne=Ze,Pe=Ie,this.options.backtrack_lexer){if(We=this.test_match(Ze,nt[Ie]),We!==!1)return We;if(this._backtrack){Ne=!1;continue}else return!1}else if(!this.options.flex)break}return Ne?(We=this.test_match(Ne,nt[Pe]),We!==!1?We:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var Ne=this.next();return Ne||this.lex()},"lex"),begin:b(function(Ne){this.conditionStack.push(Ne)},"begin"),popState:b(function(){var Ne=this.conditionStack.length-1;return Ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(Ne){return Ne=this.conditionStack.length-1-Math.abs(Ne||0),Ne>=0?this.conditionStack[Ne]:"INITIAL"},"topState"),pushState:b(function(Ne){this.begin(Ne)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(Ne,Ze,Pe,nt){switch(Pe){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Ze.yytext=Ze.yytext.trim(),73;case 12:return Ze.yytext=Ze.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ze.yytext=Ze.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ze.yytext=Ze.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Ze.yytext=Ze.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return De})();Be.lexer=Se;function He(){this.yy={}}return b(He,"Parser"),He.prototype=Be,Be.Parser=He,new He})();dF.parser=dF;var Jpt=dF,e0t={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},t0t={FILLED:0,OPEN:1},r0t={LEFTOF:0,RIGHTOF:1,OVER:2},KA={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},n0t=(B2=class{constructor(){this.state=new uN(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=qn,this.setAccDescription=Jn,this.setDiagramTitle=ti,this.getAccTitle=Qn,this.getAccDescription=ei,this.getDiagramTitle=Vn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Ve().wrap),this.LINETYPE=e0t,this.ARROWTYPE=t0t,this.PLACEMENT=r0t}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` -}`,o=N4(u,{schema:M4})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=$e().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Dn()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ae.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?qr(s,$e()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=qr(r.text,$e());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ae.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=qr(r.text,$e());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){ae.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=qr(r.text,$e()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ae.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){ae.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Mn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return $e().sequence}},T(Vv,"SequenceDB"),Vv),ict=T(t=>{const e=t.dropShadow??"none",{look:r}=$e();return`.actor { +}`,o=N4(u,{schema:D4})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Ve().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),zn()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return he.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?Qr(s,Ve()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Qr(r.text,Ve());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){he.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Qr(r.text,Ve());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){he.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Qr(r.text,Ve()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){he.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){he.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":qn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Ve().sequence}},b(B2,"SequenceDB"),B2),i0t=b(t=>{const e=t.dropShadow??"none",{look:r}=Ve();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -2008,25 +2023,25 @@ Expecting `+sr.join(", ")+", got '"+(this.terminals_[me]||me)+"'":Rr="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),act=ict,ep=36,Dh="actor-top",Mh="actor-bottom",LS="actor-box",tp="actor-man",pu=new Set(["redux-color","redux-dark-color"]),QT=T(function(t,e){const r=x3(t,e);return lr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),sct=T(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=ud.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),Rct(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),IS=T(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),DS=T(async function(t,e,r=null){let n=t.append("foreignObject");const i=await Nw(e.text,lr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),nm=T(function(t,e){let r=0,n=0;const i=e.text.split(It.lineBreakRegex),[a,s]=Tc(e.fontSize);let o=[],l=0,u=T(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=T(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=T(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=T(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||hV;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),lme=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,nm(t,e),n},"drawLabel"),Vr=-1,cme=T((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),oct=T(function(t,e,r,n,i){var w,k;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",IS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Hs();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Mh}`:y+=` ${Dh}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=QT(g,m),x=i.get(e.name)??0;if(pu.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?bI(g,m.x+m.width-20,m.y+10,S.substr(1)):vI(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),gu(r,ci(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${LS}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),lct=T(function(t,e,r,n,i){var C,_;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",IS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Hs();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Mh}`:y+=` ${Dh}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=QT(g,m),w=QT(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(pu.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(_=e.properties)!=null&&_.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?bI(g,m.x+m.width-20,m.y+10,L.substr(1)):vI(g,m.x+m.width-20,m.y+10,L)}gu(r,ci(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${LS}`},r);let S=e.height;if(b.node){const L=b.node().getBBox();e.height=L.height,S=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),cct=T(function(t,e,r,n,i){var L,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",IS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Hs();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Mh}`:y+=` ${Dh}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,x=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),k=`M ${m.x},${m.y+v} - a ${x},${v} 0 0 0 0,${m.height} - h ${m.width-2*x} - a ${x},${v} 0 0 0 0,-${m.height} +`},"getStyles"),a0t=i0t,Wp=36,pd="actor-top",gd="actor-bottom",ZA="actor-box",qp="actor-man",Xu=new Set(["redux-color","redux-dark-color"]),jw=b(function(t,e){const r=GE(t,e);return sr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),s0t=b(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=Xd.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),R0t(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),QA=b(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),JA=b(async function(t,e,r=null){let n=t.append("foreignObject");const i=await NC(e.text,sr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),Km=b(function(t,e){let r=0,n=0;const i=e.text.split($t.lineBreakRegex),[a,s]=Zc(e.fontSize);let o=[],l=0,u=b(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=b(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=b(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=b(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||nH;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),j2e=b(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}b(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,Km(t,e),n},"drawLabel"),rn=-1,K2e=b((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),o0t=b(function(t,e,r,n,i){var w,C;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(rn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",QA(`actor${rn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=rn,e.links!=null&&g.attr("id","root-"+rn),l==="neo"&&g.attr("data-look","neo"));const m=vo();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${gd}`:y+=` ${pd}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=jw(g,m),T=i.get(e.name)??0;if(Xu.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?KD(g,m.x+m.width-20,m.y+10,k.substr(1)):jD(g,m.x+m.width-20,m.y+10,k)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),ju(r,Li(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${ZA}`},r);let x=e.height;if(v.node){const k=v.node().getBBox();e.height=k.height,x=k.height}return x},"drawActorTypeParticipant"),l0t=b(function(t,e,r,n,i){var S,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(rn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",QA(`actor${rn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=rn,e.links!=null&&g.attr("id","root-"+rn),l==="neo"&&g.attr("data-look","neo"));const m=vo();var y="actor";(S=e.properties)!=null&&S.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${gd}`:y+=` ${pd}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},x=jw(g,m),w=jw(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(Xu.has(u)&&(x.style("stroke",f[C%f.length]),x.style("fill",d[C%f.length]),w.style("stroke",f[C%f.length]),w.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?KD(g,m.x+m.width-20,m.y+10,L.substr(1)):jD(g,m.x+m.width-20,m.y+10,L)}ju(r,Li(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${ZA}`},r);let k=e.height;if(x.node){const L=x.node().getBBox();e.height=L.height,k=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),k},"drawActorTypeCollections"),c0t=b(function(t,e,r,n,i){var L,M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(rn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",QA(`actor${rn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=rn,e.links!=null&&g.attr("id","root-"+rn),l==="neo"&&g.attr("data-look","neo"));const m=vo();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${gd}`:y+=` ${pd}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),x=g.append("g"),w=g.append("g"),C=`M ${m.x},${m.y+v} + a ${T},${v} 0 0 0 0,${m.height} + h ${m.width-2*T} + a ${T},${v} 0 0 0 0,-${m.height} Z - `;b.append("path").attr("d",k),w.append("path").attr("d",`M ${m.x},${m.y+v} - a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(pu.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(O=e.properties)!=null&&O.icon){const D=e.properties.icon.trim(),z=m.x+m.width-20,F=m.y+10;D.charAt(0)==="@"?bI(g,z,F,D.substr(1)):vI(g,z,F,D)}gu(r,ci(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${LS}`},r);let C=e.height;const _=b.select("path:last-child");if(_.node()){const D=_.node().getBBox();e.height=D.height,C=D.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),uct=T(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Vr++,y.append("line").attr("id","actor"+Vr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const v=t.append("g");let x=tp;n?x+=` ${Mh}`:x+=` ${Dh}`,v.attr("class",x),v.attr("name",e.name);const b=Hs();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,k=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",k).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${k-S})`);const C=a.get(e.name)??0;pu.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const _=v.node().getBBox();return e.height=_.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),gu(r,ci(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${tp}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),hct=T(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Mh}`:m+=` ${Dh}`,g.attr("class",m),g.attr("name",e.name);const y=Hs();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,x=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;pu.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const k=g.node().getBBox();return e.height=k.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Vr++,p.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr),gu(r,ci(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${tp}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),dct=T(function(t,e,r,n,i){var O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",IS(`actor${Vr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Vr,e.links!=null&&m.attr("id","root-"+Vr),h==="neo"&&m.attr("data-look","neo"));const y=Hs();let v="actor";(O=e.properties)!=null&&O.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Mh}`:v+=` ${Dh}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const x=y.width/3,b=y.width/3,w=x/2,k=w/(2.5+x/50),S=m.append("g");S.attr("class",v);const C=` - M ${y.x},${y.y+k} - a ${w},${k} 0 0 0 ${x},0 - a ${w},${k} 0 0 0 -${x},0 - l 0,${b-2*k} - a ${w},${k} 0 0 0 ${x},0 - l 0,-${b-2*k} -`;S.append("path").attr("d",C),h==="neo"&&S.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;pu.has(l)?(S.style("stroke",f[_%f.length]),S.style("fill",d[_%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${k})`),e.rectData=y,gu(r,ci(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${LS}`},r);const L=S.select("path:last-child");if(L.node()){const D=L.node().getBBox();e.height=D.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),fct=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Vr++,u.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const y=t.append("g");let v=tp;n?v+=` ${Mh}`:v+=` ${Dh}`,y.attr("class",v),y.attr("name",e.name);const x=Hs();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;pu.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),gu(r,ci(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${tp}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),pct=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Vr++,g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const m=t.append("g");let y=tp;n?y+=` ${Mh}`:y+=` ${Dh}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,x=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Vr).attr("x1",s).attr("y1",x+25*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Vr).attr("x1",s-ep/2*v).attr("y1",x+33*v).attr("x2",s+ep/2*v).attr("y2",x+33*v),m.append("line").attr("x1",s-ep/2*v).attr("y1",x+60*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("x1",s).attr("y1",x+45*v).attr("x2",s+(ep/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const k=Hs();k.x=e.x,k.y=x,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const S=i.get(e.name)??0;return pu.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),gu(r,ci(e.description))(e.description,m,k.x,x+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${tp}`},r),e.height},"drawActorTypeActor"),gct=T(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await pct(t,e,r,n,o);case"participant":return await oct(t,e,r,n,o);case"boundary":return await fct(t,e,r,n,o);case"control":return await uct(t,e,r,n,i,o);case"entity":return await hct(t,e,r,n,o);case"database":return await dct(t,e,r,n,o);case"collections":return await lct(t,e,r,n,o);case"queue":return await cct(t,e,r,n,o)}},"drawActor"),mct=T(function(t,e,r){const i=t.append("g");ume(i,e),e.name&&gu(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),yct=T(function(t){return t.append("g")},"anchorElement"),vct=T(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Hs(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=QT(p,f),v=(s??new Map([...a.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;pu.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),bct=T(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=T(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=xI();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",lme(f,g),g=hme(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ci(g.text)?await DS(f,g,e):nm(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,ci(g.text)?(e.starty=e.sections[y].y,await DS(f,g,e)):nm(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=x-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),ume=T(function(t,e){Dte(t,e)},"drawBackgroundRect"),xct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Tct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),wct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Cct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),kct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Ect=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Sct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),Act=T(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),hme=T(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),_ct=T(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),gu=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}T(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Tc(p),x=a.split(It.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:T(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:T(function(t){this.boxes.push(t)},"addBox"),addActor:T(function(t){this.actors.push(t)},"addActor"),addLoop:T(function(t){this.loops.push(t)},"addLoop"),addMessage:T(function(t){this.messages.push(t)},"addMessage"),addNote:T(function(t){this.notes.push(t)},"addNote"),lastActor:T(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:T(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:T(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:T(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:T(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,gme($e())},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=this;let a=0;function s(o){return T(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Xe.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Xe.boxMargin,Math.max),i.updateVal(wt.data,"startx",t-h*Xe.boxMargin,Math.min),i.updateVal(wt.data,"stopx",r+h*Xe.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Xe.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Xe.boxMargin,Math.max),i.updateVal(wt.data,"starty",e-h*Xe.boxMargin,Math.min),i.updateVal(wt.data,"stopy",n+h*Xe.boxMargin,Math.max))},"updateItemBounds")}T(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:T(function(t,e,r,n){const i=It.getMin(t,r),a=It.getMax(t,r),s=It.getMin(e,n),o=It.getMax(e,n);this.updateVal(wt.data,"startx",i,Math.min),this.updateVal(wt.data,"starty",s,Math.min),this.updateVal(wt.data,"stopx",a,Math.max),this.updateVal(wt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:T(function(t,e,r){const n=r.get(t.from),i=MS(t.from).length||0,a=n.x+n.width/2+(i-1)*Xe.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Xe.activationWidth,stopy:void 0,actor:t.from,anchored:Ln.anchorElement(e)})},"newActivation"),endActivation:T(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:T(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:T(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:T(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:T(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:T(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:wt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:T(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:T(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=It.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return{bounds:this.data,models:this.models}},"getBounds")},Nct=T(async function(t,e,r){wt.bumpVerticalPos(Xe.boxMargin),e.height=Xe.boxMargin,e.starty=wt.getVerticalPos();const n=Hs();n.x=e.startx,n.y=e.starty,n.width=e.width||Xe.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Ln.drawRect(i,n),s=xI();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Xe.noteFontFamily,s.fontSize=Xe.noteFontSize,s.fontWeight=Xe.noteFontWeight,s.anchor=Xe.noteAlign,s.textMargin=Xe.noteMargin,s.valign="center";const o=ci(s.text)?await DS(i,s):nm(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Xe.noteMargin),e.height+=l+2*Xe.noteMargin,wt.bumpVerticalPos(l+2*Xe.noteMargin),e.stopy=e.starty+l+2*Xe.noteMargin,e.stopx=e.startx+n.width,wt.insert(e.startx,e.starty,e.stopx,e.stopy),wt.models.addNote(e)},"drawNote"),dme=T(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=xme(e,n),m=t.append("g"),y=16.5,v=T((S,C)=>{const _=S?y:-y;return C?-_:_},"getCircleOffset"),x=T(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case w:x(d);break;case k:x(d),x(f);break}},"drawCentralConnection"),rp=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),im=T(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),I$=T(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function fme(t,e){wt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=It.splitBreaks(i).length,s=ci(i),o=s?await p2(i,$e()):Lr.calculateTextDimensions(i,rp(Xe));if(!s){const d=o.height/a;e.height+=d,wt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=wt.getVerticalPos()+u,Xe.rightAngles||(u+=Xe.boxMargin,l=wt.getVerticalPos()+u),u+=30;const d=It.getMax(h/2,Xe.width/2);wt.insert(r-d,wt.getVerticalPos()-10+u,n+d,wt.getVerticalPos()+30+u)}else u+=Xe.boxMargin,l=wt.getVerticalPos()+u,wt.insert(r,l-10,n,l);return wt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,wt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}T(fme,"boundMessage");var Oct=T(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Lr.calculateTextDimensions(u,rp(Xe)),g=xI();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Xe.messageFontFamily,g.fontSize=Xe.messageFontSize,g.fontWeight=Xe.messageFontWeight,g.anchor=Xe.messageAlign,g.valign="center",g.textMargin=Xe.wrapPadding,g.tspan=!1,ci(g.text)?await DS(t,g,{startx:s,stopx:o,starty:r}):nm(t,g);const m=p.width;let y;if(s===o){const x=f||Xe.showSequenceNumbers,b=xme(i,n),w=qct(i,n),k=s+(x&&(b||w)?10:0);Xe.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+It.getMax(Xe.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),M$(i,n)&&dme(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),M$(i,n)&&dme(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Xe.arrowMarkerAbsolute&&(v=Mw(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Xe.showSequenceNumbers){const x=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,k=M$(i,n);let S=s,C=o;x?(ss?C=o-2*w:(C=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),C+=k?15:0,y.attr("x2",C),y.attr("x1",S)):y.attr("x1",s+w);let _=0;const L=s===o,O=s<=o;L?_=e.fromBounds+1:b?_=O?e.toBounds-1:e.fromBounds+1:_=O?e.fromBounds+1:e.toBounds-1;let D="12px";const z=d.toString().length;z>5?D="7px":z>3&&(D="9px"),t.append("line").attr("x1",_).attr("y1",r).attr("x2",_).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",_).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",D).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),$ct=T(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||wt.models.addBox(u),l+=Xe.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=It.getMax(f.width||Xe.width,Xe.width),f.height=It.getMax(f.height||Xe.height,Xe.height),f.margin=f.margin||Xe.actorMargin,h=It.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=wt.getVerticalPos(),wt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,wt.models.addActor(f)}u&&!s&&wt.models.addBox(u),wt.bumpVerticalPos(h)},"addActorRenderingData"),D$=T(async function(t,e,r,n,i,a,s){if(n){let o=0;wt.bumpVerticalPos(Xe.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=wt.getVerticalPos());const h=await Ln.drawActor(t,u,Xe,!0,i,a,s);o=It.getMax(o,h)}wt.bumpVerticalPos(o+Xe.boxMargin)}else for(const o of r){const l=e.get(o);await Ln.drawActor(t,l,Xe,!1,i,a,s)}},"drawActors"),pme=T(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=Bct(o),u=Ln.drawPopup(t,o,l,Xe,Xe.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),gme=T(function(t){li(Xe,t),t.fontFamily&&(Xe.actorFontFamily=Xe.noteFontFamily=Xe.messageFontFamily=t.fontFamily),t.fontSize&&(Xe.actorFontSize=Xe.noteFontSize=Xe.messageFontSize=t.fontSize),t.fontWeight&&(Xe.actorFontWeight=Xe.noteFontWeight=Xe.messageFontWeight=t.fontWeight)},"setConf"),MS=T(function(t){return wt.activations.filter(function(e){return e.actor===t})},"actorActivations"),mme=T(function(t,e){const r=e.get(t),n=MS(t),i=n.reduce(function(s,o){return It.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return It.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Jo(t,e,r,n,i){wt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=rp(Xe);e.message=Lr.wrapLabel(`[${e.message}]`,s-2*Xe.wrapPadding,o),e.width=s,e.wrap=!0;const l=Lr.calculateTextDimensions(e.message,o),u=It.getMax(l.height,Xe.labelBoxHeight);a=n+u,ae.debug(`${u} - ${e.message}`)}i(e),wt.bumpVerticalPos(a)}T(Jo,"adjustLoopHeightForWrap");function yme(t,e,r,n,i,a,s){function o(h,d){h.x{B.add(q.from),B.add(q.to)}),m=m.filter(q=>B.has(q))}const k=new Map(m.map((B,q)=>{var V;return[((V=d.get(B))==null?void 0:V.name)??B,q]}));$ct(h,d,f,m,0,y,!1);const S=await Wct(y,d,w,n);Ln.insertArrowHead(h,e),Ln.insertArrowCrossHead(h,e),Ln.insertArrowFilledHead(h,e),Ln.insertSequenceNumber(h,e),Ln.insertSolidTopArrowHead(h,e),Ln.insertSolidBottomArrowHead(h,e),Ln.insertStickTopArrowHead(h,e),Ln.insertStickBottomArrowHead(h,e),s==="neo"&&Ln.insertDropShadow(h,Xe);function C(B,q){const V=wt.endActivation(B);V.starty+18>q&&(V.starty=q-6,q+=12),Ln.drawActivation(h,V,q,Xe,MS(B.from).length,n,k),wt.insert(V.startx,q-10,V.stopx,q)}T(C,"activeEnd");let _=1,L=1;const O=[],D=[];let z=0;for(const B of y){let q,V,X;switch(B.type){case n.db.LINETYPE.NOTE:wt.resetVerticalPos(),V=B.noteModel,await Nct(h,V,B.id);break;case n.db.LINETYPE.ACTIVE_START:wt.newActivation(B,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION:wt.newActivation(B,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:wt.newActivation(B,h,d);break;case n.db.LINETYPE.ACTIVE_END:C(B,wt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W));break;case n.db.LINETYPE.LOOP_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"loop",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;case n.db.LINETYPE.RECT_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin,W=>wt.newLoop(void 0,W.message));break;case n.db.LINETYPE.RECT_END:q=wt.endLoop(),D.push(q),wt.models.addLoop(q),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W));break;case n.db.LINETYPE.OPT_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"opt",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;case n.db.LINETYPE.ALT_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W));break;case n.db.LINETYPE.ALT_ELSE:Jo(S,B,Xe.boxMargin+Xe.boxTextMargin,Xe.boxMargin,W=>wt.addSectionToLoop(W));break;case n.db.LINETYPE.ALT_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"alt",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W)),wt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Jo(S,B,Xe.boxMargin+Xe.boxTextMargin,Xe.boxMargin,W=>wt.addSectionToLoop(W));break;case n.db.LINETYPE.PAR_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"par",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;case n.db.LINETYPE.AUTONUMBER:_=B.message.start||_,L=B.message.step||L,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W));break;case n.db.LINETYPE.CRITICAL_OPTION:Jo(S,B,Xe.boxMargin+Xe.boxTextMargin,Xe.boxMargin,W=>wt.addSectionToLoop(W));break;case n.db.LINETYPE.CRITICAL_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"critical",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;case n.db.LINETYPE.BREAK_START:Jo(S,B,Xe.boxMargin,Xe.boxMargin+Xe.boxTextMargin,W=>wt.newLoop(W));break;case n.db.LINETYPE.BREAK_END:q=wt.endLoop(),await Ln.drawLoop(h,q,"break",Xe,B),wt.bumpVerticalPos(q.stopy-wt.getVerticalPos()),wt.models.addLoop(q);break;default:try{X=B.msgModel,X.starty=wt.getVerticalPos(),X.sequenceIndex=_,X.sequenceVisible=n.db.showSequenceNumbers(),X.id=B.id,X.from=B.from,X.to=B.to;const W=await fme(h,X);yme(B,X,W,z,d,f,p),O.push({messageModel:X,lineStartY:W,msg:B}),wt.models.addMessage(X)}catch(W){ae.error("error while drawing message",W)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(_=Math.round((_+L)*100)/100),z++}ae.debug("createdActors",f),ae.debug("destroyedActors",p),await D$(h,d,m,!1,e,n,k);for(const B of O)await Oct(h,B.messageModel,B.lineStartY,n,B.msg,e);Xe.mirrorActors&&await D$(h,d,m,!0,e,n,k),D.forEach(B=>Ln.drawBackgroundRect(h,B)),cme(h,d,m,Xe);for(const B of wt.models.boxes){B.height=wt.getVerticalPos()-B.y,wt.insert(B.x,B.y,B.x+B.width,B.height);const q=Xe.boxMargin*2;B.startx=B.x-q,B.starty=B.y-q*.25,B.stopx=B.startx+B.width+2*q,B.stopy=B.starty+B.height+q*.75,B.stroke="rgb(0,0,0, 0.5)",Ln.drawBox(h,B,Xe)}x&&wt.bumpVerticalPos(Xe.boxMargin);const F=pme(h,d,m,u),{bounds:A}=wt.getBounds();A.startx===void 0&&(A.startx=0),A.starty===void 0&&(A.starty=0),A.stopx===void 0&&(A.stopx=0),A.stopy===void 0&&(A.stopy=0);let R=A.stopy-A.starty;R{const s=rp(Xe);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Xe.boxMargin*8;o+=l,o-=2*Xe.boxTextMargin,a.wrap&&(a.name=Lr.wrapLabel(a.name,o-2*Xe.wrapPadding,s));const u=Lr.calculateTextDimensions(a.name,s);i=It.getMax(u.height,i);const h=It.getMax(o,u.width+2*Xe.wrapPadding);if(a.margin=Xe.boxTextMargin,oa.textMaxHeight=i),It.getMax(n,Xe.height)}T(bme,"calculateActorMargins");var Fct=T(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=ci(t.message)?await p2(t.message,$e()):Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Xe.width,im(Xe)):t.message,im(Xe));const u={width:o?Xe.width:It.getMax(Xe.width,l.width+2*Xe.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?It.getMax(Xe.width,l.width):It.getMax(n.width/2+i.width/2,l.width+2*Xe.noteMargin),u.startx=a+(n.width+Xe.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?It.getMax(Xe.width,l.width+2*Xe.noteMargin):It.getMax(n.width/2+i.width/2,l.width+2*Xe.noteMargin),u.startx=a-u.width+(n.width-Xe.actorMargin)/2):t.to===t.from?(l=Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,It.getMax(Xe.width,n.width),im(Xe)):t.message,im(Xe)),u.width=o?It.getMax(Xe.width,n.width):It.getMax(n.width,Xe.width,l.width+2*Xe.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Xe.actorMargin,u.startx=a2,f=T(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Xe.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Lr.wrapLabel(t.message,It.getMax(g+2*Xe.wrapPadding,Xe.width),rp(Xe)));const m=Lr.calculateTextDimensions(t.message,rp(Xe));return{width:It.getMax(t.wrap?0:m.width+2*Xe.wrapPadding,g+2*Xe.wrapPadding,Xe.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Wct=T(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=MS(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Xe.activationWidth/2,g={startx:p,stopx:p+Xe.activationWidth,actor:u.from,enabled:!0};wt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=wt.activations.map(f=>f.actor).lastIndexOf(u.from);wt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await Fct(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=It.getMin(s.from,o.startx),s.to=It.getMax(s.to,o.startx+o.width),s.width=It.getMax(s.width,Math.abs(s.from-s.to))-Xe.labelBoxWidth})):(l=Vct(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=It.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=It.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=It.getMax(s.width,Math.abs(s.to-s.from))-Xe.labelBoxWidth}else s.from=It.getMin(l.startx,s.from),s.to=It.getMax(l.stopx,s.to),s.width=It.getMax(s.width,l.width)-Xe.labelBoxWidth}))}return wt.activations=[],ae.debug("Loop type widths:",i),i},"calculateLoopBounds"),Uct={bounds:wt,drawActors:D$,drawActorsPopup:pme,setConf:gme,draw:Pct},Hct={parser:Jlt,get db(){return new nct},renderer:Uct,styles:act,init:T(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,q6({sequence:{wrap:t.wrap}}))},"init")};const Yct=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hct},Symbol.toStringTag,{value:"Module"}));var N$=(function(){var t=T(function(tt,Ze,Ee,Se){for(Ee=Ee||{},Se=tt.length;Se--;Ee[tt[Se]]=Ze);return Ee},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],k=[1,31],S=[1,44],C=[1,46],_=[1,43],L=[1,47],O=[1,9],D=[1,8,9],z=[1,58],F=[1,59],A=[1,60],R=[1,61],N=[1,62],M=[1,63],I=[1,64],$=[1,8,9,41],P=[1,77],B=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],q=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],X=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],ie=[1,103],K=[1,121],se=[1,117],te=[1,113],Z=[1,119],ee=[1,114],ne=[1,115],oe=[1,116],fe=[1,118],Ae=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],Ce=[12,39],be=[1,8,9,39,41,44,46],Fe=[1,8,9,22],ye=[1,153],He=[1,8,9,61],xe=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ve={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:T(function(Ze,Ee,Se,Y,ce,j,pe){var re=j.length-1;switch(ce){case 8:this.$=j[re-1];break;case 9:case 10:case 13:case 15:this.$=j[re];break;case 11:case 14:this.$=j[re-2]+"."+j[re];break;case 12:case 16:this.$=j[re-1]+j[re];break;case 17:case 18:this.$=j[re-1]+"~"+j[re]+"~";break;case 19:Y.addRelation(j[re]);break;case 20:j[re-1].title=Y.cleanupLabel(j[re]),Y.addRelation(j[re-1]);break;case 31:this.$=j[re].trim(),Y.setAccTitle(this.$);break;case 32:case 33:this.$=j[re].trim(),Y.setAccDescription(this.$);break;case 34:Y.addClassesToNamespace(j[re-3],j[re-1][0],j[re-1][1]),Y.popNamespace();break;case 35:Y.addClassesToNamespace(j[re-4],j[re-1][0],j[re-1][1]),Y.popNamespace();break;case 36:this.$=Y.addNamespace(j[re]);break;case 37:this.$=Y.addNamespace(j[re-1],j[re]);break;case 38:this.$=[[j[re]],[]];break;case 39:this.$=[[j[re-1]],[]];break;case 40:j[re][0].unshift(j[re-2]),this.$=j[re];break;case 41:this.$=[[],[j[re]]];break;case 42:this.$=[[],[j[re-1]]];break;case 43:j[re][1].unshift(j[re-2]),this.$=j[re];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[re];break;case 48:Y.setCssClass(j[re-2],j[re]);break;case 49:Y.addMembers(j[re-3],j[re-1]);break;case 51:Y.setCssClass(j[re-5],j[re-3]),Y.addMembers(j[re-5],j[re-1]);break;case 52:Y.addAnnotation(j[re-3],j[re-1]);break;case 53:Y.addAnnotation(j[re-6],j[re-4]),Y.addMembers(j[re-6],j[re-1]);break;case 54:Y.addAnnotation(j[re-5],j[re-3]);break;case 55:this.$=j[re],Y.addClass(j[re]);break;case 56:this.$=j[re-1],Y.addClass(j[re-1]),Y.setClassLabel(j[re-1],j[re]);break;case 60:Y.addAnnotation(j[re],j[re-2]);break;case 61:case 74:this.$=[j[re]];break;case 62:j[re].push(j[re-1]),this.$=j[re];break;case 63:break;case 64:Y.addMember(j[re-1],Y.cleanupLabel(j[re]));break;case 65:break;case 66:break;case 67:this.$={id1:j[re-2],id2:j[re],relation:j[re-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[re-3],id2:j[re],relation:j[re-1],relationTitle1:j[re-2],relationTitle2:"none"};break;case 69:this.$={id1:j[re-3],id2:j[re],relation:j[re-2],relationTitle1:"none",relationTitle2:j[re-1]};break;case 70:this.$={id1:j[re-4],id2:j[re],relation:j[re-2],relationTitle1:j[re-3],relationTitle2:j[re-1]};break;case 71:this.$=Y.addNote(j[re],j[re-1]);break;case 72:this.$=Y.addNote(j[re]);break;case 73:this.$=j[re-2],Y.defineClass(j[re-1],j[re]);break;case 75:this.$=j[re-2].concat([j[re]]);break;case 76:Y.setDirection("TB");break;case 77:Y.setDirection("BT");break;case 78:Y.setDirection("RL");break;case 79:Y.setDirection("LR");break;case 80:this.$={type1:j[re-2],type2:j[re],lineType:j[re-1]};break;case 81:this.$={type1:"none",type2:j[re],lineType:j[re-1]};break;case 82:this.$={type1:j[re-1],type2:"none",lineType:j[re]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[re]};break;case 84:this.$=Y.relationType.AGGREGATION;break;case 85:this.$=Y.relationType.EXTENSION;break;case 86:this.$=Y.relationType.COMPOSITION;break;case 87:this.$=Y.relationType.DEPENDENCY;break;case 88:this.$=Y.relationType.LOLLIPOP;break;case 89:this.$=Y.lineType.LINE;break;case 90:this.$=Y.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[re-2],Y.setClickEvent(j[re-1],j[re]);break;case 92:case 98:this.$=j[re-3],Y.setClickEvent(j[re-2],j[re-1]),Y.setTooltip(j[re-2],j[re]);break;case 93:this.$=j[re-2],Y.setLink(j[re-1],j[re]);break;case 94:this.$=j[re-3],Y.setLink(j[re-2],j[re-1],j[re]);break;case 95:this.$=j[re-3],Y.setLink(j[re-2],j[re-1]),Y.setTooltip(j[re-2],j[re]);break;case 96:this.$=j[re-4],Y.setLink(j[re-3],j[re-2],j[re]),Y.setTooltip(j[re-3],j[re-1]);break;case 99:this.$=j[re-3],Y.setClickEvent(j[re-2],j[re-1],j[re]);break;case 100:this.$=j[re-4],Y.setClickEvent(j[re-3],j[re-2],j[re-1]),Y.setTooltip(j[re-3],j[re]);break;case 101:this.$=j[re-3],Y.setLink(j[re-2],j[re]);break;case 102:this.$=j[re-4],Y.setLink(j[re-3],j[re-1],j[re]);break;case 103:this.$=j[re-4],Y.setLink(j[re-3],j[re-1]),Y.setTooltip(j[re-3],j[re]);break;case 104:this.$=j[re-5],Y.setLink(j[re-4],j[re-2],j[re]),Y.setTooltip(j[re-4],j[re-1]);break;case 105:this.$=j[re-2],Y.setCssStyle(j[re-1],j[re]);break;case 106:Y.setCssClass(j[re-1],j[re]);break;case 107:this.$=[j[re]];break;case 108:j[re-2].push(j[re]),this.$=j[re-2];break;case 110:this.$=j[re-1]+j[re];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(O,[2,5],{8:[1,48]}),{8:[1,49]},t(D,[2,19],{22:[1,50]}),t(D,[2,21]),t(D,[2,22]),t(D,[2,23]),t(D,[2,24]),t(D,[2,25]),t(D,[2,26]),t(D,[2,27]),t(D,[2,28]),t(D,[2,29]),t(D,[2,30]),{34:[1,51]},{36:[1,52]},t(D,[2,33]),t(D,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:z,69:F,70:A,71:R,72:N,73:M,74:I}),{39:[1,65]},t($,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(D,[2,65]),t(D,[2,66]),{16:69,60:f,86:S,100:C,102:_},{16:39,17:40,19:70,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:71,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:72,60:f,86:S,100:C,102:_,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:C,102:_,103:L},{13:P,55:76},{58:78,60:[1,79]},t(D,[2,76]),t(D,[2,77]),t(D,[2,78]),t(D,[2,79]),t(B,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:C,102:_,103:L}),t(B,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:87,60:f,86:S,100:C,102:_,103:L},t(q,[2,133]),t(q,[2,134]),t(q,[2,135]),t(q,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(O,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L},t(D,[2,20]),t(D,[2,31]),t(D,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:C,102:_,103:L},{53:92,66:56,67:57,68:z,69:F,70:A,71:R,72:N,73:M,74:I},t(D,[2,64]),{67:93,73:M,74:I},t(V,[2,83],{66:94,68:z,69:F,70:A,71:R,72:N}),t(X,[2,84]),t(X,[2,85]),t(X,[2,86]),t(X,[2,87]),t(X,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:C,102:_},{41:[1,102],45:101,51:ie},{16:104,60:f,86:S,100:C,102:_},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:K,50:se,59:110,60:te,82:Z,84:111,85:112,86:ee,87:ne,88:oe,89:fe,90:Ae},{60:[1,122]},{13:P,55:123},t($,[2,72]),t($,[2,138]),{22:K,50:se,59:124,60:te,61:[1,125],82:Z,84:111,85:112,86:ee,87:ne,88:oe,89:fe,90:Ae},t(Re,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:C,102:_,103:L},t(B,[2,16]),t(B,[2,17]),t(B,[2,18]),{11:127,12:Ge,39:[2,36]},t(Ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:C,102:_,103:L}),t(Ce,[2,10]),t(be,[2,55],{11:131,12:Ge}),t(O,[2,7]),{9:[1,132]},t(Fe,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:C,102:_,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:C,102:_,103:L},t(V,[2,82],{66:136,68:z,69:F,70:A,71:R,72:N}),t(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t($,[2,48],{39:[1,142]}),{41:[1,143]},t($,[2,50]),{41:[2,61],45:144,51:ie},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:C,102:_,103:L},t(D,[2,91],{13:[1,147]}),t(D,[2,93],{13:[1,149],77:[1,148]}),t(D,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(D,[2,105],{61:ye}),t(He,[2,107],{85:154,22:K,50:se,60:te,82:Z,86:ee,87:ne,88:oe,89:fe,90:Ae}),t(xe,[2,109]),t(xe,[2,111]),t(xe,[2,112]),t(xe,[2,113]),t(xe,[2,114]),t(xe,[2,115]),t(xe,[2,116]),t(xe,[2,117]),t(xe,[2,118]),t(xe,[2,119]),t(D,[2,106]),t($,[2,71]),t(D,[2,73],{61:ye}),{60:[1,155]},t(B,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:C,102:_,103:L},t(Ce,[2,12]),t(be,[2,56]),{1:[2,4]},t(Fe,[2,69]),t(Fe,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:C,102:_,103:L},t(V,[2,80]),t($,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:ie},t($,[2,49]),{41:[2,62]},t($,[2,52],{39:[1,164]}),t(D,[2,60]),t(D,[2,92]),t(D,[2,94]),t(D,[2,95],{77:[1,165]}),t(D,[2,98]),t(D,[2,99],{13:[1,166]}),t(D,[2,101],{13:[1,168],77:[1,167]}),{22:K,50:se,60:te,82:Z,84:169,85:112,86:ee,87:ne,88:oe,89:fe,90:Ae},t(xe,[2,110]),t(Re,[2,75]),{14:[1,170]},t(Ce,[2,11]),t(Fe,[2,70]),t($,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ie},t(D,[2,96]),t(D,[2,100]),t(D,[2,102]),t(D,[2,103],{77:[1,174]}),t(He,[2,108],{85:154,22:K,50:se,60:te,82:Z,86:ee,87:ne,88:oe,89:fe,90:Ae}),t(be,[2,8]),t($,[2,51]),{41:[1,175]},t($,[2,54]),t(D,[2,104]),t($,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:T(function(Ze,Ee){if(Ee.recoverable)this.trace(Ze);else{var Se=new Error(Ze);throw Se.hash=Ee,Se}},"parseError"),parse:T(function(Ze){var Ee=this,Se=[0],Y=[],ce=[null],j=[],pe=this.table,re="",Pe=0,ve=0,Ue=2,Me=1,qe=j.slice.call(arguments,1),Le=Object.create(this.lexer),Ke={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Ke.yy[De]=this.yy[De]);Le.setInput(Ze,Ke.yy),Ke.yy.lexer=Le,Ke.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var it=Le.yylloc;j.push(it);var Te=Le.options&&Le.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ct(St){Se.length=Se.length-2*St,ce.length=ce.length-St,j.length=j.length-St}T(ct,"popStack");function we(){var St;return St=Y.pop()||Le.lex()||Me,typeof St!="number"&&(St instanceof Array&&(Y=St,St=Y.pop()),St=Ee.symbols_[St]||St),St}T(we,"lex");for(var Et,yt,ot,Dt,vt={},ut,le,At,dt;;){if(yt=Se[Se.length-1],this.defaultActions[yt]?ot=this.defaultActions[yt]:((Et===null||typeof Et>"u")&&(Et=we()),ot=pe[yt]&&pe[yt][Et]),typeof ot>"u"||!ot.length||!ot[0]){var ht="";dt=[];for(ut in pe[yt])this.terminals_[ut]&&ut>Ue&&dt.push("'"+this.terminals_[ut]+"'");Le.showPosition?ht="Parse error on line "+(Pe+1)+`: -`+Le.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":ht="Parse error on line "+(Pe+1)+": Unexpected "+(Et==Me?"end of input":"'"+(this.terminals_[Et]||Et)+"'"),this.parseError(ht,{text:Le.match,token:this.terminals_[Et]||Et,line:Le.yylineno,loc:it,expected:dt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+yt+", token: "+Et);switch(ot[0]){case 1:Se.push(Et),ce.push(Le.yytext),j.push(Le.yylloc),Se.push(ot[1]),Et=null,ve=Le.yyleng,re=Le.yytext,Pe=Le.yylineno,it=Le.yylloc;break;case 2:if(le=this.productions_[ot[1]][1],vt.$=ce[ce.length-le],vt._$={first_line:j[j.length-(le||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(le||1)].first_column,last_column:j[j.length-1].last_column},Te&&(vt._$.range=[j[j.length-(le||1)].range[0],j[j.length-1].range[1]]),Dt=this.performAction.apply(vt,[re,ve,Pe,Ke.yy,ot[1],ce,j].concat(qe)),typeof Dt<"u")return Dt;le&&(Se=Se.slice(0,-1*le*2),ce=ce.slice(0,-1*le),j=j.slice(0,-1*le)),Se.push(this.productions_[ot[1]][0]),ce.push(vt.$),j.push(vt._$),At=pe[Se[Se.length-2]][Se[Se.length-1]],Se.push(At);break;case 3:return!0}}return!0},"parse")},Je=(function(){var tt={EOF:1,parseError:T(function(Ee,Se){if(this.yy.parser)this.yy.parser.parseError(Ee,Se);else throw new Error(Ee)},"parseError"),setInput:T(function(Ze,Ee){return this.yy=Ee||this.yy||{},this._input=Ze,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Ze=this._input[0];this.yytext+=Ze,this.yyleng++,this.offset++,this.match+=Ze,this.matched+=Ze;var Ee=Ze.match(/(?:\r\n?|\n).*/g);return Ee?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ze},"input"),unput:T(function(Ze){var Ee=Ze.length,Se=Ze.split(/(?:\r\n?|\n)/g);this._input=Ze+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ee),this.offset-=Ee;var Y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Se.length-1&&(this.yylineno-=Se.length-1);var ce=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Se?(Se.length===Y.length?this.yylloc.first_column:0)+Y[Y.length-Se.length].length-Se[0].length:this.yylloc.first_column-Ee},this.options.ranges&&(this.yylloc.range=[ce[0],ce[0]+this.yyleng-Ee]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ze){this.unput(this.match.slice(Ze))},"less"),pastInput:T(function(){var Ze=this.matched.substr(0,this.matched.length-this.match.length);return(Ze.length>20?"...":"")+Ze.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ze=this.match;return Ze.length<20&&(Ze+=this._input.substr(0,20-Ze.length)),(Ze.substr(0,20)+(Ze.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ze=this.pastInput(),Ee=new Array(Ze.length+1).join("-");return Ze+this.upcomingInput()+` -`+Ee+"^"},"showPosition"),test_match:T(function(Ze,Ee){var Se,Y,ce;if(this.options.backtrack_lexer&&(ce={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ce.yylloc.range=this.yylloc.range.slice(0))),Y=Ze[0].match(/(?:\r\n?|\n).*/g),Y&&(this.yylineno+=Y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Y?Y[Y.length-1].length-Y[Y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ze[0].length},this.yytext+=Ze[0],this.match+=Ze[0],this.matches=Ze,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ze[0].length),this.matched+=Ze[0],Se=this.performAction.call(this,this.yy,this,Ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var j in ce)this[j]=ce[j];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ze,Ee,Se,Y;this._more||(this.yytext="",this.match="");for(var ce=this._currentRules(),j=0;jEe[0].length)){if(Ee=Se,Y=j,this.options.backtrack_lexer){if(Ze=this.test_match(Se,ce[j]),Ze!==!1)return Ze;if(this._backtrack){Ee=!1;continue}else return!1}else if(!this.options.flex)break}return Ee?(Ze=this.test_match(Ee,ce[Y]),Ze!==!1?Ze:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Ee=this.next();return Ee||this.lex()},"lex"),begin:T(function(Ee){this.conditionStack.push(Ee)},"begin"),popState:T(function(){var Ee=this.conditionStack.length-1;return Ee>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Ee){return Ee=this.conditionStack.length-1-Math.abs(Ee||0),Ee>=0?this.conditionStack[Ee]:"INITIAL"},"topState"),pushState:T(function(Ee){this.begin(Ee)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(Ee,Se,Y,ce){switch(Y){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return tt})();Ve.lexer=Je;function nt(){this.yy={}}return T(nt,"Parser"),nt.prototype=Ve,Ve.Parser=nt,new nt})();N$.parser=N$;var Tme=N$,wme=["#","+","~","-",""],Cme=(Wv=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=qr(e,$e());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Su(this.id);this.memberType==="method"&&(e+=`(${Su(this.parameters.trim())})`,this.returnType&&(e+=" : "+Su(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(wme.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);wme.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${Su(this.id)}${this.memberType==="method"?`(${Su(this.parameters)})${this.returnType?" : "+Su(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},T(Wv,"ClassMember"),Wv),NS="classId-",kme=0,np=T(t=>It.sanitizeText(t,$e()),"sanitizeText"),Eme=(Fh=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=T(e=>{const r=Mte();pt(e).select("svg").selectAll("g").filter(function(){return pt(this).attr("title")!==null}).on("mouseover",a=>{const s=pt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(Eu.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Mn,this.getAccTitle=Gn,this.setAccDescription=qn,this.getAccDescription=Vn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getConfig=T(()=>$e().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=It.sanitizeText(e,$e());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=np(a[0]),n=np(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=It.sanitizeText(e,$e());r&&(r=np(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=It.sanitizeText(e,$e()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=It.sanitizeText(n,$e());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:NS+a+"-"+kme}),kme++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=It.sanitizeText(e,$e());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",Dn()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ae.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=It.sanitizeText(e.relationTitle1.trim(),$e()),e.relationTitle2=It.sanitizeText(e.relationTitle2.trim(),$e()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(np(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new Cme(a,"method")):a&&i.members.push(new Cme(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),np(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=NS+i);const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{r!==void 0&&(this.classes.get(n).tooltip=np(r))})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=$e();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=NS+s);const o=this.classes.get(s);o&&(o.link=Lr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=np(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n),this.classes.get(i).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=It.sanitizeText(e,$e());if($e().securityLevel!=="loose"||r===void 0)return;const s=i;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Lr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=$e(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:Up(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},T(Fh,"ClassDB"),Fh),Xct=T(t=>`g.classGroup text { + `;x.append("path").attr("d",C),w.append("path").attr("d",`M ${m.x},${m.y+v} + a ${T},${v} 0 0 0 0,${m.height}`),x.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&x.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(Xu.has(u)&&(x.style("stroke",f[k%f.length]),x.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(M=e.properties)!=null&&M.icon){const I=e.properties.icon.trim(),P=m.x+m.width-20,$=m.y+10;I.charAt(0)==="@"?KD(g,P,$,I.substr(1)):jD(g,P,$,I)}ju(r,Li(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${ZA}`},r);let S=e.height;const E=x.select("path:last-child");if(E.node()){const I=E.node().getBBox();e.height=I.height,S=I.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),S},"drawActorTypeQueue"),u0t=b(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(rn++,y.append("line").attr("id","actor"+rn).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rn);const v=t.append("g");let T=qp;n?T+=` ${gd}`:T+=` ${pd}`,v.attr("class",T),v.attr("name",e.name);const x=vo();x.x=e.x,x.y=s,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const w=e.x+e.width/2,C=s+32,k=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",C).attr("r",k).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${C-k})`);const S=a.get(e.name)??0;Xu.has(h)?(v.style("stroke",p[S%p.length]),v.style("fill",f[S%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),ju(r,Li(e.description))(e.description,v,x.x,x.y+k+(n?5:12),x.width,x.height,{class:`actor ${qp}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),h0t=b(function(t,e,r,n,i){var k;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${gd}`:m+=` ${pd}`,g.attr("class",m),g.attr("name",e.name);const y=vo();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),x=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-x).attr("x2",v+x).attr("y1",T+x).attr("y2",T+x).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;Xu.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const C=g.node().getBBox();return e.height=C.height+(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),n||(rn++,p.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rn),ju(r,Li(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${qp}`},r),n?g.attr("transform",`translate(0, ${x})`):(g.attr("transform",`translate(0, ${x/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),d0t=b(function(t,e,r,n,i){var M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(rn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",QA(`actor${rn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=rn,e.links!=null&&m.attr("id","root-"+rn),h==="neo"&&m.attr("data-look","neo"));const y=vo();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${gd}`:v+=` ${pd}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,x=y.width/3,w=T/2,C=w/(2.5+T/50),k=m.append("g");k.attr("class",v);const S=` + M ${y.x},${y.y+C} + a ${w},${C} 0 0 0 ${T},0 + a ${w},${C} 0 0 0 -${T},0 + l 0,${x-2*C} + a ${w},${C} 0 0 0 ${T},0 + l 0,-${x-2*C} +`;k.append("path").attr("d",S),h==="neo"&&k.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;Xu.has(l)?(k.style("stroke",f[E%f.length]),k.style("fill",d[E%f.length])):k.style("stroke",p),k.attr("transform",`translate(${T}, ${C})`),e.rectData=y,ju(r,Li(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${ZA}`},r);const L=k.select("path:last-child");if(L.node()){const I=L.node().getBBox();e.height=I.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),f0t=b(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(rn++,u.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rn);const y=t.append("g");let v=qp;n?v+=` ${gd}`:v+=` ${pd}`,y.attr("class",v),y.attr("name",e.name);const T=vo();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+rn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+rn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const x=i.get(e.name)??0;Xu.has(d)?(y.style("stroke",g[x%g.length]),y.style("fill",p[x%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),ju(r,Li(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${qp}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),p0t=b(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(rn++,g.append("line").attr("id","actor"+rn).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rn);const m=t.append("g");let y=qp;n?y+=` ${gd}`:y+=` ${pd}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+rn).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+rn).attr("x1",s-Wp/2*v).attr("y1",T+33*v).attr("x2",s+Wp/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-Wp/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(Wp/2-2)*v).attr("y2",T+60*v);const x=m.append("circle");x.attr("cx",e.x+e.width/2),x.attr("cy",T+10*v),x.attr("r",15*v),x.attr("width",e.width*v),x.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const C=vo();C.x=e.x,C.y=T,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const k=i.get(e.name)??0;return Xu.has(u)?(m.style("stroke",f[k%f.length]),m.style("fill",d[k%f.length])):m.style("stroke",p),ju(r,Li(e.description))(e.description,m,C.x,T+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${qp}`},r),e.height},"drawActorTypeActor"),g0t=b(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await p0t(t,e,r,n,o);case"participant":return await o0t(t,e,r,n,o);case"boundary":return await f0t(t,e,r,n,o);case"control":return await u0t(t,e,r,n,i,o);case"entity":return await h0t(t,e,r,n,o);case"database":return await d0t(t,e,r,n,o);case"collections":return await l0t(t,e,r,n,o);case"queue":return await c0t(t,e,r,n,o)}},"drawActor"),m0t=b(function(t,e,r){const i=t.append("g");Z2e(i,e),e.name&&ju(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),y0t=b(function(t){return t.append("g")},"anchorElement"),v0t=b(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=vo(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=jw(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,x)=>[T.name,x]))).get(g)??0;Xu.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),b0t=b(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=b(function(y,v,T,x){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",x).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=ZD();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",j2e(f,g),g=Q2e(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=Li(g.text)?await JA(f,g,e):Km(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,Li(g.text)?(e.starty=e.sections[y].y,await JA(f,g,e)):Km(f,g);let T=Math.round(m.map(x=>(x._groups||x)[0][0].getBBox().height).reduce((x,w)=>x+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),Z2e=b(function(t,e){wse(t,e)},"drawBackgroundRect"),x0t=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),T0t=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),w0t=b(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),C0t=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),S0t=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),k0t=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),E0t=b(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),A0t=b(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Q2e=b(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),_0t=b(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),ju=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}b(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Zc(p),T=a.split($t.lineBreakRegex);for(let x=0;xt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:b(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:b(function(t){this.boxes.push(t)},"addBox"),addActor:b(function(t){this.actors.push(t)},"addActor"),addLoop:b(function(t){this.loops.push(t)},"addLoop"),addMessage:b(function(t){this.messages.push(t)},"addMessage"),addNote:b(function(t){this.notes.push(t)},"addNote"),lastActor:b(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:b(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:b(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:b(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:b(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,rbe(Ve())},"init"),updateVal:b(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:b(function(t,e,r,n){const i=this;let a=0;function s(o){return b(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Je.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Je.boxMargin,Math.max),i.updateVal(At.data,"startx",t-h*Je.boxMargin,Math.min),i.updateVal(At.data,"stopx",r+h*Je.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Je.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Je.boxMargin,Math.max),i.updateVal(At.data,"starty",e-h*Je.boxMargin,Math.min),i.updateVal(At.data,"stopy",n+h*Je.boxMargin,Math.max))},"updateItemBounds")}b(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:b(function(t,e,r,n){const i=$t.getMin(t,r),a=$t.getMax(t,r),s=$t.getMin(e,n),o=$t.getMax(e,n);this.updateVal(At.data,"startx",i,Math.min),this.updateVal(At.data,"starty",s,Math.min),this.updateVal(At.data,"stopx",a,Math.max),this.updateVal(At.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:b(function(t,e,r){const n=r.get(t.from),i=e6(t.from).length||0,a=n.x+n.width/2+(i-1)*Je.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Je.activationWidth,stopy:void 0,actor:t.from,anchored:Zn.anchorElement(e)})},"newActivation"),endActivation:b(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:b(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:b(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:b(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:b(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:b(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:At.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:b(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:b(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:b(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=$t.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:b(function(){return this.verticalPos},"getVerticalPos"),getBounds:b(function(){return{bounds:this.data,models:this.models}},"getBounds")},N0t=b(async function(t,e,r){At.bumpVerticalPos(Je.boxMargin),e.height=Je.boxMargin,e.starty=At.getVerticalPos();const n=vo();n.x=e.startx,n.y=e.starty,n.width=e.width||Je.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Zn.drawRect(i,n),s=ZD();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Je.noteFontFamily,s.fontSize=Je.noteFontSize,s.fontWeight=Je.noteFontWeight,s.anchor=Je.noteAlign,s.textMargin=Je.noteMargin,s.valign="center";const o=Li(s.text)?await JA(i,s):Km(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Je.noteMargin),e.height+=l+2*Je.noteMargin,At.bumpVerticalPos(l+2*Je.noteMargin),e.stopy=e.starty+l+2*Je.noteMargin,e.stopx=e.startx+n.width,At.insert(e.startx,e.starty,e.stopx,e.stopy),At.models.addNote(e)},"drawNote"),J2e=b(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=obe(e,n),m=t.append("g"),y=16.5,v=b((k,S)=>{const E=k?y:-y;return S?-E:E},"getCircleOffset"),T=b(k=>{m.append("circle").attr("cx",k).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:x,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case x:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case x:T(f);break;case w:T(d);break;case C:T(d),T(f);break}},"drawCentralConnection"),Vp=b(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Zm=b(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),fF=b(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function ebe(t,e){At.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=$t.splitBreaks(i).length,s=Li(i),o=s?await cb(i,Ve()):Er.calculateTextDimensions(i,Vp(Je));if(!s){const d=o.height/a;e.height+=d,At.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=At.getVerticalPos()+u,Je.rightAngles||(u+=Je.boxMargin,l=At.getVerticalPos()+u),u+=30;const d=$t.getMax(h/2,Je.width/2);At.insert(r-d,At.getVerticalPos()-10+u,n+d,At.getVerticalPos()+30+u)}else u+=Je.boxMargin,l=At.getVerticalPos()+u,At.insert(r,l-10,n,l);return At.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,At.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}b(ebe,"boundMessage");var O0t=b(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Er.calculateTextDimensions(u,Vp(Je)),g=ZD();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Je.messageFontFamily,g.fontSize=Je.messageFontSize,g.fontWeight=Je.messageFontWeight,g.anchor=Je.messageAlign,g.valign="center",g.textMargin=Je.wrapPadding,g.tspan=!1,Li(g.text)?await JA(t,g,{startx:s,stopx:o,starty:r}):Km(t,g);const m=p.width;let y;if(s===o){const T=f||Je.showSequenceNumbers,x=obe(i,n),w=W0t(i,n),C=s+(T&&(x||w)?10:0);Je.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${s+$t.getMax(Je.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),gF(i,n)&&J2e(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),gF(i,n)&&J2e(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Je.arrowMarkerAbsolute&&(v=DC(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Je.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,x=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,C=gF(i,n);let k=s,S=o;T?(ss?S=o-2*w:(S=o-w,k+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),S+=C?15:0,y.attr("x2",S),y.attr("x1",k)):y.attr("x1",s+w);let E=0;const L=s===o,M=s<=o;L?E=e.fromBounds+1:x?E=M?e.toBounds-1:e.fromBounds+1:E=M?e.fromBounds+1:e.toBounds-1;let I="12px";const P=d.toString().length;P>5?I="7px":P>3&&(I="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",I).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),$0t=b(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||At.models.addBox(u),l+=Je.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=$t.getMax(f.width||Je.width,Je.width),f.height=$t.getMax(f.height||Je.height,Je.height),f.margin=f.margin||Je.actorMargin,h=$t.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=At.getVerticalPos(),At.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,At.models.addActor(f)}u&&!s&&At.models.addBox(u),At.bumpVerticalPos(h)},"addActorRenderingData"),pF=b(async function(t,e,r,n,i,a,s){if(n){let o=0;At.bumpVerticalPos(Je.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=At.getVerticalPos());const h=await Zn.drawActor(t,u,Je,!0,i,a,s);o=$t.getMax(o,h)}At.bumpVerticalPos(o+Je.boxMargin)}else for(const o of r){const l=e.get(o);await Zn.drawActor(t,l,Je,!1,i,a,s)}},"drawActors"),tbe=b(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=B0t(o),u=Zn.drawPopup(t,o,l,Je,Je.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),rbe=b(function(t){Ri(Je,t),t.fontFamily&&(Je.actorFontFamily=Je.noteFontFamily=Je.messageFontFamily=t.fontFamily),t.fontSize&&(Je.actorFontSize=Je.noteFontSize=Je.messageFontSize=t.fontSize),t.fontWeight&&(Je.actorFontWeight=Je.noteFontWeight=Je.messageFontWeight=t.fontWeight)},"setConf"),e6=b(function(t){return At.activations.filter(function(e){return e.actor===t})},"actorActivations"),nbe=b(function(t,e){const r=e.get(t),n=e6(t),i=n.reduce(function(s,o){return $t.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return $t.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function _l(t,e,r,n,i){At.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=Vp(Je);e.message=Er.wrapLabel(`[${e.message}]`,s-2*Je.wrapPadding,o),e.width=s,e.wrap=!0;const l=Er.calculateTextDimensions(e.message,o),u=$t.getMax(l.height,Je.labelBoxHeight);a=n+u,he.debug(`${u} - ${e.message}`)}i(e),At.bumpVerticalPos(a)}b(_l,"adjustLoopHeightForWrap");function ibe(t,e,r,n,i,a,s){function o(h,d){h.x{z.add(W.from),z.add(W.to)}),y=y.filter(W=>z.has(W))}const k=new Map(y.map((z,W)=>{var V;return[((V=f.get(z))==null?void 0:V.name)??z,W]}));$0t(d,f,p,y,0,v,!1);const S=await V0t(v,f,C,n);Zn.insertArrowHead(d,e),Zn.insertArrowCrossHead(d,e),Zn.insertArrowFilledHead(d,e),Zn.insertSequenceNumber(d,e),Zn.insertSolidTopArrowHead(d,e),Zn.insertSolidBottomArrowHead(d,e),Zn.insertStickTopArrowHead(d,e),Zn.insertStickBottomArrowHead(d,e),s==="neo"&&Zn.insertDropShadow(d,Je);function E(z,W){const V=At.endActivation(z);V.starty+18>W&&(V.starty=W-6,W+=12),Zn.drawActivation(d,V,W,Je,e6(z.from).length,n,k),At.insert(V.startx,W-10,V.stopx,W)}b(E,"activeEnd");let L=1,M=1;const I=[],P=[];let $=0;for(const z of v){let W,V,H;switch(z.type){case n.db.LINETYPE.NOTE:At.resetVerticalPos(),V=z.noteModel,await N0t(d,V,z.id);break;case n.db.LINETYPE.ACTIVE_START:At.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:At.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:At.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(z,At.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te));break;case n.db.LINETYPE.LOOP_END:W=At.endLoop(),await Zn.drawLoop(d,W,"loop",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;case n.db.LINETYPE.RECT_START:_l(S,z,Je.boxMargin,Je.boxMargin,te=>{let Y=te.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),At.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:W=At.endLoop(),P.push(W),At.models.addLoop(W),At.bumpVerticalPos(W.stopy-At.getVerticalPos());break;case n.db.LINETYPE.OPT_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te));break;case n.db.LINETYPE.OPT_END:W=At.endLoop(),await Zn.drawLoop(d,W,"opt",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;case n.db.LINETYPE.ALT_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te));break;case n.db.LINETYPE.ALT_ELSE:_l(S,z,Je.boxMargin+Je.boxTextMargin,Je.boxMargin,te=>At.addSectionToLoop(te));break;case n.db.LINETYPE.ALT_END:W=At.endLoop(),await Zn.drawLoop(d,W,"alt",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te)),At.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:_l(S,z,Je.boxMargin+Je.boxTextMargin,Je.boxMargin,te=>At.addSectionToLoop(te));break;case n.db.LINETYPE.PAR_END:W=At.endLoop(),await Zn.drawLoop(d,W,"par",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;case n.db.LINETYPE.AUTONUMBER:L=z.message.start||L,M=z.message.step||M,z.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te));break;case n.db.LINETYPE.CRITICAL_OPTION:_l(S,z,Je.boxMargin+Je.boxTextMargin,Je.boxMargin,te=>At.addSectionToLoop(te));break;case n.db.LINETYPE.CRITICAL_END:W=At.endLoop(),await Zn.drawLoop(d,W,"critical",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;case n.db.LINETYPE.BREAK_START:_l(S,z,Je.boxMargin,Je.boxMargin+Je.boxTextMargin,te=>At.newLoop(te));break;case n.db.LINETYPE.BREAK_END:W=At.endLoop(),await Zn.drawLoop(d,W,"break",Je,z),At.bumpVerticalPos(W.stopy-At.getVerticalPos()),At.models.addLoop(W);break;default:try{H=z.msgModel,H.starty=At.getVerticalPos(),H.sequenceIndex=L,H.sequenceVisible=n.db.showSequenceNumbers(),H.id=z.id,H.from=z.from,H.to=z.to;const te=await ebe(d,H);ibe(z,H,te,$,f,p,g),I.push({messageModel:H,lineStartY:te,msg:z}),At.models.addMessage(H)}catch(te){he.error("error while drawing message",te)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(z.type)&&(L=Math.round((L+M)*100)/100),$++}he.debug("createdActors",p),he.debug("destroyedActors",g),await pF(d,f,y,!1,e,n,k);for(const z of I)await O0t(d,z.messageModel,z.lineStartY,n,z.msg,e);Je.mirrorActors&&await pF(d,f,y,!0,e,n,k),P.forEach(z=>Zn.drawBackgroundRect(d,z)),K2e(d,f,y,Je);for(const z of At.models.boxes){z.height=At.getVerticalPos()-z.y,At.insert(z.x,z.y,z.x+z.width,z.height);const W=Je.boxMargin*2;z.startx=z.x-W,z.starty=z.y-W*.25,z.stopx=z.startx+z.width+2*W,z.stopy=z.starty+z.height+W*.75,z.stroke="rgb(0,0,0, 0.5)",Zn.drawBox(d,z,Je)}x&&At.bumpVerticalPos(Je.boxMargin);const _=tbe(d,f,y,h),{bounds:R}=At.getBounds();R.startx===void 0&&(R.startx=0),R.starty===void 0&&(R.starty=0),R.stopx===void 0&&(R.stopx=0),R.stopy===void 0&&(R.stopy=0);let O=R.stopy-R.starty;O<_.maxHeight&&(O=_.maxHeight);let D=O+2*Je.diagramMarginY;Je.mirrorActors&&(D=D-Je.boxMargin+Je.bottomMarginAdj);let N=R.stopx-R.startx;N<_.maxWidth&&(N=_.maxWidth);const B=N+2*Je.diagramMarginX;T&&d.append("text").text(T).attr("x",(R.stopx-R.startx)/2-2*Je.diagramMarginX).attr("y",-25),bi(d,D,B,Je.useMaxWidth);const F=T?40:0,G=f.size&&s==="neo"?30:0;d.attr("viewBox",R.startx-Je.diagramMarginX+" -"+(Je.diagramMarginY+F)+" "+B+" "+(D+F+G)),he.debug("models:",At.models)},"draw");async function abe(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const a=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!a.prevActor||i.placement===r.db.PLACEMENT.RIGHTOF&&!a.nextActor)continue;const s=i.placement!==void 0,o=!s,l=s?Zm(Je):Vp(Je),u=i.wrap?Er.wrapLabel(i.message,Je.width-2*Je.wrapPadding,l):i.message,d=(Li(u)?await cb(i.message,Ve()):Er.calculateTextDimensions(u,l)).width+2*Je.wrapPadding;o&&i.from===a.nextActor?n[i.to]=$t.getMax(n[i.to]||0,d):o&&i.from===a.prevActor?n[i.from]=$t.getMax(n[i.from]||0,d):o&&i.from===i.to?(n[i.from]=$t.getMax(n[i.from]||0,d/2),n[i.to]=$t.getMax(n[i.to]||0,d/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=$t.getMax(n[i.from]||0,d):i.placement===r.db.PLACEMENT.LEFTOF?n[a.prevActor]=$t.getMax(n[a.prevActor]||0,d):i.placement===r.db.PLACEMENT.OVER&&(a.prevActor&&(n[a.prevActor]=$t.getMax(n[a.prevActor]||0,d/2)),a.nextActor&&(n[i.from]=$t.getMax(n[i.from]||0,d/2)))}return he.debug("maxMessageWidthPerActor:",n),n}b(abe,"getMaxMessageWidthPerActor");var B0t=b(function(t){let e=0;const r=fF(Je);for(const n in t.links){const a=Er.calculateTextDimensions(n,r).width+2*Je.wrapPadding+2*Je.boxMargin;e{const s=Vp(Je);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Je.boxMargin*8;o+=l,o-=2*Je.boxTextMargin,a.wrap&&(a.name=Er.wrapLabel(a.name,o-2*Je.wrapPadding,s));const u=Er.calculateTextDimensions(a.name,s);i=$t.getMax(u.height,i);const h=$t.getMax(o,u.width+2*Je.wrapPadding);if(a.margin=Je.boxTextMargin,oa.textMaxHeight=i),$t.getMax(n,Je.height)}b(sbe,"calculateActorMargins");var F0t=b(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=Li(t.message)?await cb(t.message,Ve()):Er.calculateTextDimensions(o?Er.wrapLabel(t.message,Je.width,Zm(Je)):t.message,Zm(Je));const u={width:o?Je.width:$t.getMax(Je.width,l.width+2*Je.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?$t.getMax(Je.width,l.width):$t.getMax(n.width/2+i.width/2,l.width+2*Je.noteMargin),u.startx=a+(n.width+Je.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?$t.getMax(Je.width,l.width+2*Je.noteMargin):$t.getMax(n.width/2+i.width/2,l.width+2*Je.noteMargin),u.startx=a-u.width+(n.width-Je.actorMargin)/2):t.to===t.from?(l=Er.calculateTextDimensions(o?Er.wrapLabel(t.message,$t.getMax(Je.width,n.width),Zm(Je)):t.message,Zm(Je)),u.width=o?$t.getMax(Je.width,n.width):$t.getMax(n.width,Je.width,l.width+2*Je.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Je.actorMargin,u.startx=a2,f=b(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Je.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Er.wrapLabel(t.message,$t.getMax(g+2*Je.wrapPadding,Je.width),Vp(Je)));const m=Er.calculateTextDimensions(t.message,Vp(Je));return{width:$t.getMax(t.wrap?0:m.width+2*Je.wrapPadding,g+2*Je.wrapPadding,Je.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),V0t=b(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=e6(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Je.activationWidth/2,g={startx:p,stopx:p+Je.activationWidth,actor:u.from,enabled:!0};At.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=At.activations.map(f=>f.actor).lastIndexOf(u.from);At.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await F0t(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=$t.getMin(s.from,o.startx),s.to=$t.getMax(s.to,o.startx+o.width),s.width=$t.getMax(s.width,Math.abs(s.from-s.to))-Je.labelBoxWidth})):(l=q0t(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=$t.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=$t.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=$t.getMax(s.width,Math.abs(s.to-s.from))-Je.labelBoxWidth}else s.from=$t.getMin(l.startx,s.from),s.to=$t.getMax(l.stopx,s.to),s.width=$t.getMax(s.width,l.width)-Je.labelBoxWidth}))}return At.activations=[],he.debug("Loop type widths:",i),i},"calculateLoopBounds"),U0t={bounds:At,drawActors:pF,drawActorsPopup:tbe,setConf:rbe,draw:P0t},H0t={parser:Jpt,get db(){return new n0t},renderer:U0t,styles:a0t,init:b(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,p_({sequence:{wrap:t.wrap}}))},"init")};const Y0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:H0t},Symbol.toStringTag,{value:"Module"}));var mF=(function(){var t=b(function(ye,ke,le,pe){for(le=le||{},pe=ye.length;pe--;le[ye[pe]]=ke);return le},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],x=[1,29],w=[1,30],C=[1,31],k=[1,44],S=[1,46],E=[1,43],L=[1,47],M=[1,9],I=[1,8,9],P=[1,58],$=[1,59],_=[1,60],R=[1,61],O=[1,62],D=[1,63],N=[1,64],B=[1,8,9,41],F=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],W=[13,60,86,100,102,103],V=[13,60,73,74,86,100,102,103],H=[13,60,68,69,70,71,72,86,100,102,103],te=[1,103],Y=[1,121],se=[1,117],J=[1,113],Z=[1,119],ee=[1,114],re=[1,115],ge=[1,116],ae=[1,118],_e=[1,120],Fe=[22,50,60,61,82,86,87,88,89,90],qe=[1,128],ue=[12,39],de=[1,8,9,39,41,44,46],Ce=[1,8,9,22],me=[1,153],$e=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:b(function(ke,le,pe,U,oe,Q,fe){var j=Q.length-1;switch(oe){case 8:this.$=Q[j-1];break;case 9:case 10:case 13:case 15:this.$=Q[j];break;case 11:case 14:this.$=Q[j-2]+"."+Q[j];break;case 12:case 16:this.$=Q[j-1]+Q[j];break;case 17:case 18:this.$=Q[j-1]+"~"+Q[j]+"~";break;case 19:U.addRelation(Q[j]);break;case 20:Q[j-1].title=U.cleanupLabel(Q[j]),U.addRelation(Q[j-1]);break;case 31:this.$=Q[j].trim(),U.setAccTitle(this.$);break;case 32:case 33:this.$=Q[j].trim(),U.setAccDescription(this.$);break;case 34:U.addClassesToNamespace(Q[j-3],Q[j-1][0],Q[j-1][1]),U.popNamespace();break;case 35:U.addClassesToNamespace(Q[j-4],Q[j-1][0],Q[j-1][1]),U.popNamespace();break;case 36:this.$=U.addNamespace(Q[j]);break;case 37:this.$=U.addNamespace(Q[j-1],Q[j]);break;case 38:this.$=[[Q[j]],[]];break;case 39:this.$=[[Q[j-1]],[]];break;case 40:Q[j][0].unshift(Q[j-2]),this.$=Q[j];break;case 41:this.$=[[],[Q[j]]];break;case 42:this.$=[[],[Q[j-1]]];break;case 43:Q[j][1].unshift(Q[j-2]),this.$=Q[j];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=Q[j];break;case 48:U.setCssClass(Q[j-2],Q[j]);break;case 49:U.addMembers(Q[j-3],Q[j-1]);break;case 51:U.setCssClass(Q[j-5],Q[j-3]),U.addMembers(Q[j-5],Q[j-1]);break;case 52:U.addAnnotation(Q[j-3],Q[j-1]);break;case 53:U.addAnnotation(Q[j-6],Q[j-4]),U.addMembers(Q[j-6],Q[j-1]);break;case 54:U.addAnnotation(Q[j-5],Q[j-3]);break;case 55:this.$=Q[j],U.addClass(Q[j]);break;case 56:this.$=Q[j-1],U.addClass(Q[j-1]),U.setClassLabel(Q[j-1],Q[j]);break;case 60:U.addAnnotation(Q[j],Q[j-2]);break;case 61:case 74:this.$=[Q[j]];break;case 62:Q[j].push(Q[j-1]),this.$=Q[j];break;case 63:break;case 64:U.addMember(Q[j-1],U.cleanupLabel(Q[j]));break;case 65:break;case 66:break;case 67:this.$={id1:Q[j-2],id2:Q[j],relation:Q[j-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:Q[j-3],id2:Q[j],relation:Q[j-1],relationTitle1:Q[j-2],relationTitle2:"none"};break;case 69:this.$={id1:Q[j-3],id2:Q[j],relation:Q[j-2],relationTitle1:"none",relationTitle2:Q[j-1]};break;case 70:this.$={id1:Q[j-4],id2:Q[j],relation:Q[j-2],relationTitle1:Q[j-3],relationTitle2:Q[j-1]};break;case 71:this.$=U.addNote(Q[j],Q[j-1]);break;case 72:this.$=U.addNote(Q[j]);break;case 73:this.$=Q[j-2],U.defineClass(Q[j-1],Q[j]);break;case 75:this.$=Q[j-2].concat([Q[j]]);break;case 76:U.setDirection("TB");break;case 77:U.setDirection("BT");break;case 78:U.setDirection("RL");break;case 79:U.setDirection("LR");break;case 80:this.$={type1:Q[j-2],type2:Q[j],lineType:Q[j-1]};break;case 81:this.$={type1:"none",type2:Q[j],lineType:Q[j-1]};break;case 82:this.$={type1:Q[j-1],type2:"none",lineType:Q[j]};break;case 83:this.$={type1:"none",type2:"none",lineType:Q[j]};break;case 84:this.$=U.relationType.AGGREGATION;break;case 85:this.$=U.relationType.EXTENSION;break;case 86:this.$=U.relationType.COMPOSITION;break;case 87:this.$=U.relationType.DEPENDENCY;break;case 88:this.$=U.relationType.LOLLIPOP;break;case 89:this.$=U.lineType.LINE;break;case 90:this.$=U.lineType.DOTTED_LINE;break;case 91:case 97:this.$=Q[j-2],U.setClickEvent(Q[j-1],Q[j]);break;case 92:case 98:this.$=Q[j-3],U.setClickEvent(Q[j-2],Q[j-1]),U.setTooltip(Q[j-2],Q[j]);break;case 93:this.$=Q[j-2],U.setLink(Q[j-1],Q[j]);break;case 94:this.$=Q[j-3],U.setLink(Q[j-2],Q[j-1],Q[j]);break;case 95:this.$=Q[j-3],U.setLink(Q[j-2],Q[j-1]),U.setTooltip(Q[j-2],Q[j]);break;case 96:this.$=Q[j-4],U.setLink(Q[j-3],Q[j-2],Q[j]),U.setTooltip(Q[j-3],Q[j-1]);break;case 99:this.$=Q[j-3],U.setClickEvent(Q[j-2],Q[j-1],Q[j]);break;case 100:this.$=Q[j-4],U.setClickEvent(Q[j-3],Q[j-2],Q[j-1]),U.setTooltip(Q[j-3],Q[j]);break;case 101:this.$=Q[j-3],U.setLink(Q[j-2],Q[j]);break;case 102:this.$=Q[j-4],U.setLink(Q[j-3],Q[j-1],Q[j]);break;case 103:this.$=Q[j-4],U.setLink(Q[j-3],Q[j-1]),U.setTooltip(Q[j-3],Q[j]);break;case 104:this.$=Q[j-5],U.setLink(Q[j-4],Q[j-2],Q[j]),U.setTooltip(Q[j-4],Q[j-1]);break;case 105:this.$=Q[j-2],U.setCssStyle(Q[j-1],Q[j]);break;case 106:U.setCssClass(Q[j-1],Q[j]);break;case 107:this.$=[Q[j]];break;case 108:Q[j-2].push(Q[j]),this.$=Q[j-2];break;case 110:this.$=Q[j-1]+Q[j];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:x,82:w,83:C,86:k,100:S,102:E,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(M,[2,5],{8:[1,48]}),{8:[1,49]},t(I,[2,19],{22:[1,50]}),t(I,[2,21]),t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,30]),{34:[1,51]},{36:[1,52]},t(I,[2,33]),t(I,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:$,70:_,71:R,72:O,73:D,74:N}),{39:[1,65]},t(B,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(I,[2,65]),t(I,[2,66]),{16:69,60:f,86:k,100:S,102:E},{16:39,17:40,19:70,60:f,86:k,100:S,102:E,103:L},{16:39,17:40,19:71,60:f,86:k,100:S,102:E,103:L},{16:39,17:40,19:72,60:f,86:k,100:S,102:E,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:k,100:S,102:E,103:L},{13:F,55:76},{58:78,60:[1,79]},t(I,[2,76]),t(I,[2,77]),t(I,[2,78]),t(I,[2,79]),t(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:k,100:S,102:E,103:L}),t(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:k,100:S,102:E,103:L},{16:39,17:40,19:87,60:f,86:k,100:S,102:E,103:L},t(z,[2,133]),t(z,[2,134]),t(z,[2,135]),t(z,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(M,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:x,82:w,83:C,86:k,100:S,102:E,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:x,82:w,83:C,86:k,100:S,102:E,103:L},t(I,[2,20]),t(I,[2,31]),t(I,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:k,100:S,102:E,103:L},{53:92,66:56,67:57,68:P,69:$,70:_,71:R,72:O,73:D,74:N},t(I,[2,64]),{67:93,73:D,74:N},t(W,[2,83],{66:94,68:P,69:$,70:_,71:R,72:O}),t(V,[2,84]),t(V,[2,85]),t(V,[2,86]),t(V,[2,87]),t(V,[2,88]),t(H,[2,89]),t(H,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:k,100:S,102:E},{41:[1,102],45:101,51:te},{16:104,60:f,86:k,100:S,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:se,59:110,60:J,82:Z,84:111,85:112,86:ee,87:re,88:ge,89:ae,90:_e},{60:[1,122]},{13:F,55:123},t(B,[2,72]),t(B,[2,138]),{22:Y,50:se,59:124,60:J,61:[1,125],82:Z,84:111,85:112,86:ee,87:re,88:ge,89:ae,90:_e},t(Fe,[2,74]),{16:39,17:40,19:126,60:f,86:k,100:S,102:E,103:L},t(G,[2,16]),t(G,[2,17]),t(G,[2,18]),{11:127,12:qe,39:[2,36]},t(ue,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:k,100:S,102:E,103:L}),t(ue,[2,10]),t(de,[2,55],{11:131,12:qe}),t(M,[2,7]),{9:[1,132]},t(Ce,[2,67]),{16:39,17:40,19:133,60:f,86:k,100:S,102:E,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:k,100:S,102:E,103:L},t(W,[2,82],{66:136,68:P,69:$,70:_,71:R,72:O}),t(W,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(B,[2,48],{39:[1,142]}),{41:[1,143]},t(B,[2,50]),{41:[2,61],45:144,51:te},{47:[1,145]},{16:39,17:40,19:146,60:f,86:k,100:S,102:E,103:L},t(I,[2,91],{13:[1,147]}),t(I,[2,93],{13:[1,149],77:[1,148]}),t(I,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(I,[2,105],{61:me}),t($e,[2,107],{85:154,22:Y,50:se,60:J,82:Z,86:ee,87:re,88:ge,89:ae,90:_e}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[2,119]),t(I,[2,106]),t(B,[2,71]),t(I,[2,73],{61:me}),{60:[1,155]},t(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:k,100:S,102:E,103:L},t(ue,[2,12]),t(de,[2,56]),{1:[2,4]},t(Ce,[2,69]),t(Ce,[2,68]),{16:39,17:40,19:158,60:f,86:k,100:S,102:E,103:L},t(W,[2,80]),t(B,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:te},t(B,[2,49]),{41:[2,62]},t(B,[2,52],{39:[1,164]}),t(I,[2,60]),t(I,[2,92]),t(I,[2,94]),t(I,[2,95],{77:[1,165]}),t(I,[2,98]),t(I,[2,99],{13:[1,166]}),t(I,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:se,60:J,82:Z,84:169,85:112,86:ee,87:re,88:ge,89:ae,90:_e},t(we,[2,110]),t(Fe,[2,75]),{14:[1,170]},t(ue,[2,11]),t(Ce,[2,70]),t(B,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:te},t(I,[2,96]),t(I,[2,100]),t(I,[2,102]),t(I,[2,103],{77:[1,174]}),t($e,[2,108],{85:154,22:Y,50:se,60:J,82:Z,86:ee,87:re,88:ge,89:ae,90:_e}),t(de,[2,8]),t(B,[2,51]),{41:[1,175]},t(B,[2,54]),t(I,[2,104]),t(B,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:b(function(ke,le){if(le.recoverable)this.trace(ke);else{var pe=new Error(ke);throw pe.hash=le,pe}},"parseError"),parse:b(function(ke){var le=this,pe=[0],U=[],oe=[null],Q=[],fe=this.table,j="",Be=0,Se=0,He=2,De=1,We=Q.slice.call(arguments,1),Ne=Object.create(this.lexer),Ze={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(Ze.yy[Pe]=this.yy[Pe]);Ne.setInput(ke,Ze.yy),Ze.yy.lexer=Ne,Ze.yy.parser=this,typeof Ne.yylloc>"u"&&(Ne.yylloc={});var nt=Ne.yylloc;Q.push(nt);var Ie=Ne.options&&Ne.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(Et){pe.length=pe.length-2*Et,oe.length=oe.length-Et,Q.length=Q.length-Et}b(pt,"popStack");function Re(){var Et;return Et=U.pop()||Ne.lex()||De,typeof Et!="number"&&(Et instanceof Array&&(U=Et,Et=U.pop()),Et=le.symbols_[Et]||Et),Et}b(Re,"lex");for(var kt,bt,lt,Nt,Ct={},dt,ve,_t,gt;;){if(bt=pe[pe.length-1],this.defaultActions[bt]?lt=this.defaultActions[bt]:((kt===null||typeof kt>"u")&&(kt=Re()),lt=fe[bt]&&fe[bt][kt]),typeof lt>"u"||!lt.length||!lt[0]){var ft="";gt=[];for(dt in fe[bt])this.terminals_[dt]&&dt>He&>.push("'"+this.terminals_[dt]+"'");Ne.showPosition?ft="Parse error on line "+(Be+1)+`: +`+Ne.showPosition()+` +Expecting `+gt.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":ft="Parse error on line "+(Be+1)+": Unexpected "+(kt==De?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(ft,{text:Ne.match,token:this.terminals_[kt]||kt,line:Ne.yylineno,loc:nt,expected:gt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+kt);switch(lt[0]){case 1:pe.push(kt),oe.push(Ne.yytext),Q.push(Ne.yylloc),pe.push(lt[1]),kt=null,Se=Ne.yyleng,j=Ne.yytext,Be=Ne.yylineno,nt=Ne.yylloc;break;case 2:if(ve=this.productions_[lt[1]][1],Ct.$=oe[oe.length-ve],Ct._$={first_line:Q[Q.length-(ve||1)].first_line,last_line:Q[Q.length-1].last_line,first_column:Q[Q.length-(ve||1)].first_column,last_column:Q[Q.length-1].last_column},Ie&&(Ct._$.range=[Q[Q.length-(ve||1)].range[0],Q[Q.length-1].range[1]]),Nt=this.performAction.apply(Ct,[j,Se,Be,Ze.yy,lt[1],oe,Q].concat(We)),typeof Nt<"u")return Nt;ve&&(pe=pe.slice(0,-1*ve*2),oe=oe.slice(0,-1*ve),Q=Q.slice(0,-1*ve)),pe.push(this.productions_[lt[1]][0]),oe.push(Ct.$),Q.push(Ct._$),_t=fe[pe[pe.length-2]][pe[pe.length-1]],pe.push(_t);break;case 3:return!0}}return!0},"parse")},Ye=(function(){var ye={EOF:1,parseError:b(function(le,pe){if(this.yy.parser)this.yy.parser.parseError(le,pe);else throw new Error(le)},"parseError"),setInput:b(function(ke,le){return this.yy=le||this.yy||{},this._input=ke,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var ke=this._input[0];this.yytext+=ke,this.yyleng++,this.offset++,this.match+=ke,this.matched+=ke;var le=ke.match(/(?:\r\n?|\n).*/g);return le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ke},"input"),unput:b(function(ke){var le=ke.length,pe=ke.split(/(?:\r\n?|\n)/g);this._input=ke+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-le),this.offset-=le;var U=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),pe.length-1&&(this.yylineno-=pe.length-1);var oe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:pe?(pe.length===U.length?this.yylloc.first_column:0)+U[U.length-pe.length].length-pe[0].length:this.yylloc.first_column-le},this.options.ranges&&(this.yylloc.range=[oe[0],oe[0]+this.yyleng-le]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(ke){this.unput(this.match.slice(ke))},"less"),pastInput:b(function(){var ke=this.matched.substr(0,this.matched.length-this.match.length);return(ke.length>20?"...":"")+ke.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var ke=this.match;return ke.length<20&&(ke+=this._input.substr(0,20-ke.length)),(ke.substr(0,20)+(ke.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var ke=this.pastInput(),le=new Array(ke.length+1).join("-");return ke+this.upcomingInput()+` +`+le+"^"},"showPosition"),test_match:b(function(ke,le){var pe,U,oe;if(this.options.backtrack_lexer&&(oe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(oe.yylloc.range=this.yylloc.range.slice(0))),U=ke[0].match(/(?:\r\n?|\n).*/g),U&&(this.yylineno+=U.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:U?U[U.length-1].length-U[U.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ke[0].length},this.yytext+=ke[0],this.match+=ke[0],this.matches=ke,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ke[0].length),this.matched+=ke[0],pe=this.performAction.call(this,this.yy,this,le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),pe)return pe;if(this._backtrack){for(var Q in oe)this[Q]=oe[Q];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ke,le,pe,U;this._more||(this.yytext="",this.match="");for(var oe=this._currentRules(),Q=0;Qle[0].length)){if(le=pe,U=Q,this.options.backtrack_lexer){if(ke=this.test_match(pe,oe[Q]),ke!==!1)return ke;if(this._backtrack){le=!1;continue}else return!1}else if(!this.options.flex)break}return le?(ke=this.test_match(le,oe[U]),ke!==!1?ke:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var le=this.next();return le||this.lex()},"lex"),begin:b(function(le){this.conditionStack.push(le)},"begin"),popState:b(function(){var le=this.conditionStack.length-1;return le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(le){return le=this.conditionStack.length-1-Math.abs(le||0),le>=0?this.conditionStack[le]:"INITIAL"},"topState"),pushState:b(function(le){this.begin(le)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(le,pe,U,oe){switch(U){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return ye})();Le.lexer=Ye;function ce(){this.yy={}}return b(ce,"Parser"),ce.prototype=Le,Le.Parser=ce,new ce})();mF.parser=mF;var lbe=mF,cbe=["#","+","~","-",""],ube=(F2=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Qr(e,Ve());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+ah(this.id);this.memberType==="method"&&(e+=`(${ah(this.parameters.trim())})`,this.returnType&&(e+=" : "+ah(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(cbe.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);cbe.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${ah(this.id)}${this.memberType==="method"?`(${ah(this.parameters)})${this.returnType?" : "+ah(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},b(F2,"ClassMember"),F2),t6="classId-",hbe=0,Up=b(t=>$t.sanitizeText(t,Ve()),"sanitizeText"),dbe=(wd=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=b(e=>{const r=QD();mt(e).select("svg").selectAll("g").filter(function(){return mt(this).attr("title")!==null}).on("mouseover",a=>{const s=mt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(zc.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),mt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=qn,this.getAccTitle=Qn,this.setAccDescription=Jn,this.getAccDescription=ei,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getConfig=b(()=>Ve().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=$t.sanitizeText(e,Ve());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=Up(a[0]),n=Up(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=$t.sanitizeText(e,Ve());r&&(r=Up(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=$t.sanitizeText(e,Ve()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=$t.sanitizeText(n,Ve());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:t6+a+"-"+hbe}),hbe++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=$t.sanitizeText(e,Ve());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",zn()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){he.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=$t.sanitizeText(e.relationTitle1.trim(),Ve()),e.relationTitle2=$t.sanitizeText(e.relationTitle2.trim(),Ve()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(Up(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new ube(a,"method")):a&&i.members.push(new ube(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),Up(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=t6+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=Up(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Ve();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=t6+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=Er.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=Up(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,s=this.classes.get(a);s&&(s.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=$t.sanitizeText(e,Ve());if(Ve().securityLevel!=="loose"||r===void 0)return;const s=this.splitClassNameAndType(i).className;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Er.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Ve(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:I0(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},b(wd,"ClassDB"),wd),X0t=b(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2225,13 +2240,13 @@ g.classGroup line { } text-align: center; } - ${vx()} -`,"getStyles"),Sme=Xct,Kct=T((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),jct=T(function(t,e){return e.db.getClasses()},"getClasses"),Zct=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=$e();n.db.setDiagramId(e);const o=n.db.getData(),l=Z0(e,i);o.type=n.type,o.layoutAlgorithm=cb(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Jp(o,l);const u=8;Lr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Ud(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Ame={getClasses:jct,draw:Zct,getDir:Kct},Qct={parser:Tme,get db(){return new Eme},renderer:Ame,styles:Sme,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Jct=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qct},Symbol.toStringTag,{value:"Module"}));var eut={parser:Tme,get db(){return new Eme},renderer:Ame,styles:Sme,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const tut=Object.freeze(Object.defineProperty({__proto__:null,diagram:eut},Symbol.toStringTag,{value:"Module"}));var O$=(function(){var t=T(function($,P,B,q){for(B=B||{},q=$.length;q--;B[$[q]]=P);return B},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],k=[1,30],S=[1,31],C=[1,32],_=[1,35],L=[1,36],O=[1,37],D=[1,38],z=[1,34],F=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:T(function(P,B,q,V,X,W,ie){var K=W.length-1;switch(X){case 3:return V.setRootDoc(W[K]),W[K];case 4:this.$=[];break;case 5:W[K]!="nl"&&(W[K-1].push(W[K]),this.$=W[K-1]);break;case 6:case 7:this.$=W[K];break;case 8:this.$="nl";break;case 12:this.$=W[K];break;case 13:const ee=W[K-1];ee.description=V.trimColon(W[K]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:W[K-2],state2:W[K]};break;case 15:const ne=V.trimColon(W[K]);this.$={stmt:"relation",state1:W[K-3],state2:W[K-1],description:ne};break;case 19:this.$={stmt:"state",id:W[K-3],type:"default",description:"",doc:W[K-1]};break;case 20:var se=W[K],te=W[K-2].trim();if(W[K].match(":")){var Z=W[K].split(":");se=Z[0],te=[te,Z[1]]}this.$={stmt:"state",id:se,type:"default",description:te};break;case 21:this.$={stmt:"state",id:W[K-3],type:"default",description:W[K-5],doc:W[K-1]};break;case 22:this.$={stmt:"state",id:W[K],type:"fork"};break;case 23:this.$={stmt:"state",id:W[K],type:"join"};break;case 24:this.$={stmt:"state",id:W[K],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[K-1].trim(),note:{position:W[K-2].trim(),text:W[K].trim()}};break;case 29:this.$=W[K].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=W[K].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[K-3],url:W[K-2],tooltip:W[K-1]};break;case 33:this.$={stmt:"click",id:W[K-3],url:W[K-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[K-1].trim(),classes:W[K].trim()};break;case 36:this.$={stmt:"style",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 37:this.$={stmt:"applyClass",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[K].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:D,57:z},t(F,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:D,57:z},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(F,[2,11]),t(F,[2,12],{14:[1,40],15:[1,41]}),t(F,[2,16]),{18:[1,42]},t(F,[2,18],{20:[1,43]}),{23:[1,44]},t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),t(F,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(F,[2,28]),{34:[1,49]},{36:[1,50]},t(F,[2,31]),{13:51,24:d,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(F,[2,38]),t(F,[2,39]),t(F,[2,40]),t(F,[2,41]),t(F,[2,6]),t(F,[2,13]),{13:58,24:d,57:z},t(F,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(F,[2,29]),t(F,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(F,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:D,57:z},t(F,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(A,[2,46]),t(A,[2,47]),t(F,[2,15]),t(F,[2,19]),t(R,i,{7:78}),t(F,[2,26]),t(F,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:D,57:z},t(F,[2,32]),t(F,[2,33]),t(F,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:T(function(P,B){if(B.recoverable)this.trace(P);else{var q=new Error(P);throw q.hash=B,q}},"parseError"),parse:T(function(P){var B=this,q=[0],V=[],X=[null],W=[],ie=this.table,K="",se=0,te=0,Z=2,ee=1,ne=W.slice.call(arguments,1),oe=Object.create(this.lexer),fe={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(fe.yy[Ae]=this.yy[Ae]);oe.setInput(P,fe.yy),fe.yy.lexer=oe,fe.yy.parser=this,typeof oe.yylloc>"u"&&(oe.yylloc={});var Re=oe.yylloc;W.push(Re);var Ge=oe.options&&oe.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(Se){q.length=q.length-2*Se,X.length=X.length-Se,W.length=W.length-Se}T(Ce,"popStack");function be(){var Se;return Se=V.pop()||oe.lex()||ee,typeof Se!="number"&&(Se instanceof Array&&(V=Se,Se=V.pop()),Se=B.symbols_[Se]||Se),Se}T(be,"lex");for(var Fe,ye,He,xe,Ve={},Je,nt,tt,Ze;;){if(ye=q[q.length-1],this.defaultActions[ye]?He=this.defaultActions[ye]:((Fe===null||typeof Fe>"u")&&(Fe=be()),He=ie[ye]&&ie[ye][Fe]),typeof He>"u"||!He.length||!He[0]){var Ee="";Ze=[];for(Je in ie[ye])this.terminals_[Je]&&Je>Z&&Ze.push("'"+this.terminals_[Je]+"'");oe.showPosition?Ee="Parse error on line "+(se+1)+`: -`+oe.showPosition()+` -Expecting `+Ze.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":Ee="Parse error on line "+(se+1)+": Unexpected "+(Fe==ee?"end of input":"'"+(this.terminals_[Fe]||Fe)+"'"),this.parseError(Ee,{text:oe.match,token:this.terminals_[Fe]||Fe,line:oe.yylineno,loc:Re,expected:Ze})}if(He[0]instanceof Array&&He.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ye+", token: "+Fe);switch(He[0]){case 1:q.push(Fe),X.push(oe.yytext),W.push(oe.yylloc),q.push(He[1]),Fe=null,te=oe.yyleng,K=oe.yytext,se=oe.yylineno,Re=oe.yylloc;break;case 2:if(nt=this.productions_[He[1]][1],Ve.$=X[X.length-nt],Ve._$={first_line:W[W.length-(nt||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(nt||1)].first_column,last_column:W[W.length-1].last_column},Ge&&(Ve._$.range=[W[W.length-(nt||1)].range[0],W[W.length-1].range[1]]),xe=this.performAction.apply(Ve,[K,te,se,fe.yy,He[1],X,W].concat(ne)),typeof xe<"u")return xe;nt&&(q=q.slice(0,-1*nt*2),X=X.slice(0,-1*nt),W=W.slice(0,-1*nt)),q.push(this.productions_[He[1]][0]),X.push(Ve.$),W.push(Ve._$),tt=ie[q[q.length-2]][q[q.length-1]],q.push(tt);break;case 3:return!0}}return!0},"parse")},M=(function(){var $={EOF:1,parseError:T(function(B,q){if(this.yy.parser)this.yy.parser.parseError(B,q);else throw new Error(B)},"parseError"),setInput:T(function(P,B){return this.yy=B||this.yy||{},this._input=P,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var P=this._input[0];this.yytext+=P,this.yyleng++,this.offset++,this.match+=P,this.matched+=P;var B=P.match(/(?:\r\n?|\n).*/g);return B?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),P},"input"),unput:T(function(P){var B=P.length,q=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-B),this.offset-=B;var V=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),q.length-1&&(this.yylineno-=q.length-1);var X=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:q?(q.length===V.length?this.yylloc.first_column:0)+V[V.length-q.length].length-q[0].length:this.yylloc.first_column-B},this.options.ranges&&(this.yylloc.range=[X[0],X[0]+this.yyleng-B]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(P){this.unput(this.match.slice(P))},"less"),pastInput:T(function(){var P=this.matched.substr(0,this.matched.length-this.match.length);return(P.length>20?"...":"")+P.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var P=this.match;return P.length<20&&(P+=this._input.substr(0,20-P.length)),(P.substr(0,20)+(P.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var P=this.pastInput(),B=new Array(P.length+1).join("-");return P+this.upcomingInput()+` -`+B+"^"},"showPosition"),test_match:T(function(P,B){var q,V,X;if(this.options.backtrack_lexer&&(X={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(X.yylloc.range=this.yylloc.range.slice(0))),V=P[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],q=this.performAction.call(this,this.yy,this,B,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),q)return q;if(this._backtrack){for(var W in X)this[W]=X[W];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var P,B,q,V;this._more||(this.yytext="",this.match="");for(var X=this._currentRules(),W=0;WB[0].length)){if(B=q,V=W,this.options.backtrack_lexer){if(P=this.test_match(q,X[W]),P!==!1)return P;if(this._backtrack){B=!1;continue}else return!1}else if(!this.options.flex)break}return B?(P=this.test_match(B,X[V]),P!==!1?P:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var B=this.next();return B||this.lex()},"lex"),begin:T(function(B){this.conditionStack.push(B)},"begin"),popState:T(function(){var B=this.conditionStack.length-1;return B>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(B){return B=this.conditionStack.length-1-Math.abs(B||0),B>=0?this.conditionStack[B]:"INITIAL"},"topState"),pushState:T(function(B){this.begin(B)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(B,q,V,X){function W(){const ie=q.yytext.indexOf("%%");if(ie===0)return!1;if(ie>0){const K=q.yytext.slice(0,ie),se=q.yytext.slice(ie);se&&B.lexer.unput(se),q.yytext=K}return!0}switch(T(W,"processId"),V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),q.yytext=q.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),q.yytext=q.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),q.yytext=q.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),q.yytext=q.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),q.yytext=q.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),q.yytext=q.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return W()?(this.popState(),"ID"):void 0;case 65:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),q.yytext=q.yytext.substr(2).trim(),31;case 67:return this.popState(),q.yytext=q.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return W()?24:void 0;case 73:return q.yytext=q.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return $})();N.lexer=M;function I(){this.yy={}}return T(I,"Parser"),I.prototype=N,N.Parser=I,new I})();O$.parser=O$;var _me=O$,rut="TB",Rme="TB",Lme="dir",am="state",sm="root",$$="relation",nut="classDef",iut="style",aut="applyClass",JT="default",Ime="divider",Dme="fill:none",Mme="fill: #333",Nme="c",Ome="markdown",$me="normal",P$="rect",B$="rectWithTitle",sut="stateStart",out="stateEnd",Pme="divider",Bme="roundedWithTitle",lut="note",cut="noteGroup",ew="statediagram",uut="state",hut=`${ew}-${uut}`,Fme="transition",dut="note",fut="note-edge",put=`${Fme} ${fut}`,gut=`${ew}-${dut}`,mut="cluster",yut=`${ew}-${mut}`,vut="cluster-alt",but=`${ew}-${vut}`,zme="parent",Gme="note",xut="state",F$="----",Tut=`${F$}${Gme}`,qme=`${F$}${zme}`,Vme=T((t,e=Rme)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),wut=T(function(t,e){return e.db.getClasses()},"getClasses"),Cut=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=$e();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Z0(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,$e().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Jp(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"";if(!g){ae.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const m=(w=l.node())==null?void 0:w.querySelectorAll("g");let y;if(m==null||m.forEach(k=>{var C;((C=k.textContent)==null?void 0:C.trim())===g&&(y=k)}),!y){ae.warn("⚠️ Could not find node matching text:",g);return}const v=y.parentNode;if(!v){ae.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),b=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),x.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",k)}v.replaceChild(x,y),x.appendChild(y),ae.info("🔗 Wrapped node in
    tag for:",g,f.url)})}catch(d){ae.error("❌ Error injecting clickable links:",d)}Lr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Ud(l,h,ew,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),kut={getClasses:wut,draw:Cut,getDir:Vme},OS=new Map,Nh=0;function $S(t="",e=0,r="",n=F$){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${xut}-${t}${i}-${e}`}T($S,"stateDomId");var Eut=T((t,e,r,n,i,a,s,o)=>{ae.trace("items",e),e.forEach(l=>{switch(l.stmt){case am:rw(t,l,r,n,i,a,s,o);break;case JT:rw(t,l,r,n,i,a,s,o);break;case $$:{rw(t,l.state1,r,n,i,a,s,o),rw(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Nh,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Dme,labelStyle:"",label:It.sanitizeText(l.description??"",$e()),arrowheadStyle:Mme,labelpos:Nme,labelType:Ome,thickness:$me,classes:Fme,look:s};i.push(h),Nh++}break}})},"setupDoc"),Wme=T((t,e=Rme)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function tw(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}T(tw,"insertOrUpdateNode");function Ume(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}T(Ume,"getClassesFromDbInfo");function Hme(t){return(t==null?void 0:t.styles)??[]}T(Hme,"getStylesFromDbInfo");var rw=T((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Ume(u),d=Hme(u),f=$e();if(ae.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=P$;e.start===!0?y=sut:e.start===!1&&(y=out),e.type!==JT&&(y=e.type),OS.get(l)||OS.set(l,{id:l,shape:y,description:It.sanitizeText(l,f),cssClasses:`${h} ${hut}`,cssStyles:d});const v=OS.get(l);e.description&&(Array.isArray(v.description)?(v.shape=B$,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=B$,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=P$,v.description=e.description),v.description=It.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===B$&&(v.type==="group"?v.shape=Bme:v.shape=P$),!v.type&&e.doc&&(ae.info("Setting cluster for XCX",l,Wme(e)),v.type="group",v.isGroup=!0,v.dir=Wme(e),v.shape=e.type===Ime?Pme:Bme,v.cssClasses=`${v.cssClasses} ${yut} ${a?but:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:$S(l,Nh),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(x.shape===Pme&&(x.label=""),t&&t.id!=="root"&&(ae.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:lut,label:e.note.text,labelType:"markdown",cssClasses:gut,cssStyles:[],cssCompiledStyles:[],id:l+Tut+"-"+Nh,domId:$S(l,Nh,Gme),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+qme,k={labelStyle:"",shape:cut,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+qme,domId:$S(l,Nh,zme),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Nh++,k.id=w,b.parentId=w,tw(n,k,o),tw(n,b,o),tw(n,x,o);let S=l,C=b.id;e.note.position==="left of"&&(S=b.id,C=l),i.push({id:S+"-"+C,start:S,end:C,arrowhead:"none",arrowTypeEnd:"",style:Dme,labelStyle:"",classes:put,arrowheadStyle:Mme,labelpos:Nme,labelType:Ome,thickness:$me,look:s})}else tw(n,x,o)}e.doc&&(ae.trace("Adding nodes children "),Eut(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),Sut=T(()=>{OS.clear(),Nh=0},"reset"),fs={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Yme=T(()=>new Map,"newClassesList"),Xme=T(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),PS=T(t=>JSON.parse(JSON.stringify(t)),"clone"),ip=(hp=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Yme(),this.documents={root:Xme()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=Gn,this.setAccTitle=Mn,this.getAccDescription=Vn,this.setAccDescription=qn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case am:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case $$:this.addRelation(i.state1,i.state2,i.description);break;case nut:this.addStyleClass(i.id.trim(),i.classes);break;case iut:this.handleStyleDef(i);break;case aut:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=$e();Sut(),rw(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){ae.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===$$){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===am&&(r.id===fs.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==sm&&r.stmt!==am||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===Ime){const o=PS(s);o.doc=PS(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:am,id:bV(),type:"divider",doc:PS(a)};i.push(PS(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:sm,stmt:sm},{id:sm,stmt:sm,doc:this.rootDoc},!0),{id:sm,doc:this.rootDoc}}addState(e,r=JT,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ae.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:am,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(ae.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=It.sanitizeText(h.note.text,$e())}s&&(ae.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ae.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ae.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Xme()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Yme(),e||(this.links=new Map,Dn())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ae.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ae.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===fs.START_NODE?(this.startEndCount++,`${fs.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=JT){return e===fs.START_NODE?fs.START_TYPE:r}endIdIfNeeded(e=""){return e===fs.END_NODE?(this.startEndCount++,`${fs.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=JT){return e===fs.END_NODE?fs.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:It.sanitizeText(n,$e())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?It.sanitizeText(n,$e()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(It.sanitizeText(i,$e()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(fs.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(fs.COLOR_KEYWORD).exec(i)){const o=a.replace(fs.FILL_KEYWORD,fs.BG_FILL).replace(fs.COLOR_KEYWORD,fs.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Lme)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??rut}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Lme,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=$e();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Vme(this.getRootDocV2())}}getConfig(){return $e().state}},T(hp,"StateDB"),hp.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},hp),Aut=T(t=>` + ${gT()} +`,"getStyles"),fbe=X0t,j0t=b((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),K0t=b(function(t,e){return e.db.getClasses()},"getClasses"),Z0t=b(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Ve();n.db.setDiagramId(e);const o=n.db.getData(),l=Wg(e,i);o.type=n.type,o.layoutAlgorithm=ax(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await B0(o,l);const u=8;Er.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Nf(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),pbe={getClasses:K0t,draw:Z0t,getDir:j0t},Q0t={parser:lbe,get db(){return new dbe},renderer:pbe,styles:fbe,init:b(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const J0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:Q0t},Symbol.toStringTag,{value:"Module"}));var egt={parser:lbe,get db(){return new dbe},renderer:pbe,styles:fbe,init:b(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const tgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:egt},Symbol.toStringTag,{value:"Module"}));var yF=(function(){var t=b(function(B,F,G,z){for(G=G||{},z=B.length;z--;G[B[z]]=F);return G},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],x=[1,28],w=[1,29],C=[1,30],k=[1,31],S=[1,32],E=[1,35],L=[1,36],M=[1,37],I=[1,38],P=[1,34],$=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],_=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],O={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:b(function(F,G,z,W,V,H,te){var Y=H.length-1;switch(V){case 3:return W.setRootDoc(H[Y]),H[Y];case 4:this.$=[];break;case 5:H[Y]!="nl"&&(H[Y-1].push(H[Y]),this.$=H[Y-1]);break;case 6:case 7:this.$=H[Y];break;case 8:this.$="nl";break;case 12:this.$=H[Y];break;case 13:const ee=H[Y-1];ee.description=W.trimColon(H[Y]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:H[Y-2],state2:H[Y]};break;case 15:const re=W.trimColon(H[Y]);this.$={stmt:"relation",state1:H[Y-3],state2:H[Y-1],description:re};break;case 19:this.$={stmt:"state",id:H[Y-3],type:"default",description:"",doc:H[Y-1]};break;case 20:var se=H[Y],J=H[Y-2].trim();if(H[Y].match(":")){var Z=H[Y].split(":");se=Z[0],J=[J,Z[1]]}this.$={stmt:"state",id:se,type:"default",description:J};break;case 21:this.$={stmt:"state",id:H[Y-3],type:"default",description:H[Y-5],doc:H[Y-1]};break;case 22:this.$={stmt:"state",id:H[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:H[Y],type:"join"};break;case 24:this.$={stmt:"state",id:H[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:W.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:H[Y-1].trim(),note:{position:H[Y-2].trim(),text:H[Y].trim()}};break;case 29:this.$=H[Y].trim(),W.setAccTitle(this.$);break;case 30:case 31:this.$=H[Y].trim(),W.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:H[Y-3],url:H[Y-2],tooltip:H[Y-1]};break;case 33:this.$={stmt:"click",id:H[Y-3],url:H[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:H[Y-1].trim(),classes:H[Y].trim()};break;case 36:this.$={stmt:"style",id:H[Y-1].trim(),styleClass:H[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:H[Y-1].trim(),styleClass:H[Y].trim()};break;case 38:W.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:W.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:W.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:W.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:H[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:H[Y-2].trim(),classes:[H[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:H[Y-2].trim(),classes:[H[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:x,38:w,41:C,45:k,48:S,51:E,52:L,53:M,54:I,57:P},t($,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:x,38:w,41:C,45:k,48:S,51:E,52:L,53:M,54:I,57:P},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,10]),t($,[2,11]),t($,[2,12],{14:[1,40],15:[1,41]}),t($,[2,16]),{18:[1,42]},t($,[2,18],{20:[1,43]}),{23:[1,44]},t($,[2,22]),t($,[2,23]),t($,[2,24]),t($,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t($,[2,28]),{34:[1,49]},{36:[1,50]},t($,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(_,[2,44],{58:[1,56]}),t(_,[2,45],{58:[1,57]}),t($,[2,38]),t($,[2,39]),t($,[2,40]),t($,[2,41]),t($,[2,6]),t($,[2,13]),{13:58,24:d,57:P},t($,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t($,[2,29]),t($,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t($,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:x,38:w,41:C,45:k,48:S,51:E,52:L,53:M,54:I,57:P},t($,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t($,[2,34]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t(_,[2,46]),t(_,[2,47]),t($,[2,15]),t($,[2,19]),t(R,i,{7:78}),t($,[2,26]),t($,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:x,38:w,41:C,45:k,48:S,51:E,52:L,53:M,54:I,57:P},t($,[2,32]),t($,[2,33]),t($,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:b(function(F,G){if(G.recoverable)this.trace(F);else{var z=new Error(F);throw z.hash=G,z}},"parseError"),parse:b(function(F){var G=this,z=[0],W=[],V=[null],H=[],te=this.table,Y="",se=0,J=0,Z=2,ee=1,re=H.slice.call(arguments,1),ge=Object.create(this.lexer),ae={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(ae.yy[_e]=this.yy[_e]);ge.setInput(F,ae.yy),ae.yy.lexer=ge,ae.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var Fe=ge.yylloc;H.push(Fe);var qe=ge.options&&ge.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(pe){z.length=z.length-2*pe,V.length=V.length-pe,H.length=H.length-pe}b(ue,"popStack");function de(){var pe;return pe=W.pop()||ge.lex()||ee,typeof pe!="number"&&(pe instanceof Array&&(W=pe,pe=W.pop()),pe=G.symbols_[pe]||pe),pe}b(de,"lex");for(var Ce,me,$e,we,Le={},Ye,ce,ye,ke;;){if(me=z[z.length-1],this.defaultActions[me]?$e=this.defaultActions[me]:((Ce===null||typeof Ce>"u")&&(Ce=de()),$e=te[me]&&te[me][Ce]),typeof $e>"u"||!$e.length||!$e[0]){var le="";ke=[];for(Ye in te[me])this.terminals_[Ye]&&Ye>Z&&ke.push("'"+this.terminals_[Ye]+"'");ge.showPosition?le="Parse error on line "+(se+1)+`: +`+ge.showPosition()+` +Expecting `+ke.join(", ")+", got '"+(this.terminals_[Ce]||Ce)+"'":le="Parse error on line "+(se+1)+": Unexpected "+(Ce==ee?"end of input":"'"+(this.terminals_[Ce]||Ce)+"'"),this.parseError(le,{text:ge.match,token:this.terminals_[Ce]||Ce,line:ge.yylineno,loc:Fe,expected:ke})}if($e[0]instanceof Array&&$e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+me+", token: "+Ce);switch($e[0]){case 1:z.push(Ce),V.push(ge.yytext),H.push(ge.yylloc),z.push($e[1]),Ce=null,J=ge.yyleng,Y=ge.yytext,se=ge.yylineno,Fe=ge.yylloc;break;case 2:if(ce=this.productions_[$e[1]][1],Le.$=V[V.length-ce],Le._$={first_line:H[H.length-(ce||1)].first_line,last_line:H[H.length-1].last_line,first_column:H[H.length-(ce||1)].first_column,last_column:H[H.length-1].last_column},qe&&(Le._$.range=[H[H.length-(ce||1)].range[0],H[H.length-1].range[1]]),we=this.performAction.apply(Le,[Y,J,se,ae.yy,$e[1],V,H].concat(re)),typeof we<"u")return we;ce&&(z=z.slice(0,-1*ce*2),V=V.slice(0,-1*ce),H=H.slice(0,-1*ce)),z.push(this.productions_[$e[1]][0]),V.push(Le.$),H.push(Le._$),ye=te[z[z.length-2]][z[z.length-1]],z.push(ye);break;case 3:return!0}}return!0},"parse")},D=(function(){var B={EOF:1,parseError:b(function(G,z){if(this.yy.parser)this.yy.parser.parseError(G,z);else throw new Error(G)},"parseError"),setInput:b(function(F,G){return this.yy=G||this.yy||{},this._input=F,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var F=this._input[0];this.yytext+=F,this.yyleng++,this.offset++,this.match+=F,this.matched+=F;var G=F.match(/(?:\r\n?|\n).*/g);return G?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),F},"input"),unput:b(function(F){var G=F.length,z=F.split(/(?:\r\n?|\n)/g);this._input=F+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-G),this.offset-=G;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1&&(this.yylineno-=z.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===W.length?this.yylloc.first_column:0)+W[W.length-z.length].length-z[0].length:this.yylloc.first_column-G},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-G]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(F){this.unput(this.match.slice(F))},"less"),pastInput:b(function(){var F=this.matched.substr(0,this.matched.length-this.match.length);return(F.length>20?"...":"")+F.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var F=this.match;return F.length<20&&(F+=this._input.substr(0,20-F.length)),(F.substr(0,20)+(F.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var F=this.pastInput(),G=new Array(F.length+1).join("-");return F+this.upcomingInput()+` +`+G+"^"},"showPosition"),test_match:b(function(F,G){var z,W,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),W=F[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+F[0].length},this.yytext+=F[0],this.match+=F[0],this.matches=F,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(F[0].length),this.matched+=F[0],z=this.performAction.call(this,this.yy,this,G,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),z)return z;if(this._backtrack){for(var H in V)this[H]=V[H];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var F,G,z,W;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),H=0;HG[0].length)){if(G=z,W=H,this.options.backtrack_lexer){if(F=this.test_match(z,V[H]),F!==!1)return F;if(this._backtrack){G=!1;continue}else return!1}else if(!this.options.flex)break}return G?(F=this.test_match(G,V[W]),F!==!1?F:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var G=this.next();return G||this.lex()},"lex"),begin:b(function(G){this.conditionStack.push(G)},"begin"),popState:b(function(){var G=this.conditionStack.length-1;return G>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(G){return G=this.conditionStack.length-1-Math.abs(G||0),G>=0?this.conditionStack[G]:"INITIAL"},"topState"),pushState:b(function(G){this.begin(G)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(G,z,W,V){function H(){const te=z.yytext.indexOf("%%");if(te===0)return!1;if(te>0){const Y=z.yytext.slice(0,te),se=z.yytext.slice(te);se&&G.lexer.unput(se),z.yytext=Y}return!0}switch(b(H,"processId"),W){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return H()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+z.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return H()?(this.popState(),"ID"):void 0;case 66:return H()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;case 68:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return H()?24:void 0;case 74:return z.yytext=z.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return B})();O.lexer=D;function N(){this.yy={}}return b(N,"Parser"),N.prototype=O,O.Parser=N,new N})();yF.parser=yF;var gbe=yF,rgt="TB",mbe="TB",ybe="dir",Qm="state",Jm="root",vF="relation",ngt="classDef",igt="style",agt="applyClass",Kw="default",vbe="divider",bbe="fill:none",xbe="fill: #333",Tbe="c",wbe="markdown",Cbe="normal",bF="rect",xF="rectWithTitle",sgt="stateStart",ogt="stateEnd",Sbe="divider",kbe="roundedWithTitle",lgt="note",cgt="noteGroup",Zw="statediagram",ugt="state",hgt=`${Zw}-${ugt}`,Ebe="transition",dgt="note",fgt="note-edge",pgt=`${Ebe} ${fgt}`,ggt=`${Zw}-${dgt}`,mgt="cluster",ygt=`${Zw}-${mgt}`,vgt="cluster-alt",bgt=`${Zw}-${vgt}`,Abe="parent",_be="note",xgt="state",TF="----",Tgt=`${TF}${_be}`,Rbe=`${TF}${Abe}`,Lbe=b((t,e=mbe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),wgt=b(function(t,e){return e.db.getClasses()},"getClasses"),Cgt=b(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Ve();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Wg(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Ve().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await B0(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(k=>k.id===g);if(!g){he.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(k=>{var E;const S=(E=k.textContent)==null?void 0:E.trim();(k.id===(m==null?void 0:m.domId)||S===g)&&(v=k)}),!v){he.warn("⚠️ Could not find node matching text:",g);return}const T=v.parentNode;if(!T){he.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),x.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",k),v.setAttribute("title",k)}T.replaceChild(x,v),x.appendChild(v),he.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){he.error("❌ Error injecting clickable links:",d)}Er.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Nf(l,h,Zw,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Sgt={getClasses:wgt,draw:Cgt,getDir:Lbe},r6=new Map,md=0;function n6(t="",e=0,r="",n=TF){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${xgt}-${t}${i}-${e}`}b(n6,"stateDomId");var kgt=b((t,e,r,n,i,a,s,o)=>{he.trace("items",e),e.forEach(l=>{switch(l.stmt){case Qm:Jw(t,l,r,n,i,a,s,o);break;case Kw:Jw(t,l,r,n,i,a,s,o);break;case vF:{Jw(t,l.state1,r,n,i,a,s,o),Jw(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+md,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:bbe,labelStyle:"",label:$t.sanitizeText(l.description??"",Ve()),arrowheadStyle:xbe,labelpos:Tbe,labelType:wbe,thickness:Cbe,classes:Ebe,look:s};i.push(h),md++}break}})},"setupDoc"),Ibe=b((t,e=mbe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function Qw(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}b(Qw,"insertOrUpdateNode");function Mbe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}b(Mbe,"getClassesFromDbInfo");function Dbe(t){return(t==null?void 0:t.styles)??[]}b(Dbe,"getStylesFromDbInfo");var Jw=b((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Mbe(u),d=Dbe(u),f=Ve();if(he.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=bF;e.start===!0?y=sgt:e.start===!1&&(y=ogt),e.type!==Kw&&(y=e.type),r6.get(l)||r6.set(l,{id:l,shape:y,description:$t.sanitizeText(l,f),cssClasses:`${h} ${hgt}`,cssStyles:d});const v=r6.get(l);e.description&&(Array.isArray(v.description)?(v.shape=xF,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=xF,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=bF,v.description=e.description),v.description=$t.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===xF&&(v.type==="group"?v.shape=kbe:v.shape=bF),!v.type&&e.doc&&(he.info("Setting cluster for XCX",l,Ibe(e)),v.type="group",v.isGroup=!0,v.dir=Ibe(e),v.explicitDir=e.doc.some(x=>x.stmt==="dir"),v.shape=e.type===vbe?Sbe:kbe,v.cssClasses=`${v.cssClasses} ${ygt} ${a?bgt:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:n6(l,md),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===Sbe&&(T.label=""),t&&t.id!=="root"&&(he.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const x={labelStyle:"",shape:lgt,label:e.note.text,labelType:"markdown",cssClasses:ggt,cssStyles:[],cssCompiledStyles:[],id:l+Tgt+"-"+md,domId:n6(l,md,_be),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Rbe,C={labelStyle:"",shape:cgt,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Rbe,domId:n6(l,md,Abe),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};md++,C.id=w,x.parentId=w,Qw(n,C,o),Qw(n,x,o),Qw(n,T,o);let k=l,S=x.id;e.note.position==="left of"&&(k=x.id,S=l),i.push({id:k+"-"+S,start:k,end:S,arrowhead:"none",arrowTypeEnd:"",style:bbe,labelStyle:"",classes:pgt,arrowheadStyle:xbe,labelpos:Tbe,labelType:wbe,thickness:Cbe,look:s})}else Qw(n,T,o)}e.doc&&(he.trace("Adding nodes children "),kgt(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),Egt=b(()=>{r6.clear(),md=0},"reset"),$s={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Nbe=b(()=>new Map,"newClassesList"),Obe=b(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),i6=b(t=>JSON.parse(JSON.stringify(t)),"clone"),Hp=(e0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Nbe(),this.documents={root:Obe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Qn,this.setAccTitle=qn,this.getAccDescription=ei,this.setAccDescription=Jn,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Qm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case vF:this.addRelation(i.state1,i.state2,i.description);break;case ngt:this.addStyleClass(i.id.trim(),i.classes);break;case igt:this.handleStyleDef(i);break;case agt:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Ve();Egt(),Jw(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){he.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===vF){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===Qm&&(r.id===$s.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==Jm&&r.stmt!==Qm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===vbe){const o=i6(s);o.doc=i6(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:Qm,id:hH(),type:"divider",doc:i6(a)};i.push(i6(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:Jm,stmt:Jm},{id:Jm,stmt:Jm,doc:this.rootDoc},!0),{id:Jm,doc:this.rootDoc}}addState(e,r=Kw,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))he.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:Qm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(he.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=$t.sanitizeText(h.note.text,Ve())}s&&(he.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(he.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(he.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Obe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Nbe(),e||(this.links=new Map,zn())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){he.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),he.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===$s.START_NODE?(this.startEndCount++,`${$s.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=Kw){return e===$s.START_NODE?$s.START_TYPE:r}endIdIfNeeded(e=""){return e===$s.END_NODE?(this.startEndCount++,`${$s.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=Kw){return e===$s.END_NODE?$s.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:$t.sanitizeText(n,Ve())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?$t.sanitizeText(n,Ve()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push($t.sanitizeText(i,Ve()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split($s.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp($s.COLOR_KEYWORD).exec(i)){const o=a.replace($s.FILL_KEYWORD,$s.BG_FILL).replace($s.COLOR_KEYWORD,$s.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=QD();mt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=mt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(zc.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),mt(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===ybe)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??rgt}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:ybe,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Ve();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Lbe(this.getRootDocV2())}}getConfig(){return Ve().state}},b(e0,"StateDB"),e0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},e0),Agt=b(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2456,12 +2471,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),Kme=Aut,_ut=T(t=>t.append("circle").attr("class","start-state").attr("r",$e().state.sizeUnit).attr("cx",$e().state.padding+$e().state.sizeUnit).attr("cy",$e().state.padding+$e().state.sizeUnit),"drawStartState"),Rut=T(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",$e().state.textHeight).attr("class","divider").attr("x2",$e().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Lut=T((t,e)=>{const r=t.append("text").attr("x",2*$e().state.padding).attr("y",$e().state.textHeight+2*$e().state.padding).attr("font-size",$e().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",$e().state.padding).attr("y",$e().state.padding).attr("width",n.width+2*$e().state.padding).attr("height",n.height+2*$e().state.padding).attr("rx",$e().state.radius),r},"drawSimpleState"),Iut=T((t,e)=>{const r=T(function(f,p,g){const m=f.append("tspan").attr("x",2*$e().state.padding).text(p);g||m.attr("dy",$e().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*$e().state.padding).attr("y",$e().state.textHeight+1.3*$e().state.padding).attr("font-size",$e().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",$e().state.padding).attr("y",a+$e().state.padding*.4+$e().state.dividerMargin+$e().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",$e().state.padding).attr("y1",$e().state.padding+a+$e().state.dividerMargin/2).attr("y2",$e().state.padding+a+$e().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*$e().state.padding),t.insert("rect",":first-child").attr("x",$e().state.padding).attr("y",$e().state.padding).attr("width",d+2*$e().state.padding).attr("height",h.height+a+2*$e().state.padding).attr("rx",$e().state.radius),t},"drawDescrState"),Dut=T((t,e,r)=>{const n=$e().state.padding,i=2*$e().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",$e().state.titleShift).attr("font-size",$e().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-$e().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+$e().state.textHeight+$e().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",$e().state.titleShift-$e().state.textHeight-$e().state.padding).attr("width",d).attr("height",$e().state.textHeight*3).attr("rx",$e().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",$e().state.titleShift-$e().state.textHeight-$e().state.padding).attr("width",d).attr("height",p.height+3+2*$e().state.textHeight).attr("rx",$e().state.radius),t},"addTitleAndBox"),Mut=T(t=>(t.append("circle").attr("class","end-state-outer").attr("r",$e().state.sizeUnit+$e().state.miniPadding).attr("cx",$e().state.padding+$e().state.sizeUnit+$e().state.miniPadding).attr("cy",$e().state.padding+$e().state.sizeUnit+$e().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",$e().state.sizeUnit).attr("cx",$e().state.padding+$e().state.sizeUnit+2).attr("cy",$e().state.padding+$e().state.sizeUnit+2)),"drawEndState"),Nut=T((t,e)=>{let r=$e().state.forkWidth,n=$e().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",$e().state.padding).attr("y",$e().state.padding)},"drawForkJoinState"),Out=T((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(It.lineBreakRegex);let l=1.25*$e().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+$e().state.noteMargin),d.attr("y",r+i+1.25*$e().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),$ut=T((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",$e().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=Out(t,0,0,n);return r.attr("height",a+2*$e().state.noteMargin),r.attr("width",i+$e().state.noteMargin*2),r},"drawNote"),jme=T(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&_ut(i),e.type==="end"&&Mut(i),(e.type==="fork"||e.type==="join")&&Nut(i,e),e.type==="note"&&$ut(e.note.text,i),e.type==="divider"&&Rut(i),e.type==="default"&&e.descriptions.length===0&&Lut(i,e),e.type==="default"&&e.descriptions.length>0&&Iut(i,e);const a=i.node().getBBox();return n.width=a.width+2*$e().state.padding,n.height=a.height+2*$e().state.padding,n},"drawState"),Zme=0,Put=T(function(t,e,r){const n=T(function(l){switch(l){case ip.relationType.AGGREGATION:return"aggregation";case ip.relationType.EXTENSION:return"extension";case ip.relationType.COMPOSITION:return"composition";case ip.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=$2().x(function(l){return l.x}).y(function(l){return l.y}).curve(P2),s=t.append("path").attr("d",a(i)).attr("id","edge"+Zme).attr("class","transition");let o="";if($e().state.arrowMarkerAbsolute&&(o=Mw(!0)),s.attr("marker-end","url("+o+"#"+n(ip.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Lr.calcLabelPosition(e.points),d=It.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),ae.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,ae.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-$e().state.padding/2).attr("y",h-y/2-$e().state.padding/2-3.5).attr("width",g+$e().state.padding).attr("height",y+$e().state.padding),ae.info(v)}Zme++},"drawEdge"),eo,z$={},But=T(function(){},"setConf"),Fut=T(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),zut=T(function(t,e,r,n){eo=$e().state;const i=$e().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;ae.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Fut(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Qme(u,h,void 0,!1,s,o,n);const d=eo.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;vi(l,g,m,eo.useMaxWidth),l.attr("viewBox",`${f.x-eo.padding} ${f.y-eo.padding} `+p+" "+g)},"draw"),Gut=T(t=>t?t.length*eo.fontSizeFactor:1,"getLabelWidth"),Qme=T((t,e,r,n,i,a,s)=>{const o=new xs({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let k=0,S=0;w&&(w.parentElement&&(k=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",k-S-8)})):ae.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(ae.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Put(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*eo.padding,y.height=m.height+2*eo.padding,ae.debug("Doc rendered",y,o),y},"renderDoc"),qut={setConf:But,draw:zut},Vut={parser:_me,get db(){return new ip(1)},renderer:qut,styles:Kme,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Wut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vut},Symbol.toStringTag,{value:"Module"}));var Uut={parser:_me,get db(){return new ip(2)},renderer:kut,styles:Kme,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Hut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uut},Symbol.toStringTag,{value:"Module"}));var G$=(function(){var t=T(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:T(function(f,p,g,m,y,v,x){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:T(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:T(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",w=0,k=0,S=2,C=1,_=v.slice.call(arguments,1),L=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);L.setInput(f,O.yy),O.yy.lexer=L,O.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var z=L.yylloc;v.push(z);var F=L.options&&L.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A(ie){g.length=g.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}T(A,"popStack");function R(){var ie;return ie=m.pop()||L.lex()||C,typeof ie!="number"&&(ie instanceof Array&&(m=ie,ie=m.pop()),ie=p.symbols_[ie]||ie),ie}T(R,"lex");for(var N,M,I,$,P={},B,q,V,X;;){if(M=g[g.length-1],this.defaultActions[M]?I=this.defaultActions[M]:((N===null||typeof N>"u")&&(N=R()),I=x[M]&&x[M][N]),typeof I>"u"||!I.length||!I[0]){var W="";X=[];for(B in x[M])this.terminals_[B]&&B>S&&X.push("'"+this.terminals_[B]+"'");L.showPosition?W="Parse error on line "+(w+1)+`: +`,"getStyles"),$be=Agt,_gt=b(t=>t.append("circle").attr("class","start-state").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit).attr("cy",Ve().state.padding+Ve().state.sizeUnit),"drawStartState"),Rgt=b(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Ve().state.textHeight).attr("class","divider").attr("x2",Ve().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Lgt=b((t,e)=>{const r=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+2*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",n.width+2*Ve().state.padding).attr("height",n.height+2*Ve().state.padding).attr("rx",Ve().state.radius),r},"drawSimpleState"),Igt=b((t,e)=>{const r=b(function(f,p,g){const m=f.append("tspan").attr("x",2*Ve().state.padding).text(p);g||m.attr("dy",Ve().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+1.3*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Ve().state.padding).attr("y",a+Ve().state.padding*.4+Ve().state.dividerMargin+Ve().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Ve().state.padding).attr("y1",Ve().state.padding+a+Ve().state.dividerMargin/2).attr("y2",Ve().state.padding+a+Ve().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Ve().state.padding),t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",d+2*Ve().state.padding).attr("height",h.height+a+2*Ve().state.padding).attr("rx",Ve().state.radius),t},"drawDescrState"),Mgt=b((t,e,r)=>{const n=Ve().state.padding,i=2*Ve().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Ve().state.titleShift).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Ve().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Ve().state.textHeight+Ve().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",Ve().state.textHeight*3).attr("rx",Ve().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",p.height+3+2*Ve().state.textHeight).attr("rx",Ve().state.radius),t},"addTitleAndBox"),Dgt=b(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Ve().state.sizeUnit+Ve().state.miniPadding).attr("cx",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding).attr("cy",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit+2).attr("cy",Ve().state.padding+Ve().state.sizeUnit+2)),"drawEndState"),Ngt=b((t,e)=>{let r=Ve().state.forkWidth,n=Ve().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Ve().state.padding).attr("y",Ve().state.padding)},"drawForkJoinState"),Ogt=b((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split($t.lineBreakRegex);let l=1.25*Ve().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Ve().state.noteMargin),d.attr("y",r+i+1.25*Ve().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),$gt=b((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Ve().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=Ogt(t,0,0,n);return r.attr("height",a+2*Ve().state.noteMargin),r.attr("width",i+Ve().state.noteMargin*2),r},"drawNote"),Pbe=b(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&_gt(i),e.type==="end"&&Dgt(i),(e.type==="fork"||e.type==="join")&&Ngt(i,e),e.type==="note"&&$gt(e.note.text,i),e.type==="divider"&&Rgt(i),e.type==="default"&&e.descriptions.length===0&&Lgt(i,e),e.type==="default"&&e.descriptions.length>0&&Igt(i,e);const a=i.node().getBBox();return n.width=a.width+2*Ve().state.padding,n.height=a.height+2*Ve().state.padding,n},"drawState"),Bbe=0,Pgt=b(function(t,e,r){const n=b(function(l){switch(l){case Hp.relationType.AGGREGATION:return"aggregation";case Hp.relationType.EXTENSION:return"extension";case Hp.relationType.COMPOSITION:return"composition";case Hp.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=Ib().x(function(l){return l.x}).y(function(l){return l.y}).curve(Mb),s=t.append("path").attr("d",a(i)).attr("id","edge"+Bbe).attr("class","transition");let o="";if(Ve().state.arrowMarkerAbsolute&&(o=DC(!0)),s.attr("marker-end","url("+o+"#"+n(Hp.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Er.calcLabelPosition(e.points),d=$t.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const x=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=x.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),he.info(w.x,u,h+f),f===0&&(f=x.node().getBBox().height,he.info("Title height",f,h)),p.push(x)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((x,w)=>x.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Ve().state.padding/2).attr("y",h-y/2-Ve().state.padding/2-3.5).attr("width",g+Ve().state.padding).attr("height",y+Ve().state.padding),he.info(v)}Bbe++},"drawEdge"),Eo,wF={},Bgt=b(function(){},"setConf"),Fgt=b(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),zgt=b(function(t,e,r,n){Eo=Ve().state;const i=Ve().securityLevel;let a;i==="sandbox"&&(a=mt("#i"+e));const s=mt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;he.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Fgt(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Fbe(u,h,void 0,!1,s,o,n);const d=Eo.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;bi(l,g,m,Eo.useMaxWidth),l.attr("viewBox",`${f.x-Eo.padding} ${f.y-Eo.padding} `+p+" "+g)},"draw"),Ggt=b(t=>t?t.length*Eo.fontSizeFactor:1,"getLabelWidth"),Fbe=b((t,e,r,n,i,a,s)=>{const o=new ts({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=x.parentElement;let C=0,k=0;w&&(w.parentElement&&(C=w.parentElement.getBBox().width),k=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),x.setAttribute("x1",0-k+8),x.setAttribute("x2",C-k-8)})):he.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(he.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Pgt(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Eo.padding,y.height=m.height+2*Eo.padding,he.debug("Doc rendered",y,o),y},"renderDoc"),Wgt={setConf:Bgt,draw:zgt},qgt={parser:gbe,get db(){return new Hp(1)},renderer:Wgt,styles:$be,init:b(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Vgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:qgt},Symbol.toStringTag,{value:"Module"}));var Ugt={parser:gbe,get db(){return new Hp(2)},renderer:Sgt,styles:$be,init:b(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Hgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ugt},Symbol.toStringTag,{value:"Module"}));var CF=(function(){var t=b(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:b(function(f,p,g,m,y,v,T){var x=v.length-1;switch(y){case 1:return v[x-1];case 2:this.$=[];break;case 3:v[x-1].push(v[x]),this.$=v[x-1];break;case 4:case 5:this.$=v[x];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[x].substr(6)),this.$=v[x].substr(6);break;case 9:this.$=v[x].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[x].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[x].substr(8)),this.$=v[x].substr(8);break;case 13:m.addTask(v[x-1],v[x]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:b(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:b(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,x="",w=0,C=0,k=2,S=1,E=v.slice.call(arguments,1),L=Object.create(this.lexer),M={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(M.yy[I]=this.yy[I]);L.setInput(f,M.yy),M.yy.lexer=L,M.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var P=L.yylloc;v.push(P);var $=L.options&&L.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _(te){g.length=g.length-2*te,y.length=y.length-te,v.length=v.length-te}b(_,"popStack");function R(){var te;return te=m.pop()||L.lex()||S,typeof te!="number"&&(te instanceof Array&&(m=te,te=m.pop()),te=p.symbols_[te]||te),te}b(R,"lex");for(var O,D,N,B,F={},G,z,W,V;;){if(D=g[g.length-1],this.defaultActions[D]?N=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=R()),N=T[D]&&T[D][O]),typeof N>"u"||!N.length||!N[0]){var H="";V=[];for(G in T[D])this.terminals_[G]&&G>k&&V.push("'"+this.terminals_[G]+"'");L.showPosition?H="Parse error on line "+(w+1)+`: `+L.showPosition()+` -Expecting `+X.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on line "+(w+1)+": Unexpected "+(N==C?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(W,{text:L.match,token:this.terminals_[N]||N,line:L.yylineno,loc:z,expected:X})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+N);switch(I[0]){case 1:g.push(N),y.push(L.yytext),v.push(L.yylloc),g.push(I[1]),N=null,k=L.yyleng,b=L.yytext,w=L.yylineno,z=L.yylloc;break;case 2:if(q=this.productions_[I[1]][1],P.$=y[y.length-q],P._$={first_line:v[v.length-(q||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(q||1)].first_column,last_column:v[v.length-1].last_column},F&&(P._$.range=[v[v.length-(q||1)].range[0],v[v.length-1].range[1]]),$=this.performAction.apply(P,[b,k,w,O.yy,I[1],y,v].concat(_)),typeof $<"u")return $;q&&(g=g.slice(0,-1*q*2),y=y.slice(0,-1*q),v=v.slice(0,-1*q)),g.push(this.productions_[I[1]][0]),y.push(P.$),v.push(P._$),V=x[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:T(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:T(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:T(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(f){this.unput(this.match.slice(f))},"less"),pastInput:T(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` -`+p+"^"},"showPosition"),test_match:T(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var p=this.next();return p||this.lex()},"lex"),begin:T(function(p){this.conditionStack.push(p)},"begin"),popState:T(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:T(function(p){this.begin(p)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return T(h,"Parser"),h.prototype=l,l.Parser=h,new h})();G$.parser=G$;var Yut=G$,om="",q$=[],nw=[],iw=[],Xut=T(function(){q$.length=0,nw.length=0,om="",iw.length=0,Dn()},"clear"),Kut=T(function(t){om=t,q$.push(t)},"addSection"),jut=T(function(){return q$},"getSections"),Zut=T(function(){let t=Jme();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Jut=T(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:om,type:om,people:a,task:t,score:n};iw.push(s)},"addTask"),eht=T(function(t){const e={section:om,type:om,description:t,task:t,classes:[]};nw.push(e)},"addTaskOrg"),Jme=T(function(){const t=T(function(r){return iw[r].processed},"compileTask");let e=!0;for(const[r,n]of iw.entries())t(r),e=e&&n.processed;return e},"compileTasks"),tht=T(function(){return Qut()},"getActors"),e1e={getConfig:T(()=>$e().journey,"getConfig"),clear:Xut,setDiagramTitle:Wn,getDiagramTitle:Nn,setAccTitle:Mn,getAccTitle:Gn,setAccDescription:qn,getAccDescription:Vn,addSection:Kut,getSections:jut,getTasks:Zut,addTask:Jut,addTaskOrg:eht,getActors:tht},rht=T(t=>`.label { +Expecting `+V.join(", ")+", got '"+(this.terminals_[O]||O)+"'":H="Parse error on line "+(w+1)+": Unexpected "+(O==S?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(H,{text:L.match,token:this.terminals_[O]||O,line:L.yylineno,loc:P,expected:V})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+O);switch(N[0]){case 1:g.push(O),y.push(L.yytext),v.push(L.yylloc),g.push(N[1]),O=null,C=L.yyleng,x=L.yytext,w=L.yylineno,P=L.yylloc;break;case 2:if(z=this.productions_[N[1]][1],F.$=y[y.length-z],F._$={first_line:v[v.length-(z||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(z||1)].first_column,last_column:v[v.length-1].last_column},$&&(F._$.range=[v[v.length-(z||1)].range[0],v[v.length-1].range[1]]),B=this.performAction.apply(F,[x,C,w,M.yy,N[1],y,v].concat(E)),typeof B<"u")return B;z&&(g=g.slice(0,-1*z*2),y=y.slice(0,-1*z),v=v.slice(0,-1*z)),g.push(this.productions_[N[1]][0]),y.push(F.$),v.push(F._$),W=T[g[g.length-2]][g[g.length-1]],g.push(W);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:b(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:b(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:b(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(f){this.unput(this.match.slice(f))},"less"),pastInput:b(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:b(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var p=this.next();return p||this.lex()},"lex"),begin:b(function(p){this.conditionStack.push(p)},"begin"),popState:b(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:b(function(p){this.begin(p)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return b(h,"Parser"),h.prototype=l,l.Parser=h,new h})();CF.parser=CF;var Ygt=CF,e1="",SF=[],eC=[],tC=[],Xgt=b(function(){SF.length=0,eC.length=0,e1="",tC.length=0,zn()},"clear"),jgt=b(function(t){e1=t,SF.push(t)},"addSection"),Kgt=b(function(){return SF},"getSections"),Zgt=b(function(){let t=zbe();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Jgt=b(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:e1,type:e1,people:a,task:t,score:n};tC.push(s)},"addTask"),emt=b(function(t){const e={section:e1,type:e1,description:t,task:t,classes:[]};eC.push(e)},"addTaskOrg"),zbe=b(function(){const t=b(function(r){return tC[r].processed},"compileTask");let e=!0;for(const[r,n]of tC.entries())t(r),e=e&&n.processed;return e},"compileTasks"),tmt=b(function(){return Qgt()},"getActors"),Gbe={getConfig:b(()=>Ve().journey,"getConfig"),clear:Xgt,setDiagramTitle:ti,getDiagramTitle:Vn,setAccTitle:qn,getAccTitle:Qn,setAccDescription:Jn,getAccDescription:ei,addSection:jgt,getSections:Kgt,getTasks:Zgt,addTask:Jgt,addTaskOrg:emt,getActors:tmt},rmt=b(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -2593,13 +2608,13 @@ Expecting `+X.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${vx()} -`,"getStyles"),nht=rht,V$=T(function(t,e){return x3(t,e)},"drawRect"),iht=T(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Fp().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}T(a,"smile");function s(l){const u=Fp().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}T(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return T(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),t1e=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),r1e=T(function(t,e){return TWe(t,e)},"drawText"),aht=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,r1e(t,e)},"drawLabel"),sht=T(function(t,e,r){const n=t.append("g"),i=Hs();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,V$(n,i),n1e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),W$=-1,oht=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");W$++,a.append("line").attr("id",n+"-task"+W$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),iht(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Hs();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,V$(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};t1e(a,d),l+=10}),n1e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),lht=T(function(t,e){Dte(t,e)},"drawBackgroundRect"),n1e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=mu[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:mu[i].position};aw.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=aw.drawText(t,f).node().getBoundingClientRect().width;g>BS&&g>e.leftMargin-g&&(BS=g)}),n+=Math.max(20,u.length*20)})}T(i1e,"drawActorLegend");var el=$e().journey,Oh=0,hht=T(function(t,e,r,n){const i=$e(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const h=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");wo.init();const d=h.select("#"+e);aw.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in mu)delete mu[w];let m=0;g.forEach(w=>{mu[w]={color:el.actorColours[m%el.actorColours.length],position:m},m++}),i1e(d),Oh=el.leftMargin+BS,wo.insert(0,0,Oh,Object.keys(mu).length*50),dht(d,f,0,e);const y=wo.getBounds();p&&d.append("text").text(p).attr("x",Oh).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*el.diagramMarginY,x=Oh+y.stopx+2*el.diagramMarginX;vi(d,v,x,el.useMaxWidth),d.append("line").attr("x1",Oh).attr("y1",el.height*4).attr("x2",x-Oh-4).attr("y2",el.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),wo={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:T(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=$e().journey,a=this;let s=0;function o(l){return T(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(wo.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(wo.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(wo.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(wo.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}T(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:T(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(wo.data,"startx",i,Math.min),this.updateVal(wo.data,"starty",s,Math.min),this.updateVal(wo.data,"stopx",a,Math.max),this.updateVal(wo.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return this.data},"getBounds")},U$=el.sectionFills,a1e=el.sectionColours,dht=T(function(t,e,r,n){const i=$e().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=U$[l%U$.length],d=l%U$.length,h=a1e[l%a1e.length];let m=0;const y=p.section;for(let x=f;x(mu[y]&&(m[y]=mu[y]),m),{});p.x=f*i.taskMargin+f*i.width+Oh,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,aw.drawTask(t,p,i,n),wo.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),s1e={setConf:uht,draw:hht},fht={parser:Yut,db:e1e,renderer:s1e,styles:nht,init:T(t=>{s1e.setConf(t.journey),e1e.clear()},"init")};const pht=Object.freeze(Object.defineProperty({__proto__:null,diagram:fht},Symbol.toStringTag,{value:"Module"}));var H$=(function(){var t=T(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:T(function(p,g,m,y,v,x,b){var w=x.length-1;switch(v){case 1:return x[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[w-1].push(x[w]),this.$=x[w-1];break;case 7:case 8:this.$=x[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[w].substr(6)),this.$=x[w].substr(6);break;case 12:this.$=x[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[w].substr(8)),this.$=x[w].substr(8);break;case 18:y.addTask(x[w],0,""),this.$=x[w];break;case 19:y.addEvent(x[w].substr(2)),this.$=x[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:T(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:T(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,w="",k=0,S=0,C=2,_=1,L=x.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(D.yy[z]=this.yy[z]);O.setInput(p,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;x.push(F);var A=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(K){m.length=m.length-2*K,v.length=v.length-K,x.length=x.length-K}T(R,"popStack");function N(){var K;return K=y.pop()||O.lex()||_,typeof K!="number"&&(K instanceof Array&&(y=K,K=y.pop()),K=g.symbols_[K]||K),K}T(N,"lex");for(var M,I,$,P,B={},q,V,X,W;;){if(I=m[m.length-1],this.defaultActions[I]?$=this.defaultActions[I]:((M===null||typeof M>"u")&&(M=N()),$=b[I]&&b[I][M]),typeof $>"u"||!$.length||!$[0]){var ie="";W=[];for(q in b[I])this.terminals_[q]&&q>C&&W.push("'"+this.terminals_[q]+"'");O.showPosition?ie="Parse error on line "+(k+1)+`: -`+O.showPosition()+` -Expecting `+W.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ie="Parse error on line "+(k+1)+": Unexpected "+(M==_?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ie,{text:O.match,token:this.terminals_[M]||M,line:O.yylineno,loc:F,expected:W})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+M);switch($[0]){case 1:m.push(M),v.push(O.yytext),x.push(O.yylloc),m.push($[1]),M=null,S=O.yyleng,w=O.yytext,k=O.yylineno,F=O.yylloc;break;case 2:if(V=this.productions_[$[1]][1],B.$=v[v.length-V],B._$={first_line:x[x.length-(V||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(V||1)].first_column,last_column:x[x.length-1].last_column},A&&(B._$.range=[x[x.length-(V||1)].range[0],x[x.length-1].range[1]]),P=this.performAction.apply(B,[w,S,k,D.yy,$[1],v,x].concat(L)),typeof P<"u")return P;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),x=x.slice(0,-1*V)),m.push(this.productions_[$[1]][0]),v.push(B.$),x.push(B._$),X=b[m[m.length-2]][m[m.length-1]],m.push(X);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:T(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:T(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:T(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(p){this.unput(this.match.slice(p))},"less"),pastInput:T(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` -`+g+"^"},"showPosition"),test_match:T(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),x=0;xg[0].length)){if(g=m,y=x,this.options.backtrack_lexer){if(p=this.test_match(m,v[x]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var g=this.next();return g||this.lex()},"lex"),begin:T(function(g){this.conditionStack.push(g)},"begin"),popState:T(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:T(function(g){this.begin(g)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return T(d,"Parser"),d.prototype=u,u.Parser=d,new d})();H$.parser=H$;var ght=H$,o1e={};Ew(o1e,{addEvent:()=>y1e,addSection:()=>f1e,addTask:()=>m1e,addTaskOrg:()=>v1e,clear:()=>u1e,default:()=>mht,getCommonDb:()=>c1e,getDirection:()=>d1e,getSections:()=>p1e,getTasks:()=>g1e,setDirection:()=>h1e});var lm="",l1e=0,Y$="LR",X$=[],FS=[],cm=[],c1e=T(()=>P6,"getCommonDb"),u1e=T(function(){X$.length=0,FS.length=0,lm="",cm.length=0,Y$="LR",Dn()},"clear"),h1e=T(function(t){Y$=t},"setDirection"),d1e=T(function(){return Y$},"getDirection"),f1e=T(function(t){lm=t,X$.push(t)},"addSection"),p1e=T(function(){return X$},"getSections"),g1e=T(function(){let t=b1e();const e=100;let r=0;for(;!t&&rr.id===l1e-1).events.push(t)},"addEvent"),v1e=T(function(t){const e={section:lm,type:lm,description:t,task:t,classes:[]};FS.push(e)},"addTaskOrg"),b1e=T(function(){const t=T(function(r){return cm[r].processed},"compileTask");let e=!0;for(const[r,n]of cm.entries())t(r),e=e&&n.processed;return e},"compileTasks"),mht={clear:u1e,getCommonDb:c1e,getDirection:d1e,setDirection:h1e,addSection:f1e,getSections:p1e,getTasks:g1e,addTask:m1e,addTaskOrg:v1e,addEvent:y1e},x1e=0,zS=T(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),yht=T(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Fp().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}T(a,"smile");function s(l){const u=Fp().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}T(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return T(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),vht=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),T1e=T(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),bht=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,T1e(t,e)},"drawLabel"),xht=T(function(t,e,r){const n=t.append("g"),i=j$();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,zS(n,i),w1e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),K$=-1,Tht=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");K$++,a.append("line").attr("id",n+"-task"+K$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),yht(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=j$();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,zS(a,o),w1e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),wht=T(function(t,e){zS(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Cht=T(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),j$=T(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),w1e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}T(Z$,"wrap");var Eht=T(function(t,e,r,n,i,a=!1){var v,x,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Z$,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Aht(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=pt(k),C=S.attr("id")??"",_=C?`${C}-drop-shadow`:"drop-shadow";if(S.select(`#${_}`).empty()){const L=S.select("defs");(L.empty()?S.append("defs"):L).append("filter").attr("id",_).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),Sht=T(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Z$,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),Aht=T(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+x1e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),Is={drawRect:zS,drawCircle:vht,drawSection:xht,drawText:T1e,drawLabel:bht,drawTask:Tht,drawBackgroundRect:wht,getTextObj:Cht,getNoteRect:j$,initGraphics:kht,drawNode:Eht,getVirtualNodeHeight:Sht},_ht=T(function(t,e,r,n){var R,N,M;const i=$e(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=pt("#i"+e));const m=pt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();ae.debug("task",y),Is.initGraphics(m,e);const x=n.db.getSections();ae.debug("sections",x);let b=0,w=0,k=0,S=0,C=50+d,_=50;S=50;let L=0,O=!0;x.forEach(function(I){const $={number:L,descr:I,section:L,width:150,padding:20,maxHeight:b},P=Is.getVirtualNodeHeight(m,$,i);ae.debug("sectionHeight before draw",P),b=Math.max(b,P+20)});let D=0,z=0;ae.debug("tasks.length",y.length);for(const[I,$]of y.entries()){const P={number:I,descr:$,section:$.section,width:150,padding:20,maxHeight:w},B=Is.getVirtualNodeHeight(m,P,i);ae.debug("taskHeight before draw",B),w=Math.max(w,B+20),D=Math.max(D,$.events.length);let q=0;for(const V of $.events){const X={descr:V,section:$.section,number:$.section,width:150,padding:20,maxHeight:50};q+=Is.getVirtualNodeHeight(m,X,i)}$.events.length>0&&(q+=($.events.length-1)*10),z=Math.max(z,q)}ae.debug("maxSectionHeight before draw",b),ae.debug("maxTaskHeight before draw",w),x&&x.length>0?x.forEach(I=>{const $=y.filter(V=>V.section===I),P={number:L,descr:I,section:L,width:200*Math.max($.length,1)-50,padding:20,maxHeight:b};ae.debug("sectionNode",P);const B=m.append("g"),q=Is.drawNode(B,P,L,i,e);ae.debug("sectionNode output",q),B.attr("transform",`translate(${C}, ${S})`),_+=b+50,$.length>0&&C1e(m,$,L,C,_,w,i,D,z,b,!1,e),C+=200*Math.max($.length,1),_=S,L++}):(O=!1,C1e(m,y,L,C,_,w,i,D,z,b,!0,e));const F=m.node().getBBox();if(ae.debug("bounds",F),v&&m.append("text").text(v).attr("x",a==="neo"?F.x*2+d:F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=O?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",F.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const I=m.select("defs"),P=(I.empty()?m.append("defs"):I).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");P.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),P.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}Ap(void 0,m,((N=i.timeline)==null?void 0:N.padding)??50,((M=i.timeline)==null?void 0:M.useMaxWidth)??!1)},"draw"),C1e=T(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};ae.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=Is.drawNode(m,g,r,s,d).height;if(ae.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+Rht(t,p.events,r,n,i,s,d),i-=100,x.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Rht=T(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ae.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=Is.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),Lht={setConf:T(()=>{},"setConf"),draw:_ht},GS=200,yu=5,Iht=GS+yu*2,Q$=GS+100,Dht=Q$+yu*2,k1e=10,Mht=0,E1e=20,S1e=20,A1e=30,_1e=50,Nht=T(function(t,e,r,n){var R,N,M,I,$;const i=$e(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const s=ms(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ae.debug("task",o),Is.initGraphics(s);const u=n.db.getSections();ae.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=Iht+S1e,v=Dht+_1e,x=m+y;let b=0;const w=u&&u.length>0,k=w?x:f+y,S=Math.max(50,y+v-yu*2);u.forEach(function(P){const B={number:b,descr:P,section:b,width:S,padding:yu,maxHeight:h},q=Is.getVirtualNodeHeight(s,B,i);ae.debug("sectionHeight before draw",q),h=Math.max(h,q)});let C=0;ae.debug("tasks.length",o.length);for(const[P,B]of o.entries()){const q={number:P,descr:B,section:B.section,width:GS,padding:yu,maxHeight:d},V=Is.getVirtualNodeHeight(s,q,i);ae.debug("taskHeight before draw",V),d=Math.max(d,V);let X=0;for(const W of B.events){const ie={descr:W,section:B.section,number:B.section,width:Q$,padding:yu,maxHeight:50};X+=Is.getVirtualNodeHeight(s,ie,i)}B.events.length>0&&(X+=(B.events.length-1)*k1e),C=Math.max(C,X)+Mht}ae.debug("maxSectionHeight before draw",h),ae.debug("maxTaskHeight before draw",d);const L=Math.max(d,C)+A1e;w?u.forEach(P=>{const B=o.filter(te=>te.section===P),q={number:b,descr:P,section:b,width:S,padding:yu,maxHeight:h};ae.debug("sectionNode",q);const V=s.append("g"),X=Is.drawNode(V,q,b,i);ae.debug("sectionNode output",X);const W=k-y;V.attr("transform",`translate(${W}, ${p})`);const ie=p+X.height+E1e;B.length>0&&R1e(s,B,b,k,ie,d,i,L,!1);const K=B.length,se=X.height+E1e+L*Math.max(K,1)-(K>0?A1e*2:0);p+=se,b++}):R1e(s,o,b,k,p,d,i,L,!0);let O=(N=s.node())==null?void 0:N.getBBox();if(!O)throw new Error("bbox not found");if(ae.debug("bounds",O),l){if(s.append("text").text(l).attr("x",O.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=(M=s.node())==null?void 0:M.getBBox(),!O)throw new Error("bbox not found");ae.debug("bounds after title",O)}const[D]=Tc(i.fontSize),z=(D??16)*2,F=(D??16)*.5+20,A=s.append("g").attr("class","lineWrapper");A.append("line").attr("x1",k).attr("y1",g-z).attr("x2",k).attr("y2",O.y+O.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),Ap(void 0,s,((I=i.timeline)==null?void 0:I.padding)??50,(($=i.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),R1e=T(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:GS,padding:yu,maxHeight:a};ae.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=Is.drawNode(f,d,r,s),g=p.height;ae.debug("taskHeight after draw",g);const m=n-S1e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+_1e;Oht(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Oht=T(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:Q$,padding:yu,maxHeight:0};ae.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=Is.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+k1e}return o-a},"drawEvents"),$ht={setConf:T(()=>{},"setConf"),draw:Nht},Pht=T(t=>{var o;const{theme:e}=lr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Wbe=b(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),qbe=b(function(t,e){return xKe(t,e)},"drawText"),amt=b(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}b(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,qbe(t,e)},"drawLabel"),smt=b(function(t,e,r){const n=t.append("g"),i=vo();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,kF(n,i),Vbe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),EF=-1,omt=b(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");EF++,a.append("line").attr("id",n+"-task"+EF).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),imt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=vo();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,kF(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};Wbe(a,d),l+=10}),Vbe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),lmt=b(function(t,e){wse(t,e)},"drawBackgroundRect"),Vbe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}b(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=Ku[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Ku[i].position};rC.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=rC.drawText(t,f).node().getBoundingClientRect().width;g>a6&&g>e.leftMargin-g&&(a6=g)}),n+=Math.max(20,u.length*20)})}b(Ube,"drawActorLegend");var Rl=Ve().journey,yd=0,hmt=b(function(t,e,r,n){const i=Ve(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=mt("#i"+e));const h=mt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");jo.init();const d=h.select("#"+e);rC.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in Ku)delete Ku[w];let m=0;g.forEach(w=>{Ku[w]={color:Rl.actorColours[m%Rl.actorColours.length],position:m},m++}),Ube(d),yd=Rl.leftMargin+a6,jo.insert(0,0,yd,Object.keys(Ku).length*50),dmt(d,f,0,e);const y=jo.getBounds();p&&d.append("text").text(p).attr("x",yd).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*Rl.diagramMarginY,T=yd+y.stopx+2*Rl.diagramMarginX;bi(d,v,T,Rl.useMaxWidth),d.append("line").attr("x1",yd).attr("y1",Rl.height*4).attr("x2",T-yd-4).attr("y2",Rl.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+x}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+x+25)},"draw"),jo={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:b(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:b(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:b(function(t,e,r,n){const i=Ve().journey,a=this;let s=0;function o(l){return b(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(jo.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(jo.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(jo.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(jo.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}b(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:b(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(jo.data,"startx",i,Math.min),this.updateVal(jo.data,"starty",s,Math.min),this.updateVal(jo.data,"stopx",a,Math.max),this.updateVal(jo.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:b(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:b(function(){return this.verticalPos},"getVerticalPos"),getBounds:b(function(){return this.data},"getBounds")},AF=Rl.sectionFills,Hbe=Rl.sectionColours,dmt=b(function(t,e,r,n){const i=Ve().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=AF[l%AF.length],d=l%AF.length,h=Hbe[l%Hbe.length];let m=0;const y=p.section;for(let T=f;T(Ku[y]&&(m[y]=Ku[y]),m),{});p.x=f*i.taskMargin+f*i.width+yd,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,rC.drawTask(t,p,i,n),jo.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Ybe={setConf:umt,draw:hmt},fmt={parser:Ygt,db:Gbe,renderer:Ybe,styles:nmt,init:b(t=>{Ybe.setConf(t.journey),Gbe.clear()},"init")};const pmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fmt},Symbol.toStringTag,{value:"Module"}));var _F=(function(){var t=b(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:b(function(p,g,m,y,v,T,x){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:b(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:b(function(p){var g=this,m=[0],y=[],v=[null],T=[],x=this.table,w="",C=0,k=0,S=2,E=1,L=T.slice.call(arguments,1),M=Object.create(this.lexer),I={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(I.yy[P]=this.yy[P]);M.setInput(p,I.yy),I.yy.lexer=M,I.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var $=M.yylloc;T.push($);var _=M.options&&M.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(Y){m.length=m.length-2*Y,v.length=v.length-Y,T.length=T.length-Y}b(R,"popStack");function O(){var Y;return Y=y.pop()||M.lex()||E,typeof Y!="number"&&(Y instanceof Array&&(y=Y,Y=y.pop()),Y=g.symbols_[Y]||Y),Y}b(O,"lex");for(var D,N,B,F,G={},z,W,V,H;;){if(N=m[m.length-1],this.defaultActions[N]?B=this.defaultActions[N]:((D===null||typeof D>"u")&&(D=O()),B=x[N]&&x[N][D]),typeof B>"u"||!B.length||!B[0]){var te="";H=[];for(z in x[N])this.terminals_[z]&&z>S&&H.push("'"+this.terminals_[z]+"'");M.showPosition?te="Parse error on line "+(C+1)+`: +`+M.showPosition()+` +Expecting `+H.join(", ")+", got '"+(this.terminals_[D]||D)+"'":te="Parse error on line "+(C+1)+": Unexpected "+(D==E?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(te,{text:M.match,token:this.terminals_[D]||D,line:M.yylineno,loc:$,expected:H})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+D);switch(B[0]){case 1:m.push(D),v.push(M.yytext),T.push(M.yylloc),m.push(B[1]),D=null,k=M.yyleng,w=M.yytext,C=M.yylineno,$=M.yylloc;break;case 2:if(W=this.productions_[B[1]][1],G.$=v[v.length-W],G._$={first_line:T[T.length-(W||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(W||1)].first_column,last_column:T[T.length-1].last_column},_&&(G._$.range=[T[T.length-(W||1)].range[0],T[T.length-1].range[1]]),F=this.performAction.apply(G,[w,k,C,I.yy,B[1],v,T].concat(L)),typeof F<"u")return F;W&&(m=m.slice(0,-1*W*2),v=v.slice(0,-1*W),T=T.slice(0,-1*W)),m.push(this.productions_[B[1]][0]),v.push(G.$),T.push(G._$),V=x[m[m.length-2]][m[m.length-1]],m.push(V);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:b(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:b(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:b(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(p){this.unput(this.match.slice(p))},"less"),pastInput:b(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:b(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;Tg[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var g=this.next();return g||this.lex()},"lex"),begin:b(function(g){this.conditionStack.push(g)},"begin"),popState:b(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:b(function(g){this.begin(g)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return b(d,"Parser"),d.prototype=u,u.Parser=d,new d})();_F.parser=_F;var gmt=_F,Xbe={};Bc(Xbe,{addEvent:()=>ixe,addSection:()=>exe,addTask:()=>nxe,addTaskOrg:()=>axe,clear:()=>Zbe,default:()=>mmt,getCommonDb:()=>Kbe,getDirection:()=>Jbe,getSections:()=>txe,getTasks:()=>rxe,setDirection:()=>Qbe});var t1="",jbe=0,RF="LR",LF=[],s6=[],r1=[],Kbe=b(()=>c_,"getCommonDb"),Zbe=b(function(){LF.length=0,s6.length=0,t1="",r1.length=0,RF="LR",zn()},"clear"),Qbe=b(function(t){RF=t},"setDirection"),Jbe=b(function(){return RF},"getDirection"),exe=b(function(t){t1=t,LF.push(t)},"addSection"),txe=b(function(){return LF},"getSections"),rxe=b(function(){let t=sxe();const e=100;let r=0;for(;!t&&rr.id===jbe-1).events.push(t)},"addEvent"),axe=b(function(t){const e={section:t1,type:t1,description:t,task:t,classes:[]};s6.push(e)},"addTaskOrg"),sxe=b(function(){const t=b(function(r){return r1[r].processed},"compileTask");let e=!0;for(const[r,n]of r1.entries())t(r),e=e&&n.processed;return e},"compileTasks"),mmt={clear:Zbe,getCommonDb:Kbe,getDirection:Jbe,setDirection:Qbe,addSection:exe,getSections:txe,getTasks:rxe,addTask:nxe,addTaskOrg:axe,addEvent:ixe},oxe=0,o6=b(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),ymt=b(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=S0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}b(a,"smile");function s(l){const u=S0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}b(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return b(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),vmt=b(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),lxe=b(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),bmt=b(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}b(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,lxe(t,e)},"drawLabel"),xmt=b(function(t,e,r){const n=t.append("g"),i=MF();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,o6(n,i),cxe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),IF=-1,Tmt=b(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");IF++,a.append("line").attr("id",n+"-task"+IF).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),ymt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=MF();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,o6(a,o),cxe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),wmt=b(function(t,e){o6(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Cmt=b(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),MF=b(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),cxe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}b(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}b(DF,"wrap");var kmt=b(function(t,e,r,n,i,a=!1){var v,T,x;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(DF,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Amt(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),C=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),k=mt(C),S=k.attr("id")??"",E=S?`${S}-drop-shadow`:"drop-shadow";if(k.select(`#${E}`).empty()){const L=k.select("defs");(L.empty()?k.append("defs"):L).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),Emt=b(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(DF,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),Amt=b(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+oxe++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),to={drawRect:o6,drawCircle:vmt,drawSection:xmt,drawText:lxe,drawLabel:bmt,drawTask:Tmt,drawBackgroundRect:wmt,getTextObj:Cmt,getNoteRect:MF,initGraphics:Smt,drawNode:kmt,getVirtualNodeHeight:Emt},_mt=b(function(t,e,r,n){var R,O,D;const i=Ve(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;he.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=mt("#i"+e));const m=mt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();he.debug("task",y),to.initGraphics(m,e);const T=n.db.getSections();he.debug("sections",T);let x=0,w=0,C=0,k=0,S=50+d,E=50;k=50;let L=0,M=!0;T.forEach(function(N){const B={number:L,descr:N,section:L,width:150,padding:20,maxHeight:x},F=to.getVirtualNodeHeight(m,B,i);he.debug("sectionHeight before draw",F),x=Math.max(x,F+20)});let I=0,P=0;he.debug("tasks.length",y.length);for(const[N,B]of y.entries()){const F={number:N,descr:B,section:B.section,width:150,padding:20,maxHeight:w},G=to.getVirtualNodeHeight(m,F,i);he.debug("taskHeight before draw",G),w=Math.max(w,G+20),I=Math.max(I,B.events.length);let z=0;for(const W of B.events){const V={descr:W,section:B.section,number:B.section,width:150,padding:20,maxHeight:50};z+=to.getVirtualNodeHeight(m,V,i)}B.events.length>0&&(z+=(B.events.length-1)*10),P=Math.max(P,z)}he.debug("maxSectionHeight before draw",x),he.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(N=>{const B=y.filter(W=>W.section===N),F={number:L,descr:N,section:L,width:200*Math.max(B.length,1)-50,padding:20,maxHeight:x};he.debug("sectionNode",F);const G=m.append("g"),z=to.drawNode(G,F,L,i,e);he.debug("sectionNode output",z),G.attr("transform",`translate(${S}, ${k})`),E+=x+50,B.length>0&&uxe(m,B,L,S,E,w,i,I,P,x,!1,e),S+=200*Math.max(B.length,1),E=k,L++}):(M=!1,uxe(m,y,L,S,E,w,i,I,P,x,!0,e));const $=m.node().getBBox();if(he.debug("bounds",$),v&&m.append("text").text(v).attr("x",a==="neo"?$.x*2+d:$.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=M?x+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",$.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),F=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");F.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),F.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}d0(void 0,m,((O=i.timeline)==null?void 0:O.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),uxe=b(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};he.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=to.drawNode(m,g,r,s,d).height;if(he.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let x=a;i+=100,x=x+Rmt(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Rmt=b(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};he.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=to.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),Lmt={setConf:b(()=>{},"setConf"),draw:_mt},l6=200,Zu=5,Imt=l6+Zu*2,NF=l6+100,Mmt=NF+Zu*2,hxe=10,Dmt=0,dxe=20,fxe=20,pxe=30,gxe=50,Nmt=b(function(t,e,r,n){var R,O,D,N,B;const i=Ve(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;he.debug("timeline",n.db);const s=Ka(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();he.debug("task",o),to.initGraphics(s);const u=n.db.getSections();he.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=Imt+fxe,v=Mmt+gxe,T=m+y;let x=0;const w=u&&u.length>0,C=w?T:f+y,k=Math.max(50,y+v-Zu*2);u.forEach(function(F){const G={number:x,descr:F,section:x,width:k,padding:Zu,maxHeight:h},z=to.getVirtualNodeHeight(s,G,i);he.debug("sectionHeight before draw",z),h=Math.max(h,z)});let S=0;he.debug("tasks.length",o.length);for(const[F,G]of o.entries()){const z={number:F,descr:G,section:G.section,width:l6,padding:Zu,maxHeight:d},W=to.getVirtualNodeHeight(s,z,i);he.debug("taskHeight before draw",W),d=Math.max(d,W);let V=0;for(const H of G.events){const te={descr:H,section:G.section,number:G.section,width:NF,padding:Zu,maxHeight:50};V+=to.getVirtualNodeHeight(s,te,i)}G.events.length>0&&(V+=(G.events.length-1)*hxe),S=Math.max(S,V)+Dmt}he.debug("maxSectionHeight before draw",h),he.debug("maxTaskHeight before draw",d);const L=Math.max(d,S)+pxe;w?u.forEach(F=>{const G=o.filter(J=>J.section===F),z={number:x,descr:F,section:x,width:k,padding:Zu,maxHeight:h};he.debug("sectionNode",z);const W=s.append("g"),V=to.drawNode(W,z,x,i);he.debug("sectionNode output",V);const H=C-y;W.attr("transform",`translate(${H}, ${p})`);const te=p+V.height+dxe;G.length>0&&mxe(s,G,x,C,te,d,i,L,!1);const Y=G.length,se=V.height+dxe+L*Math.max(Y,1)-(Y>0?pxe*2:0);p+=se,x++}):mxe(s,o,x,C,p,d,i,L,!0);let M=(O=s.node())==null?void 0:O.getBBox();if(!M)throw new Error("bbox not found");if(he.debug("bounds",M),l){if(s.append("text").text(l).attr("x",M.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=(D=s.node())==null?void 0:D.getBBox(),!M)throw new Error("bbox not found");he.debug("bounds after title",M)}const[I]=Zc(i.fontSize),P=(I??16)*2,$=(I??16)*.5+20,_=s.append("g").attr("class","lineWrapper");_.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",M.y+M.height+$).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),_.lower(),d0(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((B=i.timeline)==null?void 0:B.useMaxWidth)??!1)},"draw"),mxe=b(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:l6,padding:Zu,maxHeight:a};he.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=to.drawNode(f,d,r,s),g=p.height;he.debug("taskHeight after draw",g);const m=n-fxe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+gxe;Omt(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Omt=b(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:NF,padding:Zu,maxHeight:0};he.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=to.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+hxe}return o-a},"drawEvents"),$mt={setConf:b(()=>{},"setConf"),draw:Nmt},Pmt=b(t=>{var o;const{theme:e}=sr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var s;const{theme:e}=lr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var s;const{theme:e}=sr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:T((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?$ht.draw(t,e,r,n):Lht.draw(t,e,r,n)},"draw")},qht={db:o1e,renderer:Ght,parser:ght,styles:zht};const Vht=Object.freeze(Object.defineProperty({__proto__:null,diagram:qht},Symbol.toStringTag,{value:"Module"})),wa=[];for(let t=0;t<256;++t)wa.push((t+256).toString(16).slice(1));function Wht(t,e=0){return(wa[t[e+0]]+wa[t[e+1]]+wa[t[e+2]]+wa[t[e+3]]+"-"+wa[t[e+4]]+wa[t[e+5]]+"-"+wa[t[e+6]]+wa[t[e+7]]+"-"+wa[t[e+8]]+wa[t[e+9]]+"-"+wa[t[e+10]]+wa[t[e+11]]+wa[t[e+12]]+wa[t[e+13]]+wa[t[e+14]]+wa[t[e+15]]).toLowerCase()}const Uht=new Uint8Array(16);function Hht(){return crypto.getRandomValues(Uht)}function Yht(t,e,r){return crypto.randomUUID?crypto.randomUUID():Xht(t)}function Xht(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Hht();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Wht(n)}var J$=(function(){var t=T(function(w,k,S,C){for(S=S||{},C=w.length;C--;S[w[C]]=k);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:T(function(k,S,C,_,L,O,D){var z=O.length-1;switch(L){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",O[z].id),_.addNode(O[z-1].length,O[z].id,O[z].descr,O[z].type);break;case 16:_.getLogger().trace("Icon: ",O[z]),_.decorateNode({icon:O[z]});break;case 17:case 21:_.decorateNode({class:O[z]});break;case 18:_.getLogger().trace("SPACELIST");break;case 19:_.getLogger().trace("Node: ",O[z].id),_.addNode(0,O[z].id,O[z].descr,O[z].type);break;case 20:_.decorateNode({icon:O[z]});break;case 25:_.getLogger().trace("node found ..",O[z-2]),this.$={id:O[z-1],descr:O[z-1],type:_.getType(O[z-2],O[z])};break;case 26:this.$={id:O[z],descr:O[z],type:_.nodeType.DEFAULT};break;case 27:_.getLogger().trace("node found ..",O[z-3]),this.$={id:O[z-3],descr:O[z-1],type:_.getType(O[z-2],O[z])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(k,S){if(S.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=S,C}},"parseError"),parse:T(function(k){var S=this,C=[0],_=[],L=[null],O=[],D=this.table,z="",F=0,A=0,R=2,N=1,M=O.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&($.yy[P]=this.yy[P]);I.setInput(k,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var B=I.yylloc;O.push(B);var q=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(Ae){C.length=C.length-2*Ae,L.length=L.length-Ae,O.length=O.length-Ae}T(V,"popStack");function X(){var Ae;return Ae=_.pop()||I.lex()||N,typeof Ae!="number"&&(Ae instanceof Array&&(_=Ae,Ae=_.pop()),Ae=S.symbols_[Ae]||Ae),Ae}T(X,"lex");for(var W,ie,K,se,te={},Z,ee,ne,oe;;){if(ie=C[C.length-1],this.defaultActions[ie]?K=this.defaultActions[ie]:((W===null||typeof W>"u")&&(W=X()),K=D[ie]&&D[ie][W]),typeof K>"u"||!K.length||!K[0]){var fe="";oe=[];for(Z in D[ie])this.terminals_[Z]&&Z>R&&oe.push("'"+this.terminals_[Z]+"'");I.showPosition?fe="Parse error on line "+(F+1)+`: -`+I.showPosition()+` -Expecting `+oe.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error on line "+(F+1)+": Unexpected "+(W==N?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(fe,{text:I.match,token:this.terminals_[W]||W,line:I.yylineno,loc:B,expected:oe})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ie+", token: "+W);switch(K[0]){case 1:C.push(W),L.push(I.yytext),O.push(I.yylloc),C.push(K[1]),W=null,A=I.yyleng,z=I.yytext,F=I.yylineno,B=I.yylloc;break;case 2:if(ee=this.productions_[K[1]][1],te.$=L[L.length-ee],te._$={first_line:O[O.length-(ee||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(ee||1)].first_column,last_column:O[O.length-1].last_column},q&&(te._$.range=[O[O.length-(ee||1)].range[0],O[O.length-1].range[1]]),se=this.performAction.apply(te,[z,A,F,$.yy,K[1],L,O].concat(M)),typeof se<"u")return se;ee&&(C=C.slice(0,-1*ee*2),L=L.slice(0,-1*ee),O=O.slice(0,-1*ee)),C.push(this.productions_[K[1]][0]),L.push(te.$),O.push(te._$),ne=D[C[C.length-2]][C[C.length-1]],C.push(ne);break;case 3:return!0}}return!0},"parse")},x=(function(){var w={EOF:1,parseError:T(function(S,C){if(this.yy.parser)this.yy.parser.parseError(S,C);else throw new Error(S)},"parseError"),setInput:T(function(k,S){return this.yy=S||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var S=k.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:T(function(k){var S=k.length,C=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===_.length?this.yylloc.first_column:0)+_[_.length-C.length].length-C[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(k){this.unput(this.match.slice(k))},"less"),pastInput:T(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var k=this.pastInput(),S=new Array(k.length+1).join("-");return k+this.upcomingInput()+` -`+S+"^"},"showPosition"),test_match:T(function(k,S){var C,_,L;if(this.options.backtrack_lexer&&(L={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(L.yylloc.range=this.yylloc.range.slice(0))),_=k[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],C=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var O in L)this[O]=L[O];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,S,C,_;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),O=0;OS[0].length)){if(S=C,_=O,this.options.backtrack_lexer){if(k=this.test_match(C,L[O]),k!==!1)return k;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(k=this.test_match(S,L[_]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var S=this.next();return S||this.lex()},"lex"),begin:T(function(S){this.conditionStack.push(S)},"begin"),popState:T(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:T(function(S){this.begin(S)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(S,C,_,L){switch(_){case 0:return S.getLogger().trace("Found comment",C.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",C.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",C.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",C.yytext),20;case 36:return S.getLogger().trace("Long description:",C.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=x;function b(){this.yy={}}return T(b,"Parser"),b.prototype=v,v.Parser=b,new b})();J$.parser=J$;var Kht=J$,jht=12,vu={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Zht=(Uv=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=vu,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;ae.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=$e();let o=((h=s.mindmap)==null?void 0:h.padding)??Fr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:qr(r,s),level:e,descr:qr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(ae.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=$e(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=qr(e.icon,r)),e.class&&(n.class=qr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(jht-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=$e(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=T(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case vu.CIRCLE:return"mindmapCircle";case vu.RECT:return"rect";case vu.ROUNDED_RECT:return"rounded";case vu.CLOUD:return"cloud";case vu.BANG:return"bang";case vu.HEXAGON:return"hexagon";case vu.DEFAULT:return h?"rounded":"defaultMindmapNode";case vu.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=$e();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=$e(),i=kxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ae.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),ae.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Yht()}}getLogger(){return ae}},T(Uv,"MindmapDB"),Uv),Qht=T(async(t,e,r,n)=>{var f,p;ae.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),s=Z0(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=cb(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await Jp(a,s);const{themeVariables:l}=lr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Ud(s,((f=a.config.mindmap)==null?void 0:f.padding)??Fr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Fr.mindmap.useMaxWidth)},"draw"),Jht={draw:Qht},edt=T(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{},"setConf"),draw:b((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?$mt.draw(t,e,r,n):Lmt.draw(t,e,r,n)},"draw")},Wmt={db:Xbe,renderer:Gmt,parser:gmt,styles:zmt};const qmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Wmt},Symbol.toStringTag,{value:"Module"})),Va=[];for(let t=0;t<256;++t)Va.push((t+256).toString(16).slice(1));function Vmt(t,e=0){return(Va[t[e+0]]+Va[t[e+1]]+Va[t[e+2]]+Va[t[e+3]]+"-"+Va[t[e+4]]+Va[t[e+5]]+"-"+Va[t[e+6]]+Va[t[e+7]]+"-"+Va[t[e+8]]+Va[t[e+9]]+"-"+Va[t[e+10]]+Va[t[e+11]]+Va[t[e+12]]+Va[t[e+13]]+Va[t[e+14]]+Va[t[e+15]]).toLowerCase()}const Umt=new Uint8Array(16);function Hmt(){return crypto.getRandomValues(Umt)}function Ymt(t,e,r){return crypto.randomUUID?crypto.randomUUID():Xmt(t)}function Xmt(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Hmt();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Vmt(n)}var OF=(function(){var t=b(function(w,C,k,S){for(k=k||{},S=w.length;S--;k[w[S]]=C);return k},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:b(function(C,k,S,E,L,M,I){var P=M.length-1;switch(L){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",M[P].id),E.addNode(M[P-1].length,M[P].id,M[P].descr,M[P].type);break;case 16:E.getLogger().trace("Icon: ",M[P]),E.decorateNode({icon:M[P]});break;case 17:case 21:E.decorateNode({class:M[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",M[P].id),E.addNode(0,M[P].id,M[P].descr,M[P].type);break;case 20:E.decorateNode({icon:M[P]});break;case 25:E.getLogger().trace("node found ..",M[P-2]),this.$={id:M[P-1],descr:M[P-1],type:E.getType(M[P-2],M[P])};break;case 26:this.$={id:M[P],descr:M[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",M[P-3]),this.$={id:M[P-3],descr:M[P-1],type:E.getType(M[P-2],M[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:b(function(C,k){if(k.recoverable)this.trace(C);else{var S=new Error(C);throw S.hash=k,S}},"parseError"),parse:b(function(C){var k=this,S=[0],E=[],L=[null],M=[],I=this.table,P="",$=0,_=0,R=2,O=1,D=M.slice.call(arguments,1),N=Object.create(this.lexer),B={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(B.yy[F]=this.yy[F]);N.setInput(C,B.yy),B.yy.lexer=N,B.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var G=N.yylloc;M.push(G);var z=N.options&&N.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(_e){S.length=S.length-2*_e,L.length=L.length-_e,M.length=M.length-_e}b(W,"popStack");function V(){var _e;return _e=E.pop()||N.lex()||O,typeof _e!="number"&&(_e instanceof Array&&(E=_e,_e=E.pop()),_e=k.symbols_[_e]||_e),_e}b(V,"lex");for(var H,te,Y,se,J={},Z,ee,re,ge;;){if(te=S[S.length-1],this.defaultActions[te]?Y=this.defaultActions[te]:((H===null||typeof H>"u")&&(H=V()),Y=I[te]&&I[te][H]),typeof Y>"u"||!Y.length||!Y[0]){var ae="";ge=[];for(Z in I[te])this.terminals_[Z]&&Z>R&&ge.push("'"+this.terminals_[Z]+"'");N.showPosition?ae="Parse error on line "+($+1)+`: +`+N.showPosition()+` +Expecting `+ge.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ae="Parse error on line "+($+1)+": Unexpected "+(H==O?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ae,{text:N.match,token:this.terminals_[H]||H,line:N.yylineno,loc:G,expected:ge})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+te+", token: "+H);switch(Y[0]){case 1:S.push(H),L.push(N.yytext),M.push(N.yylloc),S.push(Y[1]),H=null,_=N.yyleng,P=N.yytext,$=N.yylineno,G=N.yylloc;break;case 2:if(ee=this.productions_[Y[1]][1],J.$=L[L.length-ee],J._$={first_line:M[M.length-(ee||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(ee||1)].first_column,last_column:M[M.length-1].last_column},z&&(J._$.range=[M[M.length-(ee||1)].range[0],M[M.length-1].range[1]]),se=this.performAction.apply(J,[P,_,$,B.yy,Y[1],L,M].concat(D)),typeof se<"u")return se;ee&&(S=S.slice(0,-1*ee*2),L=L.slice(0,-1*ee),M=M.slice(0,-1*ee)),S.push(this.productions_[Y[1]][0]),L.push(J.$),M.push(J._$),re=I[S[S.length-2]][S[S.length-1]],S.push(re);break;case 3:return!0}}return!0},"parse")},T=(function(){var w={EOF:1,parseError:b(function(k,S){if(this.yy.parser)this.yy.parser.parseError(k,S);else throw new Error(k)},"parseError"),setInput:b(function(C,k){return this.yy=k||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var k=C.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:b(function(C){var k=C.length,S=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===E.length?this.yylloc.first_column:0)+E[E.length-S.length].length-S[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(C){this.unput(this.match.slice(C))},"less"),pastInput:b(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var C=this.pastInput(),k=new Array(C.length+1).join("-");return C+this.upcomingInput()+` +`+k+"^"},"showPosition"),test_match:b(function(C,k){var S,E,L;if(this.options.backtrack_lexer&&(L={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(L.yylloc.range=this.yylloc.range.slice(0))),E=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],S=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var M in L)this[M]=L[M];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,k,S,E;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),M=0;Mk[0].length)){if(k=S,E=M,this.options.backtrack_lexer){if(C=this.test_match(S,L[M]),C!==!1)return C;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(C=this.test_match(k,L[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var k=this.next();return k||this.lex()},"lex"),begin:b(function(k){this.conditionStack.push(k)},"begin"),popState:b(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:b(function(k){this.begin(k)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(k,S,E,L){switch(E){case 0:return k.getLogger().trace("Found comment",S.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:k.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return k.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:k.getLogger().trace("end icon"),this.popState();break;case 10:return k.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return k.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return k.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return k.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:k.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return k.getLogger().trace("description:",S.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),k.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),k.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),k.getLogger().trace("node end ...",S.yytext),"NODE_DEND";case 30:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 35:return k.getLogger().trace("Long description:",S.yytext),20;case 36:return k.getLogger().trace("Long description:",S.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=T;function x(){this.yy={}}return b(x,"Parser"),x.prototype=v,v.Parser=x,new x})();OF.parser=OF;var jmt=OF,Kmt=12,Qu={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Zmt=(z2=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Qu,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;he.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Ve();let o=((h=s.mindmap)==null?void 0:h.padding)??jr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Qr(r,s),level:e,descr:Qr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??jr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(he.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Ve(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Qr(e.icon,r)),e.class&&(n.class=Qr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Kmt-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Ve(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=b(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Qu.CIRCLE:return"mindmapCircle";case Qu.RECT:return"rect";case Qu.ROUNDED_RECT:return"rounded";case Qu.CLOUD:return"cloud";case Qu.BANG:return"bang";case Qu.HEXAGON:return"hexagon";case Qu.DEFAULT:return h?"rounded":"defaultMindmapNode";case Qu.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Ve();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Ve(),i=MG().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};he.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),he.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Ymt()}}getLogger(){return he}},b(z2,"MindmapDB"),z2),Qmt=b(async(t,e,r,n)=>{var f,p;he.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=Wg(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=ax(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await B0(a,s);const{themeVariables:l}=sr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Nf(s,((f=a.config.mindmap)==null?void 0:f.padding)??jr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??jr.mindmap.useMaxWidth)},"draw"),Jmt={draw:Qmt},e1t=b(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),r1t=b(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${edt(t)} + ${e1t(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2807,18 +2822,18 @@ Expecting `+oe.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?tdt(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),ndt=rdt,idt={get db(){return new Zht},renderer:Jht,parser:Kht,styles:ndt};const adt=Object.freeze(Object.defineProperty({__proto__:null,diagram:idt},Symbol.toStringTag,{value:"Module"}));var eP=(function(){var t=T(function(C,_,L,O){for(L=L||{},O=C.length;O--;L[C[O]]=_);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:T(function(_,L,O,D,z,F,A){var R=F.length-1;switch(z){case 6:case 7:return D;case 8:D.getLogger().trace("Stop NL ");break;case 9:D.getLogger().trace("Stop EOF ");break;case 11:D.getLogger().trace("Stop NL2 ");break;case 12:D.getLogger().trace("Stop EOF2 ");break;case 15:D.getLogger().info("Node: ",F[R-1].id),D.addNode(F[R-2].length,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 16:D.getLogger().info("Node: ",F[R].id),D.addNode(F[R-1].length,F[R].id,F[R].descr,F[R].type);break;case 17:D.getLogger().trace("Icon: ",F[R]),D.decorateNode({icon:F[R]});break;case 18:case 23:D.decorateNode({class:F[R]});break;case 19:D.getLogger().trace("SPACELIST");break;case 20:D.getLogger().trace("Node: ",F[R-1].id),D.addNode(0,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 21:D.getLogger().trace("Node: ",F[R].id),D.addNode(0,F[R].id,F[R].descr,F[R].type);break;case 22:D.decorateNode({icon:F[R]});break;case 27:D.getLogger().trace("node found ..",F[R-2]),this.$={id:F[R-1],descr:F[R-1],type:D.getType(F[R-2],F[R])};break;case 28:this.$={id:F[R],descr:F[R],type:0};break;case 29:D.getLogger().trace("node found ..",F[R-3]),this.$={id:F[R-3],descr:F[R-1],type:D.getType(F[R-2],F[R])};break;case 30:this.$=F[R-1]+F[R];break;case 31:this.$=F[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(_,L){if(L.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=L,O}},"parseError"),parse:T(function(_){var L=this,O=[0],D=[],z=[null],F=[],A=this.table,R="",N=0,M=0,I=2,$=1,P=F.slice.call(arguments,1),B=Object.create(this.lexer),q={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(q.yy[V]=this.yy[V]);B.setInput(_,q.yy),q.yy.lexer=B,q.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var X=B.yylloc;F.push(X);var W=B.options&&B.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(Ce){O.length=O.length-2*Ce,z.length=z.length-Ce,F.length=F.length-Ce}T(ie,"popStack");function K(){var Ce;return Ce=D.pop()||B.lex()||$,typeof Ce!="number"&&(Ce instanceof Array&&(D=Ce,Ce=D.pop()),Ce=L.symbols_[Ce]||Ce),Ce}T(K,"lex");for(var se,te,Z,ee,ne={},oe,fe,Ae,Re;;){if(te=O[O.length-1],this.defaultActions[te]?Z=this.defaultActions[te]:((se===null||typeof se>"u")&&(se=K()),Z=A[te]&&A[te][se]),typeof Z>"u"||!Z.length||!Z[0]){var Ge="";Re=[];for(oe in A[te])this.terminals_[oe]&&oe>I&&Re.push("'"+this.terminals_[oe]+"'");B.showPosition?Ge="Parse error on line "+(N+1)+`: -`+B.showPosition()+` -Expecting `+Re.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ge="Parse error on line "+(N+1)+": Unexpected "+(se==$?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Ge,{text:B.match,token:this.terminals_[se]||se,line:B.yylineno,loc:X,expected:Re})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+te+", token: "+se);switch(Z[0]){case 1:O.push(se),z.push(B.yytext),F.push(B.yylloc),O.push(Z[1]),se=null,M=B.yyleng,R=B.yytext,N=B.yylineno,X=B.yylloc;break;case 2:if(fe=this.productions_[Z[1]][1],ne.$=z[z.length-fe],ne._$={first_line:F[F.length-(fe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(fe||1)].first_column,last_column:F[F.length-1].last_column},W&&(ne._$.range=[F[F.length-(fe||1)].range[0],F[F.length-1].range[1]]),ee=this.performAction.apply(ne,[R,M,N,q.yy,Z[1],z,F].concat(P)),typeof ee<"u")return ee;fe&&(O=O.slice(0,-1*fe*2),z=z.slice(0,-1*fe),F=F.slice(0,-1*fe)),O.push(this.productions_[Z[1]][0]),z.push(ne.$),F.push(ne._$),Ae=A[O[O.length-2]][O[O.length-1]],O.push(Ae);break;case 3:return!0}}return!0},"parse")},k=(function(){var C={EOF:1,parseError:T(function(L,O){if(this.yy.parser)this.yy.parser.parseError(L,O);else throw new Error(L)},"parseError"),setInput:T(function(_,L){return this.yy=L||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var L=_.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:T(function(_){var L=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===D.length?this.yylloc.first_column:0)+D[D.length-O.length].length-O[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(_){this.unput(this.match.slice(_))},"less"),pastInput:T(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var _=this.pastInput(),L=new Array(_.length+1).join("-");return _+this.upcomingInput()+` -`+L+"^"},"showPosition"),test_match:T(function(_,L){var O,D,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),D=_[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var F in z)this[F]=z[F];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,L,O,D;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),F=0;FL[0].length)){if(L=O,D=F,this.options.backtrack_lexer){if(_=this.test_match(O,z[F]),_!==!1)return _;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(_=this.test_match(L,z[D]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var L=this.next();return L||this.lex()},"lex"),begin:T(function(L){this.conditionStack.push(L)},"begin"),popState:T(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:T(function(L){this.begin(L)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(L,O,D,z){switch(D){case 0:return this.pushState("shapeData"),O.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const F=/\n\s*/g;return O.yytext=O.yytext.replace(F,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",O.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",O.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",O.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",O.yytext),21;case 42:return L.getLogger().trace("Long description:",O.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return C})();w.lexer=k;function S(){this.yy={}}return T(S,"Parser"),S.prototype=w,w.Parser=S,new S})();eP.parser=eP;var sdt=eP,Co=[],tP=[],rP=0,nP={},odt=T(()=>{Co=[],tP=[],rP=0,nP={}},"clear"),ldt=T(t=>{if(Co.length===0)return null;const e=Co[0].level;let r=null;for(let n=Co.length-1;n>=0;n--)if(Co[n].level===e&&!r&&(r=Co[n]),Co[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:qr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:$e()}},"getData"),udt=T((t,e,r,n,i)=>{var u,h;const a=$e();let s=((u=a.mindmap)==null?void 0:u.padding)??Fr.mindmap.padding;switch(n){case Vi.ROUNDED_RECT:case Vi.RECT:case Vi.HEXAGON:s*=2}const o={id:qr(e,a)||"kbn"+rP++,level:t,label:qr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` + ${t.useGradient&&r&&t.mainBkg?t1t(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),n1t=r1t,i1t={get db(){return new Zmt},renderer:Jmt,parser:jmt,styles:n1t};const a1t=Object.freeze(Object.defineProperty({__proto__:null,diagram:i1t},Symbol.toStringTag,{value:"Module"}));var $F=(function(){var t=b(function(S,E,L,M){for(L=L||{},M=S.length;M--;L[S[M]]=E);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],x=[1,38],w={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:b(function(E,L,M,I,P,$,_){var R=$.length-1;switch(P){case 6:case 7:return I;case 8:I.getLogger().trace("Stop NL ");break;case 9:I.getLogger().trace("Stop EOF ");break;case 11:I.getLogger().trace("Stop NL2 ");break;case 12:I.getLogger().trace("Stop EOF2 ");break;case 15:I.getLogger().info("Node: ",$[R-1].id),I.addNode($[R-2].length,$[R-1].id,$[R-1].descr,$[R-1].type,$[R]);break;case 16:I.getLogger().info("Node: ",$[R].id),I.addNode($[R-1].length,$[R].id,$[R].descr,$[R].type);break;case 17:I.getLogger().trace("Icon: ",$[R]),I.decorateNode({icon:$[R]});break;case 18:case 23:I.decorateNode({class:$[R]});break;case 19:I.getLogger().trace("SPACELIST");break;case 20:I.getLogger().trace("Node: ",$[R-1].id),I.addNode(0,$[R-1].id,$[R-1].descr,$[R-1].type,$[R]);break;case 21:I.getLogger().trace("Node: ",$[R].id),I.addNode(0,$[R].id,$[R].descr,$[R].type);break;case 22:I.decorateNode({icon:$[R]});break;case 27:I.getLogger().trace("node found ..",$[R-2]),this.$={id:$[R-1],descr:$[R-1],type:I.getType($[R-2],$[R])};break;case 28:this.$={id:$[R],descr:$[R],type:0};break;case 29:I.getLogger().trace("node found ..",$[R-3]),this.$={id:$[R-3],descr:$[R-1],type:I.getType($[R-2],$[R])};break;case 30:this.$=$[R-1]+$[R];break;case 31:this.$=$[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:x}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:x}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:b(function(E,L){if(L.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=L,M}},"parseError"),parse:b(function(E){var L=this,M=[0],I=[],P=[null],$=[],_=this.table,R="",O=0,D=0,N=2,B=1,F=$.slice.call(arguments,1),G=Object.create(this.lexer),z={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(z.yy[W]=this.yy[W]);G.setInput(E,z.yy),z.yy.lexer=G,z.yy.parser=this,typeof G.yylloc>"u"&&(G.yylloc={});var V=G.yylloc;$.push(V);var H=G.options&&G.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(ue){M.length=M.length-2*ue,P.length=P.length-ue,$.length=$.length-ue}b(te,"popStack");function Y(){var ue;return ue=I.pop()||G.lex()||B,typeof ue!="number"&&(ue instanceof Array&&(I=ue,ue=I.pop()),ue=L.symbols_[ue]||ue),ue}b(Y,"lex");for(var se,J,Z,ee,re={},ge,ae,_e,Fe;;){if(J=M[M.length-1],this.defaultActions[J]?Z=this.defaultActions[J]:((se===null||typeof se>"u")&&(se=Y()),Z=_[J]&&_[J][se]),typeof Z>"u"||!Z.length||!Z[0]){var qe="";Fe=[];for(ge in _[J])this.terminals_[ge]&&ge>N&&Fe.push("'"+this.terminals_[ge]+"'");G.showPosition?qe="Parse error on line "+(O+1)+`: +`+G.showPosition()+` +Expecting `+Fe.join(", ")+", got '"+(this.terminals_[se]||se)+"'":qe="Parse error on line "+(O+1)+": Unexpected "+(se==B?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(qe,{text:G.match,token:this.terminals_[se]||se,line:G.yylineno,loc:V,expected:Fe})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+se);switch(Z[0]){case 1:M.push(se),P.push(G.yytext),$.push(G.yylloc),M.push(Z[1]),se=null,D=G.yyleng,R=G.yytext,O=G.yylineno,V=G.yylloc;break;case 2:if(ae=this.productions_[Z[1]][1],re.$=P[P.length-ae],re._$={first_line:$[$.length-(ae||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(ae||1)].first_column,last_column:$[$.length-1].last_column},H&&(re._$.range=[$[$.length-(ae||1)].range[0],$[$.length-1].range[1]]),ee=this.performAction.apply(re,[R,D,O,z.yy,Z[1],P,$].concat(F)),typeof ee<"u")return ee;ae&&(M=M.slice(0,-1*ae*2),P=P.slice(0,-1*ae),$=$.slice(0,-1*ae)),M.push(this.productions_[Z[1]][0]),P.push(re.$),$.push(re._$),_e=_[M[M.length-2]][M[M.length-1]],M.push(_e);break;case 3:return!0}}return!0},"parse")},C=(function(){var S={EOF:1,parseError:b(function(L,M){if(this.yy.parser)this.yy.parser.parseError(L,M);else throw new Error(L)},"parseError"),setInput:b(function(E,L){return this.yy=L||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var L=E.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),E},"input"),unput:b(function(E){var L=E.length,M=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var I=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var P=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===I.length?this.yylloc.first_column:0)+I[I.length-M.length].length-M[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(E){this.unput(this.match.slice(E))},"less"),pastInput:b(function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var E=this.pastInput(),L=new Array(E.length+1).join("-");return E+this.upcomingInput()+` +`+L+"^"},"showPosition"),test_match:b(function(E,L){var M,I,P;if(this.options.backtrack_lexer&&(P={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(P.yylloc.range=this.yylloc.range.slice(0))),I=E[0].match(/(?:\r\n?|\n).*/g),I&&(this.yylineno+=I.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:I?I[I.length-1].length-I[I.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],M=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var $ in P)this[$]=P[$];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,L,M,I;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),$=0;$L[0].length)){if(L=M,I=$,this.options.backtrack_lexer){if(E=this.test_match(M,P[$]),E!==!1)return E;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(E=this.test_match(L,P[I]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var L=this.next();return L||this.lex()},"lex"),begin:b(function(L){this.conditionStack.push(L)},"begin"),popState:b(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:b(function(L){this.begin(L)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(L,M,I,P){switch(I){case 0:return this.pushState("shapeData"),M.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const $=/\n\s*/g;return M.yytext=M.yytext.replace($,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",M.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",M.yytext),21;case 42:return L.getLogger().trace("Long description:",M.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return S})();w.lexer=C;function k(){this.yy={}}return b(k,"Parser"),k.prototype=w,w.Parser=k,new k})();$F.parser=$F;var s1t=$F,Ko=[],PF=[],BF=0,FF={},o1t=b(()=>{Ko=[],PF=[],BF=0,FF={}},"clear"),l1t=b(t=>{if(Ko.length===0)return null;const e=Ko[0].level;let r=null;for(let n=Ko.length-1;n>=0;n--)if(Ko[n].level===e&&!r&&(r=Ko[n]),Ko[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Qr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Ve()}},"getData"),u1t=b((t,e,r,n,i)=>{var u,h;const a=Ve();let s=((u=a.mindmap)==null?void 0:u.padding)??jr.mindmap.padding;switch(n){case la.ROUNDED_RECT:case la.RECT:case la.HEXAGON:s*=2}const o={id:Qr(e,a)||"kbn"+BF++,level:t,label:Qr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??jr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=N4(d,{schema:M4});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=ldt(t);l?o.parentId=l.id||"kbn"+rP++:tP.push(o),Co.push(o)},"addNode"),Vi={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},hdt=T((t,e)=>{switch(ae.debug("In get type",t,e),t){case"[":return Vi.RECT;case"(":return e===")"?Vi.ROUNDED_RECT:Vi.CLOUD;case"((":return Vi.CIRCLE;case")":return Vi.CLOUD;case"))":return Vi.BANG;case"{{":return Vi.HEXAGON;default:return Vi.DEFAULT}},"getType"),ddt=T((t,e)=>{nP[t]=e},"setElementForId"),fdt=T(t=>{if(!t)return;const e=$e(),r=Co[Co.length-1];t.icon&&(r.icon=qr(t.icon,e)),t.class&&(r.cssClasses=qr(t.class,e))},"decorateNode"),pdt=T(t=>{switch(t){case Vi.DEFAULT:return"no-border";case Vi.RECT:return"rect";case Vi.ROUNDED_RECT:return"rounded-rect";case Vi.CIRCLE:return"circle";case Vi.CLOUD:return"cloud";case Vi.BANG:return"bang";case Vi.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),gdt=T(()=>ae,"getLogger"),mdt=T(t=>nP[t],"getElementById"),ydt={clear:odt,addNode:udt,getSections:L1e,getData:cdt,nodeType:Vi,getType:hdt,setElementForId:ddt,decorateNode:fdt,type2Str:pdt,getLogger:gdt,getElementById:mdt},vdt=ydt,bdt=T(async(t,e,r,n)=>{var y,v,x,b,w;ae.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=$e();s.htmlLabels=!1;const o=ms(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=S*d+(d-1)*f/2,k.width=S,k.y=0,k.height=S*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await j_(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const S=p[m];m=m+1;const C=((x=s==null?void 0:s.kanban)==null?void 0:x.sectionWidth)||200,_=-C*3/2+g;let L=_;const O=a.nodes.filter(F=>F.parentId===k.id);for(const F of O){if(F.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");F.x=k.x,F.width=C-1.5*f;const R=(await cC(u,F,{config:s})).node().getBBox();F.y=L+R.height/2,await r7(F),L=F.y+R.height/2+f/2}const D=S.cluster.select("rect"),z=Math.max(L-_+3*f,50)+(g-25);D.attr("height",z)}Ap(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Fr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Fr.kanban.useMaxWidth)},"draw"),xdt={draw:bdt},Tdt=T(t=>{let e="";for(let n=0;nt.darkMode?st(n,i):at(n,i),"adjuster");for(let n=0;n{switch(he.debug("In get type",t,e),t){case"[":return la.RECT;case"(":return e===")"?la.ROUNDED_RECT:la.CLOUD;case"((":return la.CIRCLE;case")":return la.CLOUD;case"))":return la.BANG;case"{{":return la.HEXAGON;default:return la.DEFAULT}},"getType"),d1t=b((t,e)=>{FF[t]=e},"setElementForId"),f1t=b(t=>{if(!t)return;const e=Ve(),r=Ko[Ko.length-1];t.icon&&(r.icon=Qr(t.icon,e)),t.class&&(r.cssClasses=Qr(t.class,e))},"decorateNode"),p1t=b(t=>{switch(t){case la.DEFAULT:return"no-border";case la.RECT:return"rect";case la.ROUNDED_RECT:return"rounded-rect";case la.CIRCLE:return"circle";case la.CLOUD:return"cloud";case la.BANG:return"bang";case la.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),g1t=b(()=>he,"getLogger"),m1t=b(t=>FF[t],"getElementById"),y1t={clear:o1t,addNode:u1t,getSections:yxe,getData:c1t,nodeType:la,getType:h1t,setElementForId:d1t,decorateNode:f1t,type2Str:p1t,getLogger:g1t,getElementById:m1t},v1t=y1t,b1t=b(async(t,e,r,n)=>{var y,v,T,x,w;he.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=Ve();s.htmlLabels=!1;const o=Ka(e);for(const C of a.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const k=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=k*d+(d-1)*f/2,C.width=k,C.y=0,C.height=k*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const S=await oS(l,C);g=Math.max(g,(v=S==null?void 0:S.labelBBox)==null?void 0:v.height),p.push(S)}let m=0;for(const C of h){const k=p[m];m=m+1;const S=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,E=-S*3/2+g;let L=E;const M=a.nodes.filter($=>$.parentId===C.id);for(const $ of M){if($.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");$.x=C.x,$.width=S-1.5*f;const R=(await Jb(u,$,{config:s})).node().getBBox();$.y=L+R.height/2,await uS($),L=$.y+R.height/2+f/2}const I=k.cluster.select("rect"),P=Math.max(L-E+3*f,50)+(g-25);I.attr("height",P)}d0(void 0,o,((x=s.mindmap)==null?void 0:x.padding)??jr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??jr.kanban.useMaxWidth)},"draw"),x1t={draw:b1t},T1t=b(t=>{let e="";for(let n=0;nt.darkMode?ot(n,i):st(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),w1t=b(t=>` .edge { stroke-width: 3; } - ${Tdt(t)} + ${T1t(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2895,15 +2910,15 @@ Expecting `+Re.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ge="Parse erro dominant-baseline: middle; text-align: center; } - ${vx()} -`,"getStyles"),Cdt=wdt,kdt={db:vdt,renderer:xdt,parser:sdt,styles:Cdt};const Edt=Object.freeze(Object.defineProperty({__proto__:null,diagram:kdt},Symbol.toStringTag,{value:"Module"}));function I1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function D1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function iP(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function Sdt(t){return t.target.depth}function Adt(t){return t.depth}function _dt(t,e){return e-1-t.height}function M1e(t,e){return t.sourceLinks.length?t.depth:e-1}function Rdt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?D1e(t.sourceLinks,Sdt)-1:0}function qS(t){return function(){return t}}function N1e(t,e){return VS(t.source,e.source)||t.index-e.index}function O1e(t,e){return VS(t.target,e.target)||t.index-e.index}function VS(t,e){return t.y0-e.y0}function aP(t){return t.value}function Ldt(t){return t.index}function Idt(t){return t.nodes}function Ddt(t){return t.links}function $1e(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function P1e({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function Mdt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=Ldt,l=M1e,u,h,d=Idt,f=Ddt,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),x(R),k(R),P1e(R),R}g.update=function(R){return P1e(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:qS(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:qS(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:qS(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:qS(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:N}){for(const[I,$]of R.entries())$.index=I,$.sourceLinks=[],$.targetLinks=[];const M=new Map(R.map((I,$)=>[o(I,$,R),I]));for(const[I,$]of N.entries()){$.index=I;let{source:P,target:B}=$;typeof P!="object"&&(P=$.source=$1e(M,P)),typeof B!="object"&&(B=$.target=$1e(M,B)),P.sourceLinks.push($),B.targetLinks.push($)}if(h!=null)for(const{sourceLinks:I,targetLinks:$}of R)I.sort(h),$.sort(h)}function y({nodes:R}){for(const N of R)N.value=N.fixedValue===void 0?Math.max(iP(N.sourceLinks,aP),iP(N.targetLinks,aP)):N.fixedValue}function v({nodes:R}){const N=R.length;let M=new Set(R),I=new Set,$=0;for(;M.size;){for(const P of M){P.depth=$;for(const{target:B}of P.sourceLinks)I.add(B)}if(++$>N)throw new Error("circular link");M=I,I=new Set}}function x({nodes:R}){const N=R.length;let M=new Set(R),I=new Set,$=0;for(;M.size;){for(const P of M){P.height=$;for(const{source:B}of P.targetLinks)I.add(B)}if(++$>N)throw new Error("circular link");M=I,I=new Set}}function b({nodes:R}){const N=I1e(R,$=>$.depth)+1,M=(r-t-i)/(N-1),I=new Array(N);for(const $ of R){const P=Math.max(0,Math.min(N-1,Math.floor(l.call(null,$,N))));$.layer=P,$.x0=t+P*M,$.x1=$.x0+i,I[P]?I[P].push($):I[P]=[$]}if(u)for(const $ of I)$.sort(u);return I}function w(R){const N=D1e(R,M=>(n-e-(M.length-1)*s)/iP(M,aP));for(const M of R){let I=e;for(const $ of M){$.y0=I,$.y1=I+$.value*N,I=$.y1+s;for(const P of $.sourceLinks)P.width=P.value*N}I=(n-I+s)/(M.length+1);for(let $=0;$M.length)-1)),w(N);for(let M=0;M0))continue;let X=(q/V-B.y0)*N;B.y0+=X,B.y1+=X,D(B)}u===void 0&&P.sort(VS),_(P,M)}}function C(R,N,M){for(let I=R.length,$=I-2;$>=0;--$){const P=R[$];for(const B of P){let q=0,V=0;for(const{target:W,value:ie}of B.sourceLinks){let K=ie*(W.layer-B.layer);q+=A(B,W)*K,V+=K}if(!(V>0))continue;let X=(q/V-B.y0)*N;B.y0+=X,B.y1+=X,D(B)}u===void 0&&P.sort(VS),_(P,M)}}function _(R,N){const M=R.length>>1,I=R[M];O(R,I.y0-s,M-1,N),L(R,I.y1+s,M+1,N),O(R,n,R.length-1,N),L(R,e,0,N)}function L(R,N,M,I){for(;M1e-6&&($.y0+=P,$.y1+=P),N=$.y1+s}}function O(R,N,M,I){for(;M>=0;--M){const $=R[M],P=($.y1-N)*I;P>1e-6&&($.y0-=P,$.y1-=P),N=$.y0-s}}function D({sourceLinks:R,targetLinks:N}){if(h===void 0){for(const{source:{sourceLinks:M}}of N)M.sort(O1e);for(const{target:{targetLinks:M}}of R)M.sort(N1e)}}function z(R){if(h===void 0)for(const{sourceLinks:N,targetLinks:M}of R)N.sort(O1e),M.sort(N1e)}function F(R,N){let M=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;M+=$+s}for(const{source:I,width:$}of N.targetLinks){if(I===R)break;M-=$}return M}function A(R,N){let M=N.y0-(N.targetLinks.length-1)*s/2;for(const{source:I,width:$}of N.targetLinks){if(I===R)break;M+=$+s}for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;M-=$}return M}return g}var sP=Math.PI,oP=2*sP,ap=1e-6,Ndt=oP-ap;function lP(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function B1e(){return new lP}lP.prototype=B1e.prototype={constructor:lP,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>ap)if(!(Math.abs(h*o-l*u)>ap)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),x=i*Math.tan((sP-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,w=x/y;Math.abs(b-1)>ap&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>ap||Math.abs(this._y1-u)>ap)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%oP+oP),d>Ndt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>ap&&(this._+="A"+r+","+r+",0,"+ +(d>=sP)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function F1e(t){return function(){return t}}function Odt(t){return t[0]}function $dt(t){return t[1]}var Pdt=Array.prototype.slice;function Bdt(t){return t.source}function Fdt(t){return t.target}function zdt(t){var e=Bdt,r=Fdt,n=Odt,i=$dt,a=null;function s(){var o,l=Pdt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=B1e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:F1e(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:F1e(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function Gdt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function qdt(){return zdt(Gdt)}function Vdt(t){return[t.source.x1,t.y0]}function Wdt(t){return[t.target.x0,t.y1]}function Udt(){return qdt().source(Vdt).target(Wdt)}var cP=(function(){var t=T(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:T(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:T(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:T(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,w=p.slice.call(arguments,1),k=Object.create(this.lexer),S={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(S.yy[C]=this.yy[C]);k.setInput(l,S.yy),S.yy.lexer=k,S.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _=k.yylloc;p.push(_);var L=k.options&&k.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(q){h.length=h.length-2*q,f.length=f.length-q,p.length=p.length-q}T(O,"popStack");function D(){var q;return q=d.pop()||k.lex()||b,typeof q!="number"&&(q instanceof Array&&(d=q,q=d.pop()),q=u.symbols_[q]||q),q}T(D,"lex");for(var z,F,A,R,N={},M,I,$,P;;){if(F=h[h.length-1],this.defaultActions[F]?A=this.defaultActions[F]:((z===null||typeof z>"u")&&(z=D()),A=g[F]&&g[F][z]),typeof A>"u"||!A.length||!A[0]){var B="";P=[];for(M in g[F])this.terminals_[M]&&M>x&&P.push("'"+this.terminals_[M]+"'");k.showPosition?B="Parse error on line "+(y+1)+`: -`+k.showPosition()+` -Expecting `+P.join(", ")+", got '"+(this.terminals_[z]||z)+"'":B="Parse error on line "+(y+1)+": Unexpected "+(z==b?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(B,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:_,expected:P})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+z);switch(A[0]){case 1:h.push(z),f.push(k.yytext),p.push(k.yylloc),h.push(A[1]),z=null,v=k.yyleng,m=k.yytext,y=k.yylineno,_=k.yylloc;break;case 2:if(I=this.productions_[A[1]][1],N.$=f[f.length-I],N._$={first_line:p[p.length-(I||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(I||1)].first_column,last_column:p[p.length-1].last_column},L&&(N._$.range=[p[p.length-(I||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(N,[m,v,y,S.yy,A[1],f,p].concat(w)),typeof R<"u")return R;I&&(h=h.slice(0,-1*I*2),f=f.slice(0,-1*I),p=p.slice(0,-1*I)),h.push(this.productions_[A[1]][0]),f.push(N.$),p.push(N._$),$=g[h[h.length-2]][h[h.length-1]],h.push($);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:T(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:T(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:T(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(l){this.unput(this.match.slice(l))},"less"),pastInput:T(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` -`+u+"^"},"showPosition"),test_match:T(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var u=this.next();return u||this.lex()},"lex"),begin:T(function(u){this.conditionStack.push(u)},"begin"),popState:T(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:T(function(u){this.begin(u)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return T(s,"Parser"),s.prototype=i,i.Parser=s,new s})();cP.parser=cP;var WS=cP,US=[],HS=[],YS=new Map,Hdt=T(()=>{US=[],HS=[],YS=new Map,Dn()},"clear"),Ydt=(Hv=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},T(Hv,"SankeyLink"),Hv),Xdt=T((t,e,r)=>{US.push(new Ydt(t,e,r))},"addLink"),Kdt=(Yv=class{constructor(e){this.ID=e}},T(Yv,"SankeyNode"),Yv),jdt=T(t=>{t=It.sanitizeText(t,$e());let e=YS.get(t);return e===void 0&&(e=new Kdt(t),YS.set(t,e),HS.push(e)),e},"findOrCreateNode"),Zdt=T(()=>HS,"getNodes"),Qdt=T(()=>US,"getLinks"),Jdt=T(()=>({nodes:HS.map(t=>({id:t.ID})),links:US.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),eft={nodesMap:YS,getConfig:T(()=>$e().sankey,"getConfig"),getNodes:Zdt,getLinks:Qdt,getGraph:Jdt,addLink:Xdt,findOrCreateNode:jdt,getAccTitle:Gn,setAccTitle:Mn,getAccDescription:Vn,setAccDescription:qn,getDiagramTitle:Nn,setDiagramTitle:Wn,clear:Hdt},z1e=(xu=class{static next(e){return new xu(e+ ++xu.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},T(xu,"Uid"),xu.count=0,xu),tft={left:Adt,right:_dt,center:Rdt,justify:M1e},rft=T(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),nft=T(function(t,e,r,n){const{securityLevel:i,sankey:a}=$e(),s=XB.sankey;let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,x=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),S=tft[p];Mdt().nodeId(I=>I.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(k);const _=rft(k.nodes),L=Jh(Y3e),O=T(I=>w[I]??L(I),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",I=>(I.uid=z1e.next("node-")).id).attr("transform",function(I){return"translate("+I.x0+","+I.y0+")"}).attr("x",I=>I.x0).attr("y",I=>I.y0).append("rect").attr("height",I=>I.y1-I.y0).attr("width",I=>I.x1-I.x0).attr("fill",I=>O(I.id));const D=T(({id:I,value:$})=>y?`${I} -${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0)<_?{x:I.x0-6,anchor:"end"}:{x:I.x1+6,anchor:"start"}:I.x0F.selectAll(I?`.${I}`:"text").data(k.nodes).join("text").attr("class",I??null).attr("x",$=>z($).x).attr("y",$=>($.y1+$.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",$=>z($).anchor).text(D),"appendLabel");b==="outlined"?(A("sankey-label-bg"),A("sankey-label-fg")):A();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),N=(a==null?void 0:a.linkColor)??"gradient";if(N==="gradient"){const I=R.append("linearGradient").attr("id",$=>($.uid=z1e.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",$=>$.source.x1).attr("x2",$=>$.target.x0);I.append("stop").attr("offset","0%").attr("stop-color",$=>O($.source.id)),I.append("stop").attr("offset","100%").attr("stop-color",$=>O($.target.id))}let M;switch(N){case"gradient":M=T(I=>I.uid,"coloring");break;case"source":M=T(I=>O(I.source.id),"coloring");break;case"target":M=T(I=>O(I.target.id),"coloring");break;default:M=N}R.append("path").attr("d",Udt()).attr("stroke",M).attr("stroke-width",I=>Math.max(1,I.width)),Ap(void 0,u,0,f)},"draw"),ift={draw:nft},aft=T(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),sft=T(t=>`.label { + ${gT()} +`,"getStyles"),C1t=w1t,S1t={db:v1t,renderer:x1t,parser:s1t,styles:C1t};const k1t=Object.freeze(Object.defineProperty({__proto__:null,diagram:S1t},Symbol.toStringTag,{value:"Module"}));function vxe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function bxe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function zF(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function E1t(t){return t.target.depth}function A1t(t){return t.depth}function _1t(t,e){return e-1-t.height}function xxe(t,e){return t.sourceLinks.length?t.depth:e-1}function R1t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?bxe(t.sourceLinks,E1t)-1:0}function c6(t){return function(){return t}}function Txe(t,e){return u6(t.source,e.source)||t.index-e.index}function wxe(t,e){return u6(t.target,e.target)||t.index-e.index}function u6(t,e){return t.y0-e.y0}function GF(t){return t.value}function L1t(t){return t.index}function I1t(t){return t.nodes}function M1t(t){return t.links}function Cxe(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Sxe({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function D1t(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=L1t,l=xxe,u,h,d=I1t,f=M1t,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),T(R),C(R),Sxe(R),R}g.update=function(R){return Sxe(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:c6(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:c6(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:c6(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:c6(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:O}){for(const[N,B]of R.entries())B.index=N,B.sourceLinks=[],B.targetLinks=[];const D=new Map(R.map((N,B)=>[o(N,B,R),N]));for(const[N,B]of O.entries()){B.index=N;let{source:F,target:G}=B;typeof F!="object"&&(F=B.source=Cxe(D,F)),typeof G!="object"&&(G=B.target=Cxe(D,G)),F.sourceLinks.push(B),G.targetLinks.push(B)}if(h!=null)for(const{sourceLinks:N,targetLinks:B}of R)N.sort(h),B.sort(h)}function y({nodes:R}){for(const O of R)O.value=O.fixedValue===void 0?Math.max(zF(O.sourceLinks,GF),zF(O.targetLinks,GF)):O.fixedValue}function v({nodes:R}){const O=R.length;let D=new Set(R),N=new Set,B=0;for(;D.size;){for(const F of D){F.depth=B;for(const{target:G}of F.sourceLinks)N.add(G)}if(++B>O)throw new Error("circular link");D=N,N=new Set}}function T({nodes:R}){const O=R.length;let D=new Set(R),N=new Set,B=0;for(;D.size;){for(const F of D){F.height=B;for(const{source:G}of F.targetLinks)N.add(G)}if(++B>O)throw new Error("circular link");D=N,N=new Set}}function x({nodes:R}){const O=vxe(R,B=>B.depth)+1,D=(r-t-i)/(O-1),N=new Array(O);for(const B of R){const F=Math.max(0,Math.min(O-1,Math.floor(l.call(null,B,O))));B.layer=F,B.x0=t+F*D,B.x1=B.x0+i,N[F]?N[F].push(B):N[F]=[B]}if(u)for(const B of N)B.sort(u);return N}function w(R){const O=bxe(R,D=>(n-e-(D.length-1)*s)/zF(D,GF));for(const D of R){let N=e;for(const B of D){B.y0=N,B.y1=N+B.value*O,N=B.y1+s;for(const F of B.sourceLinks)F.width=F.value*O}N=(n-N+s)/(D.length+1);for(let B=0;BD.length)-1)),w(O);for(let D=0;D0))continue;let V=(z/W-G.y0)*O;G.y0+=V,G.y1+=V,I(G)}u===void 0&&F.sort(u6),E(F,D)}}function S(R,O,D){for(let N=R.length,B=N-2;B>=0;--B){const F=R[B];for(const G of F){let z=0,W=0;for(const{target:H,value:te}of G.sourceLinks){let Y=te*(H.layer-G.layer);z+=_(G,H)*Y,W+=Y}if(!(W>0))continue;let V=(z/W-G.y0)*O;G.y0+=V,G.y1+=V,I(G)}u===void 0&&F.sort(u6),E(F,D)}}function E(R,O){const D=R.length>>1,N=R[D];M(R,N.y0-s,D-1,O),L(R,N.y1+s,D+1,O),M(R,n,R.length-1,O),L(R,e,0,O)}function L(R,O,D,N){for(;D1e-6&&(B.y0+=F,B.y1+=F),O=B.y1+s}}function M(R,O,D,N){for(;D>=0;--D){const B=R[D],F=(B.y1-O)*N;F>1e-6&&(B.y0-=F,B.y1-=F),O=B.y0-s}}function I({sourceLinks:R,targetLinks:O}){if(h===void 0){for(const{source:{sourceLinks:D}}of O)D.sort(wxe);for(const{target:{targetLinks:D}}of R)D.sort(Txe)}}function P(R){if(h===void 0)for(const{sourceLinks:O,targetLinks:D}of R)O.sort(wxe),D.sort(Txe)}function $(R,O){let D=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:N,width:B}of R.sourceLinks){if(N===O)break;D+=B+s}for(const{source:N,width:B}of O.targetLinks){if(N===R)break;D-=B}return D}function _(R,O){let D=O.y0-(O.targetLinks.length-1)*s/2;for(const{source:N,width:B}of O.targetLinks){if(N===R)break;D+=B+s}for(const{target:N,width:B}of R.sourceLinks){if(N===O)break;D-=B}return D}return g}var WF=Math.PI,qF=2*WF,Yp=1e-6,N1t=qF-Yp;function VF(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kxe(){return new VF}VF.prototype=kxe.prototype={constructor:VF,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>Yp)if(!(Math.abs(h*o-l*u)>Yp)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((WF-Math.acos((g+d-m)/(2*y*v)))/2),x=T/v,w=T/y;Math.abs(x-1)>Yp&&(this._+="L"+(t+x*u)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Yp||Math.abs(this._y1-u)>Yp)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%qF+qF),d>N1t?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>Yp&&(this._+="A"+r+","+r+",0,"+ +(d>=WF)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Exe(t){return function(){return t}}function O1t(t){return t[0]}function $1t(t){return t[1]}var P1t=Array.prototype.slice;function B1t(t){return t.source}function F1t(t){return t.target}function z1t(t){var e=B1t,r=F1t,n=O1t,i=$1t,a=null;function s(){var o,l=P1t.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=kxe()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Exe(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Exe(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function G1t(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function W1t(){return z1t(G1t)}function q1t(t){return[t.source.x1,t.y0]}function V1t(t){return[t.target.x0,t.y1]}function U1t(){return W1t().source(q1t).target(V1t)}var UF=(function(){var t=b(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:b(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:b(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:b(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,x=1,w=p.slice.call(arguments,1),C=Object.create(this.lexer),k={yy:{}};for(var S in this.yy)Object.prototype.hasOwnProperty.call(this.yy,S)&&(k.yy[S]=this.yy[S]);C.setInput(l,k.yy),k.yy.lexer=C,k.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var L=C.options&&C.options.ranges;typeof k.yy.parseError=="function"?this.parseError=k.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(z){h.length=h.length-2*z,f.length=f.length-z,p.length=p.length-z}b(M,"popStack");function I(){var z;return z=d.pop()||C.lex()||x,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=u.symbols_[z]||z),z}b(I,"lex");for(var P,$,_,R,O={},D,N,B,F;;){if($=h[h.length-1],this.defaultActions[$]?_=this.defaultActions[$]:((P===null||typeof P>"u")&&(P=I()),_=g[$]&&g[$][P]),typeof _>"u"||!_.length||!_[0]){var G="";F=[];for(D in g[$])this.terminals_[D]&&D>T&&F.push("'"+this.terminals_[D]+"'");C.showPosition?G="Parse error on line "+(y+1)+`: +`+C.showPosition()+` +Expecting `+F.join(", ")+", got '"+(this.terminals_[P]||P)+"'":G="Parse error on line "+(y+1)+": Unexpected "+(P==x?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(G,{text:C.match,token:this.terminals_[P]||P,line:C.yylineno,loc:E,expected:F})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+P);switch(_[0]){case 1:h.push(P),f.push(C.yytext),p.push(C.yylloc),h.push(_[1]),P=null,v=C.yyleng,m=C.yytext,y=C.yylineno,E=C.yylloc;break;case 2:if(N=this.productions_[_[1]][1],O.$=f[f.length-N],O._$={first_line:p[p.length-(N||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(N||1)].first_column,last_column:p[p.length-1].last_column},L&&(O._$.range=[p[p.length-(N||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(O,[m,v,y,k.yy,_[1],f,p].concat(w)),typeof R<"u")return R;N&&(h=h.slice(0,-1*N*2),f=f.slice(0,-1*N),p=p.slice(0,-1*N)),h.push(this.productions_[_[1]][0]),f.push(O.$),p.push(O._$),B=g[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:b(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:b(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:b(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(l){this.unput(this.match.slice(l))},"less"),pastInput:b(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:b(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var u=this.next();return u||this.lex()},"lex"),begin:b(function(u){this.conditionStack.push(u)},"begin"),popState:b(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:b(function(u){this.begin(u)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return b(s,"Parser"),s.prototype=i,i.Parser=s,new s})();UF.parser=UF;var h6=UF,d6=[],f6=[],p6=new Map,H1t=b(()=>{d6=[],f6=[],p6=new Map,zn()},"clear"),Y1t=(G2=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},b(G2,"SankeyLink"),G2),X1t=b((t,e,r)=>{d6.push(new Y1t(t,e,r))},"addLink"),j1t=(W2=class{constructor(e){this.ID=e}},b(W2,"SankeyNode"),W2),K1t=b(t=>{t=$t.sanitizeText(t,Ve());let e=p6.get(t);return e===void 0&&(e=new j1t(t),p6.set(t,e),f6.push(e)),e},"findOrCreateNode"),Z1t=b(()=>f6,"getNodes"),Q1t=b(()=>d6,"getLinks"),J1t=b(()=>({nodes:f6.map(t=>({id:t.ID})),links:d6.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),eyt={nodesMap:p6,getConfig:b(()=>Ve().sankey,"getConfig"),getNodes:Z1t,getLinks:Q1t,getGraph:J1t,addLink:X1t,findOrCreateNode:K1t,getAccTitle:Qn,setAccTitle:qn,getAccDescription:ei,setAccDescription:Jn,getDiagramTitle:Vn,setDiagramTitle:ti,clear:H1t},Axe=(eh=class{static next(e){return new eh(e+ ++eh.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},b(eh,"Uid"),eh.count=0,eh),tyt={left:A1t,right:_1t,center:R1t,justify:xxe},ryt=b(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),nyt=b(function(t,e,r,n){const{securityLevel:i,sankey:a}=Ve(),s=WG.sankey;let o;i==="sandbox"&&(o=mt("#i"+e));const l=mt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):mt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,x=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},C=n.db.getGraph(),k=tyt[p];D1t().nodeId(N=>N.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(k).extent([[0,0],[h,d]])(C);const E=ryt(C.nodes),L=Pd(d_e),M=b(N=>w[N]??L(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=Axe.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>M(N.id));const I=b(({id:N,value:B})=>y?`${N} +${g}${Math.round(B*100)/100}${m}`:N,"getText"),P=b(N=>x==="outlined"?(N.layer??0)$.selectAll(N?`.${N}`:"text").data(C.nodes).join("text").attr("class",N??null).attr("x",B=>P(B).x).attr("y",B=>(B.y1+B.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",B=>P(B).anchor).text(I),"appendLabel");x==="outlined"?(_("sankey-label-bg"),_("sankey-label-fg")):_();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(a==null?void 0:a.linkColor)??"gradient";if(O==="gradient"){const N=R.append("linearGradient").attr("id",B=>(B.uid=Axe.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",B=>B.source.x1).attr("x2",B=>B.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",B=>M(B.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",B=>M(B.target.id))}let D;switch(O){case"gradient":D=b(N=>N.uid,"coloring");break;case"source":D=b(N=>M(N.source.id),"coloring");break;case"target":D=b(N=>M(N.target.id),"coloring");break;default:D=O}R.append("path").attr("d",U1t()).attr("stroke",D).attr("stroke-width",N=>Math.max(1,N.width)),d0(void 0,u,0,f)},"draw"),iyt={draw:nyt},ayt=b(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),syt=b(t=>`.label { font-family: ${t.fontFamily}; } @@ -2935,7 +2950,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),oft=sft,lft=WS.parse.bind(WS);WS.parse=t=>lft(aft(t));var cft={styles:oft,parser:WS,db:eft,renderer:ift};const uft=Object.freeze(Object.defineProperty({__proto__:null,diagram:cft},Symbol.toStringTag,{value:"Module"}));var hft=Fr.packet,G1e=(Xv=class{constructor(){this.packet=[],this.setAccTitle=Mn,this.getAccTitle=Gn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getAccDescription=Vn,this.setAccDescription=qn}getConfig(){const e=ti({...hft,...lr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Dn(),this.packet=[]}},T(Xv,"PacketDB"),Xv),dft=1e4,fft=T((t,e)=>{Fl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),q1e={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("packet",t),r=(n=q1e.parser)==null?void 0:n.yy;if(!(r instanceof G1e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ae.debug(e),fft(e,r)},"parse")},gft=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=ms(e);m.attr("viewBox",`0 0 ${g} ${p}`),vi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())mft(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),mft=T((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),yft={draw:gft},vft={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},bft=T(({packet:t}={})=>{const e=ti(vft,t);return` +`,"getStyles"),oyt=syt,lyt=h6.parse.bind(h6);h6.parse=t=>lyt(ayt(t));var cyt={styles:oyt,parser:h6,db:eyt,renderer:iyt};const uyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:cyt},Symbol.toStringTag,{value:"Module"}));var hyt=jr.packet,_xe=(q2=class{constructor(){this.packet=[],this.setAccTitle=qn,this.getAccTitle=Qn,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getAccDescription=ei,this.setAccDescription=Jn}getConfig(){const e=ri({...hyt,...sr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){zn(),this.packet=[]}},b(q2,"PacketDB"),q2),dyt=1e4,fyt=b((t,e)=>{Cs(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Rxe={parser:{yy:void 0},parse:b(async t=>{var n;const e=await Xo("packet",t),r=(n=Rxe.parser)==null?void 0:n.yy;if(!(r instanceof _xe))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");he.debug(e),fyt(e,r)},"parse")},gyt=b((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=Ka(e);m.attr("viewBox",`0 0 ${g} ${p}`),bi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())myt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),myt=b((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),yyt={draw:gyt},vyt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},byt=b(({packet:t}={})=>{const e=ri(vyt,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -2958,7 +2973,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),xft={parser:q1e,get db(){return new G1e},renderer:yft,styles:bft};const Tft=Object.freeze(Object.defineProperty({__proto__:null,diagram:xft},Symbol.toStringTag,{value:"Module"}));var um={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},V1e={axes:[],curves:[],options:um},sp=structuredClone(V1e),wft=Fr.radar,Cft=T(()=>ti({...wft,...lr().radar}),"getConfig"),W1e=T(()=>sp.axes,"getAxes"),kft=T(()=>sp.curves,"getCurves"),Eft=T(()=>sp.options,"getOptions"),Sft=T(t=>{sp.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),Aft=T(t=>{sp.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:_ft(e.entries)}))},"setCurves"),_ft=T(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=W1e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),Rft=T(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});sp.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??um.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??um.ticks,max:((i=e.max)==null?void 0:i.value)??um.max,min:((a=e.min)==null?void 0:a.value)??um.min,graticule:((s=e.graticule)==null?void 0:s.value)??um.graticule}},"setOptions"),Lft=T(()=>{Dn(),sp=structuredClone(V1e)},"clear"),sw={getAxes:W1e,getCurves:kft,getOptions:Eft,setAxes:Sft,setCurves:Aft,setOptions:Rft,getConfig:Cft,clear:Lft,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,getAccDescription:Vn,setAccDescription:qn},Ift=T(t=>{Fl(t,sw);const{axes:e,curves:r,options:n}=t;sw.setAxes(e),sw.setCurves(r),sw.setOptions(n)},"populate"),Dft={parse:T(async t=>{const e=await Qo("radar",t);ae.debug(e),Ift(e)},"parse")},Mft=T((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=ms(e),d=Nft(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Oft(d,a,g,o.ticks,o.graticule),$ft(d,a,g,l),U1e(d,a,s,p,f,o.graticule,l),X1e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Nft=T((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return vi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),Oft=T((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),$ft=T((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=H1e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",Y1e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}T(U1e,"drawCurves");function H1e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}T(H1e,"relativeRadius");function Y1e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}T(X1e,"drawLegend");var Pft={draw:Mft},Bft=T((t,e)=>{let r="";for(let n=0;nri({...wyt,...sr().radar}),"getConfig"),Ixe=b(()=>Xp.axes,"getAxes"),Syt=b(()=>Xp.curves,"getCurves"),kyt=b(()=>Xp.options,"getOptions"),Eyt=b(t=>{Xp.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),Ayt=b(t=>{Xp.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:_yt(e.entries)}))},"setCurves"),_yt=b(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Ixe();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),Ryt=b(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Xp.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??n1.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??n1.ticks,max:((i=e.max)==null?void 0:i.value)??n1.max,min:((a=e.min)==null?void 0:a.value)??n1.min,graticule:((s=e.graticule)==null?void 0:s.value)??n1.graticule}},"setOptions"),Lyt=b(()=>{zn(),Xp=structuredClone(Lxe)},"clear"),nC={getAxes:Ixe,getCurves:Syt,getOptions:kyt,setAxes:Eyt,setCurves:Ayt,setOptions:Ryt,getConfig:Cyt,clear:Lyt,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn},Iyt=b(t=>{Cs(t,nC);const{axes:e,curves:r,options:n}=t;nC.setAxes(e),nC.setCurves(r),nC.setOptions(n)},"populate"),Myt={parse:b(async t=>{const e=await Xo("radar",t);he.debug(e),Iyt(e)},"parse")},Dyt=b((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Ka(e),d=Nyt(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Oyt(d,a,g,o.ticks,o.graticule),$yt(d,a,g,l),Mxe(d,a,s,p,f,o.graticule,l),Oxe(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Nyt=b((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return bi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),Oyt=b((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),$yt=b((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function Mxe(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=Dxe(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",Nxe(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}b(Mxe,"drawCurves");function Dxe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}b(Dxe,"relativeRadius");function Nxe(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}b(Oxe,"drawLegend");var Pyt={draw:Dyt},Byt=b((t,e)=>{let r="";for(let n=0;nb==="outlined"?(I.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),Fft=T(t=>{const e=kp(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),zft=T(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=Fft(t);return` + `}return r},"genIndexStyles"),Fyt=b(t=>{const e=Gc(),r=sr(),n=ri(e,r.themeVariables),i=ri(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),zyt=b(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=Fyt(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -2983,8 +2998,6 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0 stroke-width: ${r.axisStrokeWidth}; } .radarAxisLabel { - dominant-baseline: middle; - text-anchor: middle; font-size: ${r.axisLabelFontSize}px; color: ${r.axisColor}; } @@ -2999,13 +3012,13 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${Bft(e,r)} - `},"styles"),Gft={parser:Dft,db:sw,renderer:Pft,styles:zft};const qft=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gft},Symbol.toStringTag,{value:"Module"}));var uP=(function(){var t=T(function(b,w,k,S){for(k=k||{},S=b.length;S--;k[b[S]]=w);return k},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:T(function(w,k,S,C,_,L,O){var D=L.length-1;switch(_){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",L[D-1]),C.setHierarchy(L[D-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",L[D]),typeof L[D].length=="number"?this.$=L[D]:this.$=[L[D]];break;case 13:C.getLogger().debug("Rule: statement #2: ",L[D-1]),this.$=[L[D-1]].concat(L[D]);break;case 14:C.getLogger().debug("Rule: link: ",L[D],w),this.$={edgeTypeStr:L[D],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",L[D-3],L[D-1],L[D]),this.$={edgeTypeStr:L[D],label:L[D-1]};break;case 18:const z=parseInt(L[D]),F=C.generateId();this.$={id:F,type:"space",label:"",width:z,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",L[D-2],L[D-1],L[D]," typestr: ",L[D-1].edgeTypeStr);const A=C.edgeStrToEdgeData(L[D-1].edgeTypeStr),R=C.edgeStrToEdgeStartData(L[D-1].edgeTypeStr),N=C.edgeStrToThickness(L[D-1].edgeTypeStr),M=C.edgeStrToPattern(L[D-1].edgeTypeStr);this.$=[{id:L[D-2].id,label:L[D-2].label,type:L[D-2].type,directions:L[D-2].directions},{id:L[D-2].id+"-"+L[D].id,start:L[D-2].id,end:L[D].id,label:L[D-1].label,type:"edge",thickness:N,pattern:M,directions:L[D].directions,arrowTypeEnd:A,arrowTypeStart:R},{id:L[D].id,label:L[D].label,type:C.typeStr2Type(L[D].typeStr),directions:L[D].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[D-1],L[D]),this.$={id:L[D-1].id,label:L[D-1].label,type:C.typeStr2Type(L[D-1].typeStr),directions:L[D-1].directions,widthInColumns:parseInt(L[D],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",L[D]),this.$={id:L[D].id,label:L[D].label,type:C.typeStr2Type(L[D].typeStr),directions:L[D].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",L[D]),this.$={type:"column-setting",columns:L[D]==="auto"?-1:parseInt(L[D])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",L[D-2],L[D-1]),C.generateId(),this.$={...L[D-2],type:"composite",children:L[D-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",L[D-2],L[D-1],L[D]);const I=C.generateId();this.$={id:I,type:"composite",label:"",children:L[D-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",L[D]),this.$={id:L[D]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[D-1],L[D]),this.$={id:L[D-1],label:L[D].label,typeStr:L[D].typeStr,directions:L[D].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",L[D]),this.$=[L[D]];break;case 32:C.getLogger().debug("Rule: dirList: ",L[D-1],L[D]),this.$=[L[D-1]].concat(L[D]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",L[D-2],L[D-1],L[D]),this.$={typeStr:L[D-2]+L[D],label:L[D-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[D-3],L[D-2]," #3:",L[D-1],L[D]),this.$={typeStr:L[D-3]+L[D],label:L[D-2],directions:L[D-1]};break;case 35:case 36:this.$={type:"classDef",id:L[D-1].trim(),css:L[D].trim()};break;case 37:this.$={type:"applyClass",id:L[D-1].trim(),styleClass:L[D].trim()};break;case 38:this.$={type:"applyStyles",id:L[D-1].trim(),stylesStr:L[D].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:T(function(w,k){if(k.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=k,S}},"parseError"),parse:T(function(w){var k=this,S=[0],C=[],_=[null],L=[],O=this.table,D="",z=0,F=0,A=2,R=1,N=L.slice.call(arguments,1),M=Object.create(this.lexer),I={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(I.yy[$]=this.yy[$]);M.setInput(w,I.yy),I.yy.lexer=M,I.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var P=M.yylloc;L.push(P);var B=M.options&&M.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function q(fe){S.length=S.length-2*fe,_.length=_.length-fe,L.length=L.length-fe}T(q,"popStack");function V(){var fe;return fe=C.pop()||M.lex()||R,typeof fe!="number"&&(fe instanceof Array&&(C=fe,fe=C.pop()),fe=k.symbols_[fe]||fe),fe}T(V,"lex");for(var X,W,ie,K,se={},te,Z,ee,ne;;){if(W=S[S.length-1],this.defaultActions[W]?ie=this.defaultActions[W]:((X===null||typeof X>"u")&&(X=V()),ie=O[W]&&O[W][X]),typeof ie>"u"||!ie.length||!ie[0]){var oe="";ne=[];for(te in O[W])this.terminals_[te]&&te>A&&ne.push("'"+this.terminals_[te]+"'");M.showPosition?oe="Parse error on line "+(z+1)+`: -`+M.showPosition()+` -Expecting `+ne.join(", ")+", got '"+(this.terminals_[X]||X)+"'":oe="Parse error on line "+(z+1)+": Unexpected "+(X==R?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(oe,{text:M.match,token:this.terminals_[X]||X,line:M.yylineno,loc:P,expected:ne})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+X);switch(ie[0]){case 1:S.push(X),_.push(M.yytext),L.push(M.yylloc),S.push(ie[1]),X=null,F=M.yyleng,D=M.yytext,z=M.yylineno,P=M.yylloc;break;case 2:if(Z=this.productions_[ie[1]][1],se.$=_[_.length-Z],se._$={first_line:L[L.length-(Z||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Z||1)].first_column,last_column:L[L.length-1].last_column},B&&(se._$.range=[L[L.length-(Z||1)].range[0],L[L.length-1].range[1]]),K=this.performAction.apply(se,[D,F,z,I.yy,ie[1],_,L].concat(N)),typeof K<"u")return K;Z&&(S=S.slice(0,-1*Z*2),_=_.slice(0,-1*Z),L=L.slice(0,-1*Z)),S.push(this.productions_[ie[1]][0]),_.push(se.$),L.push(se._$),ee=O[S[S.length-2]][S[S.length-1]],S.push(ee);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:T(function(k,S){if(this.yy.parser)this.yy.parser.parseError(k,S);else throw new Error(k)},"parseError"),setInput:T(function(w,k){return this.yy=k||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var k=w.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:T(function(w){var k=w.length,S=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===C.length?this.yylloc.first_column:0)+C[C.length-S.length].length-S[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(w){this.unput(this.match.slice(w))},"less"),pastInput:T(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var w=this.pastInput(),k=new Array(w.length+1).join("-");return w+this.upcomingInput()+` -`+k+"^"},"showPosition"),test_match:T(function(w,k){var S,C,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),C=w[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],S=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var L in _)this[L]=_[L];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,k,S,C;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),L=0;L<_.length;L++)if(S=this._input.match(this.rules[_[L]]),S&&(!k||S[0].length>k[0].length)){if(k=S,C=L,this.options.backtrack_lexer){if(w=this.test_match(S,_[L]),w!==!1)return w;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(w=this.test_match(k,_[C]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var k=this.next();return k||this.lex()},"lex"),begin:T(function(k){this.conditionStack.push(k)},"begin"),popState:T(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:T(function(k){this.begin(k)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(k,S,C,_){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",S.yytext);break;case 4:k.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),k.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:k.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",k.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return k.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return k.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function x(){this.yy={}}return T(x,"Parser"),x.prototype=y,y.Parser=x,new x})();uP.parser=uP;var Vft=uP,tl=new Map,hP=[],dP=new Map,K1e="color",j1e="fill",Wft="bgFill",Z1e=",",Uft=$e(),XS=new Map,fP="",Hft=T(t=>It.sanitizeText(t,Uft),"sanitizeText"),Yft=T(function(t,e=""){let r=XS.get(t);r||(r={id:t,styles:[],textStyles:[]},XS.set(t,r)),e!=null&&e.split(Z1e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(K1e).exec(n)){const s=i.replace(j1e,Wft).replace(K1e,j1e);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),Xft=T(function(t,e=""){const r=tl.get(t);e!=null&&(r.styles=e.split(Z1e))},"addStyle2Node"),Kft=T(function(t,e){t.split(",").forEach(function(r){let n=tl.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},tl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Q1e=T((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&ae.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=Hft(s.label)),s.type==="classDef"){Yft(s.id,s.css);continue}if(s.type==="applyClass"){Kft(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Xft(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(dP.get(s.id)??0)+1;dP.set(s.id,o),s.id=o+"-"+s.id,hP.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=tl.get(s.id);if(o===void 0?tl.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&Q1e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{ae.debug("Clear called"),Dn(),ow={id:"root",type:"composite",children:[],columns:-1},tl=new Map([["root",ow]]),pP=[],XS=new Map,hP=[],dP=new Map,fP=""},"clear");function J1e(t){switch(ae.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ae.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}T(J1e,"typeStr2Type");function eye(t){switch(ae.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}T(eye,"edgeTypeStr2Type");function tye(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}T(tye,"edgeStrToEdgeData");function rye(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}T(rye,"edgeStrToEdgeStartData");function nye(t){return t.includes("==")?"thick":"normal"}T(nye,"edgeStrToThickness");function iye(t){return t.includes(".-")?"dotted":"solid"}T(iye,"edgeStrToPattern");var aye=0,Zft=T(()=>(aye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+aye),"generateId"),Qft=T(t=>{ow.children=t,Q1e(t,ow),pP=ow.children},"setHierarchy"),Jft=T(t=>{const e=tl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),ept=T(()=>[...tl.values()],"getBlocksFlat"),tpt=T(()=>pP||[],"getBlocks"),rpt=T(()=>hP,"getEdges"),npt=T(t=>tl.get(t),"getBlock"),ipt=T(t=>{tl.set(t.id,t)},"setBlock"),apt=T(t=>{fP=t},"setDiagramId"),spt=T(()=>fP,"getDiagramId"),opt=T(()=>ae,"getLogger"),lpt=T(function(){return XS},"getClasses"),cpt={getConfig:T(()=>lr().block,"getConfig"),typeStr2Type:J1e,edgeTypeStr2Type:eye,edgeStrToEdgeData:tye,edgeStrToEdgeStartData:rye,edgeStrToThickness:nye,edgeStrToPattern:iye,getLogger:opt,getBlocksFlat:ept,getBlocks:tpt,getEdges:rpt,setHierarchy:Qft,getBlock:npt,setBlock:ipt,getColumns:Jft,getClasses:lpt,clear:jft,generateId:Zft,setDiagramId:apt,getDiagramId:spt},upt=cpt,gP=T((t,e)=>{const r=w6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),hpt=T(t=>`.label { + ${Byt(e,r)} + `},"styles"),Gyt={parser:Myt,db:nC,renderer:Pyt,styles:zyt};const Wyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gyt},Symbol.toStringTag,{value:"Module"}));var HF=(function(){var t=b(function(x,w,C,k){for(C=C||{},k=x.length;k--;C[x[k]]=w);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:b(function(w,C,k,S,E,L,M){var I=L.length-1;switch(E){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",L[I-1]),S.setHierarchy(L[I-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",L[I]),typeof L[I].length=="number"?this.$=L[I]:this.$=[L[I]];break;case 13:S.getLogger().debug("Rule: statement #2: ",L[I-1]),this.$=[L[I-1]].concat(L[I]);break;case 14:S.getLogger().debug("Rule: link: ",L[I],w),this.$={edgeTypeStr:L[I],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",L[I-3],L[I-1],L[I]),this.$={edgeTypeStr:L[I],label:L[I-1]};break;case 18:const P=parseInt(L[I]),$=S.generateId();this.$={id:$,type:"space",label:"",width:P,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",L[I-2],L[I-1],L[I]," typestr: ",L[I-1].edgeTypeStr);const _=S.edgeStrToEdgeData(L[I-1].edgeTypeStr),R=S.edgeStrToEdgeStartData(L[I-1].edgeTypeStr),O=S.edgeStrToThickness(L[I-1].edgeTypeStr),D=S.edgeStrToPattern(L[I-1].edgeTypeStr);this.$=[{id:L[I-2].id,label:L[I-2].label,type:L[I-2].type,directions:L[I-2].directions},{id:L[I-2].id+"-"+L[I].id,start:L[I-2].id,end:L[I].id,label:L[I-1].label,type:"edge",thickness:O,pattern:D,directions:L[I].directions,arrowTypeEnd:_,arrowTypeStart:R},{id:L[I].id,label:L[I].label,type:S.typeStr2Type(L[I].typeStr),directions:L[I].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[I-1],L[I]),this.$={id:L[I-1].id,label:L[I-1].label,type:S.typeStr2Type(L[I-1].typeStr),directions:L[I-1].directions,widthInColumns:parseInt(L[I],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",L[I]),this.$={id:L[I].id,label:L[I].label,type:S.typeStr2Type(L[I].typeStr),directions:L[I].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",L[I]),this.$={type:"column-setting",columns:L[I]==="auto"?-1:parseInt(L[I])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",L[I-2],L[I-1]),S.generateId(),this.$={...L[I-2],type:"composite",children:L[I-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",L[I-2],L[I-1],L[I]);const N=S.generateId();this.$={id:N,type:"composite",label:"",children:L[I-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",L[I]),this.$={id:L[I]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[I-1],L[I]),this.$={id:L[I-1],label:L[I].label,typeStr:L[I].typeStr,directions:L[I].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",L[I]),this.$=[L[I]];break;case 32:S.getLogger().debug("Rule: dirList: ",L[I-1],L[I]),this.$=[L[I-1]].concat(L[I]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",L[I-2],L[I-1],L[I]),this.$={typeStr:L[I-2]+L[I],label:L[I-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[I-3],L[I-2]," #3:",L[I-1],L[I]),this.$={typeStr:L[I-3]+L[I],label:L[I-2],directions:L[I-1]};break;case 35:case 36:this.$={type:"classDef",id:L[I-1].trim(),css:L[I].trim()};break;case 37:this.$={type:"applyClass",id:L[I-1].trim(),styleClass:L[I].trim()};break;case 38:this.$={type:"applyStyles",id:L[I-1].trim(),stylesStr:L[I].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:b(function(w,C){if(C.recoverable)this.trace(w);else{var k=new Error(w);throw k.hash=C,k}},"parseError"),parse:b(function(w){var C=this,k=[0],S=[],E=[null],L=[],M=this.table,I="",P=0,$=0,_=2,R=1,O=L.slice.call(arguments,1),D=Object.create(this.lexer),N={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(N.yy[B]=this.yy[B]);D.setInput(w,N.yy),N.yy.lexer=D,N.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var F=D.yylloc;L.push(F);var G=D.options&&D.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ae){k.length=k.length-2*ae,E.length=E.length-ae,L.length=L.length-ae}b(z,"popStack");function W(){var ae;return ae=S.pop()||D.lex()||R,typeof ae!="number"&&(ae instanceof Array&&(S=ae,ae=S.pop()),ae=C.symbols_[ae]||ae),ae}b(W,"lex");for(var V,H,te,Y,se={},J,Z,ee,re;;){if(H=k[k.length-1],this.defaultActions[H]?te=this.defaultActions[H]:((V===null||typeof V>"u")&&(V=W()),te=M[H]&&M[H][V]),typeof te>"u"||!te.length||!te[0]){var ge="";re=[];for(J in M[H])this.terminals_[J]&&J>_&&re.push("'"+this.terminals_[J]+"'");D.showPosition?ge="Parse error on line "+(P+1)+`: +`+D.showPosition()+` +Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ge="Parse error on line "+(P+1)+": Unexpected "+(V==R?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ge,{text:D.match,token:this.terminals_[V]||V,line:D.yylineno,loc:F,expected:re})}if(te[0]instanceof Array&&te.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+V);switch(te[0]){case 1:k.push(V),E.push(D.yytext),L.push(D.yylloc),k.push(te[1]),V=null,$=D.yyleng,I=D.yytext,P=D.yylineno,F=D.yylloc;break;case 2:if(Z=this.productions_[te[1]][1],se.$=E[E.length-Z],se._$={first_line:L[L.length-(Z||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Z||1)].first_column,last_column:L[L.length-1].last_column},G&&(se._$.range=[L[L.length-(Z||1)].range[0],L[L.length-1].range[1]]),Y=this.performAction.apply(se,[I,$,P,N.yy,te[1],E,L].concat(O)),typeof Y<"u")return Y;Z&&(k=k.slice(0,-1*Z*2),E=E.slice(0,-1*Z),L=L.slice(0,-1*Z)),k.push(this.productions_[te[1]][0]),E.push(se.$),L.push(se._$),ee=M[k[k.length-2]][k[k.length-1]],k.push(ee);break;case 3:return!0}}return!0},"parse")},v=(function(){var x={EOF:1,parseError:b(function(C,k){if(this.yy.parser)this.yy.parser.parseError(C,k);else throw new Error(C)},"parseError"),setInput:b(function(w,C){return this.yy=C||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:b(function(w){var C=w.length,k=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===S.length?this.yylloc.first_column:0)+S[S.length-k.length].length-k[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(w){this.unput(this.match.slice(w))},"less"),pastInput:b(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+C+"^"},"showPosition"),test_match:b(function(w,C){var k,S,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),S=w[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],k=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var L in E)this[L]=E[L];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,k,S;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),L=0;LC[0].length)){if(C=k,S=L,this.options.backtrack_lexer){if(w=this.test_match(k,E[L]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,E[S]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var C=this.next();return C||this.lex()},"lex"),begin:b(function(C){this.conditionStack.push(C)},"begin"),popState:b(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:b(function(C){this.begin(C)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(C,k,S,E){switch(S){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",k.yytext);break;case 4:C.getLogger().debug("_",k.yytext);break;case 5:return 5;case 6:return k.yytext=-1,28;case 7:return k.yytext=k.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",k.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",k.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",k.yytext),"STR";case 14:return k.yytext=k.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",k.yytext),21;case 15:return k.yytext="1",C.getLogger().debug("COLUMNS (LEX)",k.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",k.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",k.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",k.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",k.yytext),"DIR";case 86:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",k.yytext),"DIR";case 87:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",k.yytext),"DIR";case 88:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",k.yytext),"DIR";case 89:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",k.yytext),"DIR";case 90:return k.yytext=k.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",k.yytext),"DIR";case 91:return k.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",k.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+k.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",k.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",k.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",k.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+k.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",k.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",k.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",k.yytext),k.yytext=k.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return x})();y.lexer=v;function T(){this.yy={}}return b(T,"Parser"),T.prototype=y,y.Parser=T,new T})();HF.parser=HF;var qyt=HF,Ll=new Map,YF=[],XF=new Map,$xe="color",Pxe="fill",Vyt="bgFill",Bxe=",",g6=new Map,jF="",Uyt=b(t=>$t.sanitizeText(t,Ve()),"sanitizeText"),Hyt=b(function(t,e=""){let r=g6.get(t);r||(r={id:t,styles:[],textStyles:[]},g6.set(t,r)),e!=null&&e.split(Bxe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp($xe).exec(n)){const s=i.replace(Pxe,Vyt).replace($xe,Pxe);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),Yyt=b(function(t,e=""){const r=Ll.get(t);e!=null&&(r.styles=e.split(Bxe))},"addStyle2Node"),Xyt=b(function(t,e){t.split(",").forEach(function(r){let n=Ll.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Ll.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Fxe=b((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&he.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=Uyt(s.label)),s.type==="classDef"){Hyt(s.id,s.css);continue}if(s.type==="applyClass"){Xyt(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Yyt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(XF.get(s.id)??0)+1;XF.set(s.id,o),s.id=o+"-"+s.id,YF.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=Ll.get(s.id);if(o===void 0?Ll.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&Fxe(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{he.debug("Clear called"),zn(),iC={id:"root",type:"composite",children:[],columns:-1},Ll=new Map([["root",iC]]),KF=[],g6=new Map,YF=[],XF=new Map,jF=""},"clear");function zxe(t){switch(he.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return he.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}b(zxe,"typeStr2Type");function Gxe(t){switch(he.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}b(Gxe,"edgeTypeStr2Type");function Wxe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}b(Wxe,"edgeStrToEdgeData");function qxe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}b(qxe,"edgeStrToEdgeStartData");function Vxe(t){return t.includes("==")?"thick":"normal"}b(Vxe,"edgeStrToThickness");function Uxe(t){return t.includes(".-")?"dotted":"solid"}b(Uxe,"edgeStrToPattern");var Hxe=0,Kyt=b(()=>(Hxe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Hxe),"generateId"),Zyt=b(t=>{iC.children=t,Fxe(t,iC),KF=iC.children},"setHierarchy"),Qyt=b(t=>{const e=Ll.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Jyt=b(()=>[...Ll.values()],"getBlocksFlat"),evt=b(()=>KF||[],"getBlocks"),tvt=b(()=>YF,"getEdges"),rvt=b(t=>Ll.get(t),"getBlock"),nvt=b(t=>{Ll.set(t.id,t)},"setBlock"),ivt=b(t=>{jF=t},"setDiagramId"),avt=b(()=>jF,"getDiagramId"),svt=b(()=>he,"getLogger"),ovt=b(function(){return g6},"getClasses"),lvt={getConfig:b(()=>sr().block,"getConfig"),typeStr2Type:zxe,edgeTypeStr2Type:Gxe,edgeStrToEdgeData:Wxe,edgeStrToEdgeStartData:qxe,edgeStrToThickness:Vxe,edgeStrToPattern:Uxe,getLogger:svt,getBlocksFlat:Jyt,getBlocks:evt,getEdges:tvt,setHierarchy:Zyt,getBlock:rvt,setBlock:nvt,getColumns:Qyt,getClasses:ovt,clear:jyt,generateId:Kyt,setDiagramId:ivt,getDiagramId:avt},cvt=lvt,ZF=b((t,e)=>{const r=X6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tl(n,i,a,e)},"fade"),uvt=b(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3090,9 +3103,9 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[X]||X)+"'":oe="Parse error } .node .cluster { - // fill: ${gP(t.mainBkg,.5)}; - fill: ${gP(t.clusterBkg,.5)}; - stroke: ${gP(t.clusterBorder,.2)}; + // fill: ${ZF(t.mainBkg,.5)}; + fill: ${ZF(t.clusterBkg,.5)}; + stroke: ${ZF(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } @@ -3127,20 +3140,40 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[X]||X)+"'":oe="Parse error font-size: 18px; fill: ${t.textColor}; } - ${vx()} -`,"getStyles"),dpt=hpt,fpt=T((t,e,r,n)=>{e.forEach(i=>{Cpt[i](t,r,n)})},"insertMarkers"),ppt=T((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),gpt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),mpt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),ypt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),vpt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),bpt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),xpt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Tpt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),wpt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Cpt={extension:ppt,composition:gpt,aggregation:mpt,dependency:ypt,lollipop:vpt,point:bpt,circle:xpt,cross:Tpt,barb:wpt},kpt=fpt,gi=((d2e=(h2e=$e())==null?void 0:h2e.block)==null?void 0:d2e.padding)??8;function mP(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}T(mP,"calculateBlockPosition");var Ept=T(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(ae.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function KS(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,y;ae.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const _ of t.children)KS(_,e);const v=Ept(t);i=v.width,a=v.height,ae.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const _ of t.children)_.size&&(ae.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${i} ${a} ${JSON.stringify(_.size)}`),_.size.width=i*(_.widthInColumns??1)+gi*((_.widthInColumns??1)-1),_.size.height=a,_.size.x=0,_.size.y=0,ae.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${i} maxHeight:${a}`));for(const _ of t.children)KS(_,e,i,a);const x=t.columns??-1;let b=0;for(const _ of t.children)b+=_.widthInColumns??1;let w=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(_>0){const L=(S-_*gi-gi)/_;ae.debug("abc95 (growing to fit) width",t.id,S,(f=t.size)==null?void 0:f.width,L);for(const O of t.children)O.size&&(O.size.width=L)}}t.size={width:S,height:C,x:0,y:0}}ae.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}T(KS,"setBlockSizes");function yP(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b;ae.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(ae.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const w=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,k=t.children.length*w+(t.children.length-1)*gi;ae.debug("widthOfChildren 88",k,"posX");const S=new Map;{let D=0;for(const z of t.children){if(!z.size)continue;const{py:F}=mP(r,D),A=S.get(F)??0;z.size.height>A&&S.set(F,z.size.height);let R=(z==null?void 0:z.widthInColumns)??1;r>0&&(R=Math.min(R,r-D%r)),D+=R}}const C=new Map;{let D=0;const z=[...S.keys()].sort((F,A)=>F-A);for(const F of z)C.set(F,D),D+=(S.get(F)??0)+gi}let _=0;ae.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let L=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-gi,O=0;for(const D of t.children){const z=t;if(!D.size)continue;const{width:F,height:A}=D.size,{px:R,py:N}=mP(r,_);if(N!=O&&(O=N,L=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-gi,ae.debug("New row in layout for block",t.id," and child ",D.id,O)),ae.debug(`abc89 layout blocks (child) id: ${D.id} Pos: ${_} (px, py) ${R},${N} (${(m=z==null?void 0:z.size)==null?void 0:m.x},${(y=z==null?void 0:z.size)==null?void 0:y.y}) parent: ${z.id} width: ${F}${gi}`),z.size){const I=F/2;D.size.x=L+gi+I,ae.debug(`abc91 layout blocks (calc) px, pyid:${D.id} startingPos=X${L} new startingPosX${D.size.x} ${I} padding=${gi} width=${F} halfWidth=${I} => x:${D.size.x} y:${D.size.y} ${D.widthInColumns} (width * (child?.w || 1)) / 2 ${F*((D==null?void 0:D.widthInColumns)??1)/2}`),L=D.size.x+I;const $=C.get(N)??0,P=S.get(N)??A;D.size.y=z.size.y-z.size.height/2+$+P/2+gi,ae.debug(`abc88 layout blocks (calc) px, pyid:${D.id}startingPosX${L}${gi}${I}=>x:${D.size.x}y:${D.size.y}${D.widthInColumns}(width * (child?.w || 1)) / 2${F*((D==null?void 0:D.widthInColumns)??1)/2}`)}D.children&&yP(D);let M=(D==null?void 0:D.widthInColumns)??1;r>0&&(M=Math.min(M,r-_%r)),_+=M,ae.debug("abc88 columnsPos",D,_)}}ae.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(v=t==null?void 0:t.size)==null?void 0:v.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(b=t==null?void 0:t.size)==null?void 0:b.width}`)}T(yP,"layoutBlocks");function vP(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=vP(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}T(vP,"findBounds");function sye(t){const e=t.getBlock("root");if(!e)return;KS(e,t,0,0),yP(e),ae.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=vP(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}T(sye,"layout");var Spt=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=$e(),o=cn(s);return await Ua(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),rl=Spt,Apt=T((t,e,r,n,i)=>{e.arrowTypeStart&&oye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&oye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),_pt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},oye=T((t,e,r,n,i,a)=>{const s=_pt[r];if(!s){ae.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),bP={},Oa={},Rpt=T(async(t,e)=>{const r=$e(),n=cn(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Ua(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=pt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=pt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",ml(u,n)),bP[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",ml(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startLeft=d,lw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",ml(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startRight=d,lw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",ml(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endLeft=d,lw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",ml(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endRight=d,lw(h,e.endLabelRight)}return o},"insertEdgeLabel");function lw(t,e){cn($e())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(lw,"setTerminalWidth");var Lpt=T((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,bP[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=$e(),{subGraphTitleTotalMargin:i}=K2(n);if(t.label){const a=bP[t.id];let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Oa[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Oa[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Oa[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Oa[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Ipt=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Dpt=T((t,e,r)=>{ae.debug(`intersection calc abc89: + ${gT()} +`,"getStyles"),hvt=uvt,dvt=b((t,e,r,n)=>{e.forEach(i=>{wvt[i](t,r,n)})},"insertMarkers"),fvt=b((t,e,r)=>{he.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),pvt=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),gvt=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),mvt=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),yvt=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),vvt=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),bvt=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),xvt=b((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Tvt=b((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),wvt={extension:fvt,composition:pvt,aggregation:gvt,dependency:mvt,lollipop:yvt,point:vvt,circle:bvt,cross:xvt,barb:Tvt},Cvt=dvt;function QF(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}b(QF,"calculateBlockPosition");var Svt=b(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(he.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function m6(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;he.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const L of t.children)m6(L,e,0,0,i);const T=Svt(t);a=T.width,s=T.height,he.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const L of t.children)L.size&&(he.debug(`abc95 Setting size of children of ${t.id} id=${L.id} ${a} ${s} ${JSON.stringify(L.size)}`),L.size.width=a*(L.widthInColumns??1)+i*((L.widthInColumns??1)-1),L.size.height=s,L.size.x=0,L.size.y=0,he.debug(`abc95 updating size of ${t.id} children child:${L.id} maxWidth:${a} maxHeight:${s}`));for(const L of t.children)m6(L,e,a,s,i);const x=t.columns??-1;let w=0;for(const L of t.children)w+=L.widthInColumns??1;let C=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(L>0){const M=(S-L*i-i)/L;he.debug("abc95 (growing to fit) width",t.id,S,(p=t.size)==null?void 0:p.width,M);for(const I of t.children)I.size&&(I.size.width=M)}}t.size={width:S,height:E,x:0,y:0}}he.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}b(m6,"setBlockSizes");function JF(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,x,w;he.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(he.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,k=t.children.length*C+(t.children.length-1)*r;he.debug("widthOfChildren 88",k,"posX");const S=new Map;{let P=0;for(const $ of t.children){if(!$.size)continue;const{py:_}=QF(n,P),R=S.get(_)??0;$.size.height>R&&S.set(_,$.size.height);let O=($==null?void 0:$.widthInColumns)??1;n>0&&(O=Math.min(O,n-P%n)),P+=O}}const E=new Map;{let P=0;const $=[...S.keys()].sort((_,R)=>_-R);for(const _ of $)E.set(_,P),P+=(S.get(_)??0)+r}let L=0;he.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let M=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,I=0;for(const P of t.children){const $=t;if(!P.size)continue;const{width:_,height:R}=P.size,{px:O,py:D}=QF(n,L);if(D!=I&&(I=D,M=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,he.debug("New row in layout for block",t.id," and child ",P.id,I)),he.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${L} (px, py) ${O},${D} (${(y=$==null?void 0:$.size)==null?void 0:y.x},${(v=$==null?void 0:$.size)==null?void 0:v.y}) parent: ${$.id} width: ${_}${r}`),$.size){const B=_/2;P.size.x=M+r+B,he.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${B} padding=${r} width=${_} halfWidth=${B} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${_*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+B;const F=E.get(D)??0,G=S.get(D)??R;P.size.y=$.size.y-$.size.height/2+F+G/2+r,he.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${M}${r}${B}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${_*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&JF(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-L%n)),L+=N,he.debug("abc88 columnsPos",P,L)}}he.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(T=t==null?void 0:t.size)==null?void 0:T.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}b(JF,"layoutBlocks");function ez(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=ez(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}b(ez,"findBounds");function Yxe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Ve())==null?void 0:u.block)==null?void 0:h.padding)??8;m6(e,t,0,0,r),JF(e,t,r),he.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=ez(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}b(Yxe,"layout");var kvt=b(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Ve(),o=An(s);return await Ja(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Il=kvt,Evt=b((t,e,r,n,i)=>{e.arrowTypeStart&&Xxe(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Xxe(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Avt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Xxe=b((t,e,r,n,i,a)=>{const s=Avt[r];if(!s){he.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),tz={},as={},_vt=b(async(t,e)=>{const r=Ve(),n=An(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Ja(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=mt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=mt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Yl(u,n)),tz[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Il(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=mt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Yl(g,n)),as[e.id]||(as[e.id]={}),as[e.id].startLeft=d,aC(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Il(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=mt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Yl(g,n)),as[e.id]||(as[e.id]={}),as[e.id].startRight=d,aC(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Il(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=mt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Yl(g,n)),as[e.id]||(as[e.id]={}),as[e.id].endLeft=d,aC(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Il(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=mt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Yl(g,n)),as[e.id]||(as[e.id]={}),as[e.id].endRight=d,aC(h,e.endLabelRight)}return o},"insertEdgeLabel");function aC(t,e){An(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}b(aC,"setTerminalWidth");var Rvt=b((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,tz[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=M0(n);if(t.label){const a=tz[t.id];let s=t.x,o=t.y;if(r){const l=Er.calcLabelPosition(r);he.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=as[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=as[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=as[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=as[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Er.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Lvt=b((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Ivt=b((t,e,r)=>{he.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Ipt(e,a)&&!i){const s=Dpt(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),Mpt=T(function(t,e,r,n,i,a,s){let o=r.points;ae.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ae.debug("to cluster abc88",n[r.toCluster]),o=lye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ae.debug("from cluster abc88",n[r.fromCluster]),o=lye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=P2;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Fq(r),m=$2().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";($e().flowchart.arrowMarkerAbsolute||$e().state.arrowMarkerAbsolute)&&(x=Mw(!0)),Apt(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Npt=T(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),Opt=T((t,e,r,n)=>{const i=Npt(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function cye(t,e){return t.intersect(e)}T(cye,"intersectNode");var $pt=cye;function uye(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(xP,"sameSign");var Bpt=fye,Fpt=pye;function pye(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,x=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,k=Math.sqrt(b*b+w*w);return x{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),Gpt=zpt,Kn={node:$pt,circle:Ppt,ellipse:hye,polygon:Fpt,rect:Gpt},ia=T(async(t,e,r,n)=>{const i=$e();let a;const s=e.useHtmlLabels||cn(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Ua(l,qr(wc(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await rl(l,qr(wc(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(cn(i)){const p=h.children[0],g=pt(h);await T_(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),oi=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function nl(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(nl,"insertPolygonShape");var qpt=T(async(t,e)=>{e.useHtmlLabels||cn($e())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ia(t,e,"node "+e.classes,!0);ae.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),oi(e,s),e.intersect=function(o){return Kn.rect(e,o)},n},"note"),Vpt=qpt,gye=T(t=>t?" "+t:"","formatClass"),to=T((t,e)=>`${e||"node default"}${gye(t.classes)} ${gye(t.class)}`,"getClassesFromNode"),mye=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ae.info("Question main (Circle)");const l=nl(r,s,s,o);return l.attr("style",e.style),oi(e,l),e.intersect=function(u){return ae.warn("Intersect called"),Kn.polygon(e,o,u)},r},"question"),Wpt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Kn.circle(e,14,s)},r},"choice"),Upt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=nl(r,o,a,l);return u.attr("style",e.style),oi(e,u),e.intersect=function(h){return Kn.polygon(e,l,h)},r},"hexagon"),Hpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=Opt(e.directions,n,e,u),d=nl(r,u,a,h);return d.attr("style",e.style),oi(e,d),e.intersect=function(f){return Kn.polygon(e,h,f)},r},"block_arrow"),Ypt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return nl(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Kn.polygon(e,s,l)},r},"rect_left_inv_arrow"),Xpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"lean_right"),Kpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"lean_left"),jpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"trapezoid"),Zpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"inv_trapezoid"),Qpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"rect_right_inv_arrow"),Jpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return oi(e,u),e.intersect=function(h){const d=Kn.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),e0t=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ia(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Kn.rect(e,h)},r},"rect"),t0t=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ia(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Kn.rect(e,h)},r},"composite"),r0t=T(async(t,e)=>{const{shapeSvg:r}=await ia(t,e,"label",!0);ae.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(jS(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ae.warn(`Unknown node property ${o}`)})}return oi(e,n),e.intersect=function(s){return Kn.rect(e,s)},r},"labelRect");function jS(t,e,r,n){const i=[],a=T(o=>{i.push(o,0)},"addBorder"),s=T(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ae.debug("add top border"),a(r)):s(r),e.includes("r")?(ae.debug("add right border"),a(n)):s(n),e.includes("b")?(ae.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ae.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}T(jS,"applyNodePropertyBorders");var n0t=T(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,ae.info("Label text abc79",l,o,typeof o=="object");const u=await rl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(cn($e())){const m=u.children[0],y=pt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}ae.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await rl(s,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(cn($e())){const m=p.children[0],y=pt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return pt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),pt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return oi(e,s),e.intersect=function(o){return Kn.rect(e,o)},r},"stadium"),a0t=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ia(t,e,to(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("Circle main"),oi(e,a),e.intersect=function(s){return ae.info("Circle intersect",e,n.width/2+i,s),Kn.circle(e,n.width/2+i,s)},r},"circle"),s0t=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ia(t,e,to(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("DoubleCircle main"),oi(e,o),e.intersect=function(u){return ae.info("DoubleCircle intersect",e,n.width/2+i+a,u),Kn.circle(e,n.width/2+i+a,u)},r},"doublecircle"),o0t=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ia(t,e,to(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Kn.polygon(e,s,l)},r},"subroutine"),l0t=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),oi(e,n),e.intersect=function(i){return Kn.circle(e,7,i)},r},"start"),yye=T((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return oi(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Kn.rect(e,o)},n},"forkJoin"),c0t=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),oi(e,i),e.intersect=function(a){return Kn.circle(e,7,a)},r},"end"),u0t=T(async(t,e)=>{var _;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(_=e.classData.annotations)==null?void 0:_[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await rl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(cn($e())){const L=y.children[0],O=pt(y);v=L.getBoundingClientRect(),O.attr("width",v.width),O.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(cn($e())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await rl(f,x,e.labelStyle,!0,!0);pt(b).attr("class","classTitle");let w=b.getBBox();if(cn($e())){const L=b.children[0],O=pt(b);w=L.getBoundingClientRect(),O.attr("width",w.width),O.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const k=[];e.classData.members.forEach(async L=>{const O=L.getDisplayDetails();let D=O.displayText;cn($e())&&(D=D.replace(//g,">"));const z=await rl(f,D,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(cn($e())){const A=z.children[0],R=pt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,k.push(z)}),d+=i;const S=[];if(e.classData.methods.forEach(async L=>{const O=L.getDisplayDetails();let D=O.displayText;cn($e())&&(D=D.replace(//g,">"));const z=await rl(f,D,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(cn($e())){const A=z.children[0],R=pt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,S.push(z)}),d+=i,g){let L=(h-v.width)/2;pt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let C=(h-w.width)/2;return pt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),oi(e,o),e.intersect=function(L){return Kn.rect(e,L)},s},"class_box"),vye={rhombus:mye,composite:t0t,question:mye,rect:e0t,labelRect:r0t,rectWithTitle:n0t,choice:Wpt,circle:a0t,doublecircle:s0t,stadium:i0t,hexagon:Upt,block_arrow:Hpt,rect_left_inv_arrow:Ypt,lean_right:Xpt,lean_left:Kpt,trapezoid:jpt,inv_trapezoid:Zpt,rect_right_inv_arrow:Qpt,cylinder:Jpt,start:l0t,end:c0t,note:Vpt,subroutine:o0t,fork:yye,join:yye,class_box:u0t},ZS={},bye=T(async(t,e,r)=>{let n,i;if(e.link){let a;$e().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await vye[e.shape](n,e,r)}else i=await vye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),ZS[e.id]=n,e.haveCallback&&ZS[e.id].attr("class",ZS[e.id].attr("class")+" clickable"),n},"insertNode"),h0t=T(t=>{const e=ZS[t.id];ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function TP(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=b_((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=lr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}T(TP,"getNodeFromBlock");async function xye(t,e,r){const n=TP(e,r,!1);if(n.type==="group")return;const i=lr(),a=await bye(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}T(xye,"calculateBlockSize");async function Tye(t,e,r){const n=TP(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=lr();await bye(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,h0t(n)}}T(Tye,"insertBlockPositioned");async function QS(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await QS(t,i.children,r,n)}T(QS,"performOperations");async function wye(t,e,r){await QS(t,e,r,xye)}T(wye,"calculateBlockSizes");async function Cye(t,e,r){await QS(t,e,r,Tye)}T(Cye,"insertBlocks");async function kye(t,e,r,n,i){const a=new xs({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;Mpt(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await Rpt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),Lpt({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}T(kye,"insertEdges");var d0t=T(function(t,e){return e.db.getClasses()},"getClasses"),f0t=T(async function(t,e,r,n){const{securityLevel:i,block:a}=lr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`);kpt(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await wye(g,d,s);const m=sye(s);if(await Cye(g,d,s),await kye(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;vi(u,x,b,!!w),ae.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),p0t={draw:f0t,getClasses:d0t},g0t={parser:Vft,db:upt,renderer:p0t,styles:dpt};const m0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:g0t},Symbol.toStringTag,{value:"Module"}));var ac=new II(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),y0t=T(()=>{ac.reset(),Dn()},"clear"),v0t=T(()=>ac.records.stack[0],"getRoot"),b0t=T(()=>ac.records.cnt,"getCount"),x0t=Fr.treeView,T0t=T(()=>ti(x0t,lr().treeView),"getConfig"),w0t=T((t,e)=>{for(;t<=ac.records.stack[ac.records.stack.length-1].level;)ac.records.stack.pop();const r={id:ac.records.cnt++,level:t,name:e,children:[]};ac.records.stack[ac.records.stack.length-1].children.push(r),ac.records.stack.push(r)},"addNode"),C0t={clear:y0t,addNode:w0t,getRoot:v0t,getCount:b0t,getConfig:T0t,getAccTitle:Gn,getAccDescription:Vn,getDiagramTitle:Nn,setAccDescription:qn,setAccTitle:Mn,setDiagramTitle:Wn},wP=C0t,k0t=T(t=>{Fl(t,wP),t.nodes.map(e=>wP.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),E0t={parse:T(async t=>{const e=await Qo("treeView",t);ae.debug(e),k0t(e)},"parse")},S0t=T((t,e,r,n,i)=>{const a=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:o}=a.node().getBBox(),l=s+i.paddingY*2,u=o+i.paddingX*2;a.attr("x",t+i.paddingX),a.attr("y",e+l/2),r.BBox={x:t,y:e,width:u,height:l}},"positionLabel"),Eye=T((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),A0t=T((t,e,r)=>{let n=0,i=0;const a=T((o,l,u,h)=>{const d=h*(u.rowIndent+u.paddingX);S0t(d,n,l,o,u);const{height:f,width:p}=l.BBox;Eye(o,d-u.rowIndent,n+f/2,d,n+f/2,u.lineThickness),i=Math.max(i,d+p),n+=f},"drawNode"),s=T((o,l=0)=>{a(t,o,r,l),o.children.forEach(f=>{s(f,l+1)});const{x:u,y:h,height:d}=o.BBox;if(o.children.length){const{y:f,height:p}=o.children[o.children.length-1].BBox;Eye(t,u+r.paddingX,h+d,u+r.paddingX,f+p/2+r.lineThickness/2,r.lineThickness)}},"processNode");return s(e),{totalHeight:n,totalWidth:i}},"drawTree"),_0t=T((t,e,r,n)=>{ae.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=ms(e),l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=A0t(l,a,s);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),vi(o,u,h,s.useMaxWidth)},"draw"),R0t={draw:_0t},L0t=R0t,I0t={labelFontSize:"16px",labelColor:"black",lineColor:"black"},D0t=T(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n}=ti(I0t,t);return` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{he.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Lvt(e,a)&&!i){const s=Ivt(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),Mvt=b(function(t,e,r,n,i,a,s){let o=r.points;he.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(he.debug("to cluster abc88",n[r.toCluster]),o=jxe(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(he.debug("from cluster abc88",n[r.fromCluster]),o=jxe(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=Mb;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=ZX(r),m=Ib().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&(T=DC(!0)),Evt(v,r,T,s,i);let x={};return l&&(x.updatedPath=o),x.originalPath=r.points,x},"insertEdge"),Dvt=b(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),Nvt=b((t,e,r,n)=>{const i=Dvt(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function Kxe(t,e){return t.intersect(e)}b(Kxe,"intersectNode");var Ovt=Kxe;function Zxe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}b(rz,"sameSign");var Pvt=eTe,Bvt=tTe;function tTe(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),x=m.x-r.x,w=m.y-r.y,C=Math.sqrt(x*x+w*w);return T{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),zvt=Fvt,fi={node:Ovt,circle:$vt,ellipse:Qxe,polygon:Bvt,rect:zvt},ka=b(async(t,e,r,n)=>{const i=Ve();let a;const s=e.useHtmlLabels||An(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Ja(l,Qr(Qc(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Il(l,Qr(Qc(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(An(i)){const p=h.children[0],g=mt(h);await XR(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Ai=b((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Ml(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}b(Ml,"insertPolygonShape");var Gvt=b(async(t,e)=>{e.useHtmlLabels||An(Ve())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ka(t,e,"node "+e.classes,!0);he.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ai(e,s),e.intersect=function(o){return fi.rect(e,o)},n},"note"),Wvt=Gvt,rTe=b(t=>t?" "+t:"","formatClass"),Ao=b((t,e)=>`${e||"node default"}${rTe(t.classes)} ${rTe(t.class)}`,"getClassesFromNode"),nTe=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];he.info("Question main (Circle)");const l=Ml(r,s,s,o);return l.attr("style",e.style),Ai(e,l),e.intersect=function(u){return he.warn("Intersect called"),fi.polygon(e,o,u)},r},"question"),qvt=b((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return fi.circle(e,14,s)},r},"choice"),Vvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Ml(r,o,a,l);return u.attr("style",e.style),Ai(e,u),e.intersect=function(h){return fi.polygon(e,l,h)},r},"hexagon"),Uvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=Nvt(e.directions,n,e,u),d=Ml(r,u,a,h);return d.attr("style",e.style),Ai(e,d),e.intersect=function(f){return fi.polygon(e,h,f)},r},"block_arrow"),Hvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Ml(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return fi.polygon(e,s,l)},r},"rect_left_inv_arrow"),Yvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"lean_right"),Xvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"lean_left"),jvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"trapezoid"),Kvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"inv_trapezoid"),Zvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"rect_right_inv_arrow"),Qvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Ai(e,u),e.intersect=function(h){const d=fi.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),Jvt=b(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ka(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(y6(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return Ai(e,a),e.intersect=function(h){return fi.rect(e,h)},r},"rect"),e2t=b(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ka(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(y6(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return Ai(e,a),e.intersect=function(h){return fi.rect(e,h)},r},"composite"),t2t=b(async(t,e)=>{const{shapeSvg:r}=await ka(t,e,"label",!0);he.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(y6(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{he.warn(`Unknown node property ${o}`)})}return Ai(e,n),e.intersect=function(s){return fi.rect(e,s)},r},"labelRect");function y6(t,e,r,n){const i=[],a=b(o=>{i.push(o,0)},"addBorder"),s=b(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(he.debug("add top border"),a(r)):s(r),e.includes("r")?(he.debug("add right border"),a(n)):s(n),e.includes("b")?(he.debug("add bottom border"),a(r)):s(r),e.includes("l")?(he.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}b(y6,"applyNodePropertyBorders");var r2t=b(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,he.info("Label text abc79",l,o,typeof o=="object");const u=await Il(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(An(Ve())){const m=u.children[0],y=mt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}he.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Il(s,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(An(Ve())){const m=p.children[0],y=mt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return mt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),mt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Ai(e,s),e.intersect=function(o){return fi.rect(e,o)},r},"stadium"),i2t=b(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ka(t,e,Ao(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),he.info("Circle main"),Ai(e,a),e.intersect=function(s){return he.info("Circle intersect",e,n.width/2+i,s),fi.circle(e,n.width/2+i,s)},r},"circle"),a2t=b(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ka(t,e,Ao(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),he.info("DoubleCircle main"),Ai(e,o),e.intersect=function(u){return he.info("DoubleCircle intersect",e,n.width/2+i+a,u),fi.circle(e,n.width/2+i+a,u)},r},"doublecircle"),s2t=b(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ka(t,e,Ao(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=Ml(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return fi.polygon(e,s,l)},r},"subroutine"),o2t=b((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ai(e,n),e.intersect=function(i){return fi.circle(e,7,i)},r},"start"),iTe=b((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Ai(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return fi.rect(e,o)},n},"forkJoin"),l2t=b((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ai(e,i),e.intersect=function(a){return fi.circle(e,7,a)},r},"end"),c2t=b(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await Il(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(An(Ve())){const L=y.children[0],M=mt(y);v=L.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(An(Ve())?T+="<"+e.classData.type+">":T+="<"+e.classData.type+">");const x=await Il(f,T,e.labelStyle,!0,!0);mt(x).attr("class","classTitle");let w=x.getBBox();if(An(Ve())){const L=x.children[0],M=mt(x);w=L.getBoundingClientRect(),M.attr("width",w.width),M.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const C=[];e.classData.members.forEach(async L=>{const M=L.getDisplayDetails();let I=M.displayText;An(Ve())&&(I=I.replace(//g,">"));const P=await Il(f,I,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let $=P.getBBox();if(An(Ve())){const _=P.children[0],R=mt(P);$=_.getBoundingClientRect(),R.attr("width",$.width),R.attr("height",$.height)}$.width>h&&(h=$.width),d+=$.height+n,C.push(P)}),d+=i;const k=[];if(e.classData.methods.forEach(async L=>{const M=L.getDisplayDetails();let I=M.displayText;An(Ve())&&(I=I.replace(//g,">"));const P=await Il(f,I,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let $=P.getBBox();if(An(Ve())){const _=P.children[0],R=mt(P);$=_.getBoundingClientRect(),R.attr("width",$.width),R.attr("height",$.height)}$.width>h&&(h=$.width),d+=$.height+n,k.push(P)}),d+=i,g){let L=(h-v.width)/2;mt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let S=(h-w.width)/2;return mt(x).attr("transform","translate( "+(-1*h/2+S)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(L=>{mt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=L==null?void 0:L.getBBox();p+=((M==null?void 0:M.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(L=>{mt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=L==null?void 0:L.getBBox();p+=((M==null?void 0:M.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Ai(e,o),e.intersect=function(L){return fi.rect(e,L)},s},"class_box"),aTe={rhombus:nTe,composite:e2t,question:nTe,rect:Jvt,labelRect:t2t,rectWithTitle:r2t,choice:qvt,circle:i2t,doublecircle:a2t,stadium:n2t,hexagon:Vvt,block_arrow:Uvt,rect_left_inv_arrow:Hvt,lean_right:Yvt,lean_left:Xvt,trapezoid:jvt,inv_trapezoid:Kvt,rect_right_inv_arrow:Zvt,cylinder:Qvt,start:o2t,end:l2t,note:Wvt,subroutine:s2t,fork:iTe,join:iTe,class_box:c2t},v6={},sTe=b(async(t,e,r)=>{let n,i;if(e.link){let a;Ve().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await aTe[e.shape](n,e,r)}else i=await aTe[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),v6[e.id]=n,e.haveCallback&&v6[e.id].attr("class",v6[e.id].attr("class")+" clickable"),n},"insertNode"),u2t=b(t=>{const e=v6[t.id];he.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function nz(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=HR((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=sr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}b(nz,"getNodeFromBlock");async function oTe(t,e,r){const n=nz(e,r,!1);if(n.type==="group")return;const i=sr(),a=await sTe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}b(oTe,"calculateBlockSize");async function lTe(t,e,r){const n=nz(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=sr();await sTe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,u2t(n)}}b(lTe,"insertBlockPositioned");async function b6(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await b6(t,i.children,r,n)}b(b6,"performOperations");async function cTe(t,e,r){await b6(t,e,r,oTe)}b(cTe,"calculateBlockSizes");async function uTe(t,e,r){await b6(t,e,r,lTe)}b(uTe,"insertBlocks");async function hTe(t,e,r,n,i){const a=new ts({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;Mvt(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await _vt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),Rvt({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}b(hTe,"insertEdges");var h2t=b(function(t,e){return e.db.getClasses()},"getClasses"),d2t=b(async function(t,e,r,n){const{securityLevel:i,block:a}=sr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=mt("#i"+e));const l=mt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):mt(`[id="${e}"]`);Cvt(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await cTe(g,d,s);const m=Yxe(s);if(await uTe(g,d,s),await hTe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,x=y.width+10,{useMaxWidth:w}=a;bi(u,T,x,!!w),he.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),f2t={draw:d2t,getClasses:h2t},p2t={parser:qyt,db:cvt,renderer:f2t,styles:hvt};const g2t=Object.freeze(Object.defineProperty({__proto__:null,diagram:p2t},Symbol.toStringTag,{value:"Module"}));var dTe=/[─━│┃└┗├┣]/,fTe=/[└┗├┣]/,m2t=/[─━]/,pTe=/^[\s│┃]+$/,gTe=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,mTe=/^\s*%%/,y2t=" ";function yTe(t){return t.some(e=>dTe.test(e))}b(yTe,"isBoxDrawingFormat");function vTe(t){for(const e of t){const r=fTe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}b(vTe,"inferSegmentWidth");function bTe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}b(bTe,"remapErrorLines");function xTe(t){const e=t.split(` +`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),v2t=b(()=>{Nc.reset(),zn()},"clear"),b2t=b(()=>Nc.records.stack[0],"getRoot"),x2t=b(()=>Nc.records.cnt,"getCount"),T2t=jr.treeView,w2t=b(()=>ri(T2t,sr().treeView),"getConfig"),C2t=b((t,e,r,n,i,a)=>{for(;t<=Nc.records.stack[Nc.records.stack.length-1].level;)Nc.records.stack.pop();const s={id:Nc.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Nc.records.stack[Nc.records.stack.length-1].children.push(s),Nc.records.stack.push(s)},"addNode"),S2t={clear:v2t,addNode:C2t,getRoot:b2t,getCount:x2t,getConfig:w2t,getAccTitle:Qn,getAccDescription:ei,getDiagramTitle:Vn,setAccDescription:Jn,setAccTitle:qn,setDiagramTitle:ti},iz=S2t,k2t=b(t=>{Cs(t,iz);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Qr(u,sr()):void 0;iz.addNode(r,n,a,s,l,h)}},"populate"),E2t={parse:b(async t=>{const{text:e,lineMap:r}=xTe(t);try{const n=await Xo("treeView",e);he.debug(n),k2t(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=bTe(n.message,r)),n}},"parse")},sC={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function TTe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}b(TTe,"detectIcon");function az(t,e){return t.includes(":")?t:t in sC.icons||!e?`${sC.prefix}:${t}`:`${e}:${t}`}b(az,"qualifyIcon");function sz(t,e){if(t.icon!=="none"){if(t.icon)return az(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=TTe(t.name,e);if(r==="none")return;if(r)return az(r,e.defaultIconPack)}return`${sC.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}b(sz,"getNodeIcon"),ZR([{name:sC.prefix,icons:sC}]);var oz=14,A2t=4,_2t=16,wTe=b((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),R2t=b(async(t,e,r,n)=>{const i=new Set,a=b(l=>{const u=sz(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await Jc(l,{height:oz,width:oz})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",wTe(n,l)).html(u)},"injectIconDefs"),L2t=b((t,e,r,n,i,a)=>{var T;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=oz+A2t,u=sz(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${wTe(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(T=r.cssClass)!=null&&T.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),CTe=b((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),I2t=b((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=b((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=L2t(m,i,f,d,p,n);s.push(y);const{height:v,width:T}=f.BBox;CTe(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+T),i+=v},"drawNode"),l=b((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;CTe(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+_2t;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),M2t=b(async(t,e,r,n)=>{he.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=Ka(e);await R2t(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=I2t(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),bi(o,u,h,s.useMaxWidth)},"draw"),D2t={draw:M2t},N2t=D2t,O2t={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},$2t=b(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=ri(O2t,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; } .treeView-node-line { stroke: ${n}; } - `},"styles"),M0t=D0t,N0t={db:wP,renderer:L0t,parser:E0t,styles:M0t};const O0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:N0t},Symbol.toStringTag,{value:"Module"}));var JS={exports:{}},e6={exports:{}},t6={exports:{}},$0t=t6.exports,Sye;function P0t(){return Sye||(Sye=1,(function(t,e){(function(n,i){t.exports=i()})($0t,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){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 x=v.edges.slice(),b,w=x.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L,O=this.nodes,D=O.length,z=0;zk&&(v=k),xC&&(b=C),w<_&&(w=_)}var A=new d(v,b,x-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=A.x-L,this.right=A.x+A.width+L,this.top=A.y-L,this.bottom=A.y+A.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L=y.length,O=0;Ok&&(v=k),xC&&(b=C),w<_&&(w=_)}var z=new d(v,b,x-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,x=v.length,b=0;b=this.nodes.length){var D=0;x.forEach(function(z){z.owner==y&&D++}),D==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===I&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-M===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):M===I&&(f>h?(u[2]=S,u[3]=C,R=!0):(u[2]=D,u[3]=O,R=!0)),A&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),P=this.getCardinalDirection(M,I,2)):($=this.getCardinalDirection(-N,I,3),P=this.getCardinalDirection(-M,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),P=this.getCardinalDirection(-M,I,3)):($=this.getCardinalDirection(N,I,2),P=this.getCardinalDirection(M,I,4)),!A)switch($){case 1:q=m,B=h+-k/I,u[0]=B,u[1]=q;break;case 2:B=b,q=d+w*I,u[0]=B,u[1]=q;break;case 3:q=x,B=h+k/I,u[0]=B,u[1]=q;break;case 4:B=v,q=d+-w*I,u[0]=B,u[1]=q;break}if(!R)switch(P){case 1:X=C,V=f+-F/I,u[2]=V,u[3]=X;break;case 2:V=D,X=p+z*I,u[2]=V,u[3]=X;break;case 3:X=O,V=f+F/I,u[2]=V,u[3]=X;break;case 4:V=L,X=p+-z*I,u[2]=V,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,k=void 0,S=void 0,C=void 0,_=void 0,L=void 0,O=void 0,D=void 0;return k=g-f,C=d-p,L=p*f-d*g,S=x-y,_=m-v,O=v*y-m*x,D=k*_-S*C,D===0?null:(b=(C*O-_*L)/D,w=(S*L-k*O)/D,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var D=S.getNeighborsList();D.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&_.push(A),x.set(A,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(vt){for(var ut=[];vt-- >0;)ut.push(0);return ut})(Math.min(this.m+1,this.n)),this.U=(function(vt){var ut=function le(At){if(At.length==0)return 0;for(var dt=[],ht=0;ht0;)ut.push(0);return ut})(this.n),u=(function(vt){for(var ut=[];vt-- >0;)ut.push(0);return ut})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;M--)if(this.s[M]!==0){for(var I=M+1;I=0;W--){if((function(vt,ut){return vt&&ut})(W0;){var fe=void 0,Ae=void 0;for(fe=A-2;fe>=-1&&fe!==-1;fe--)if(Math.abs(l[fe])<=oe+ne*(Math.abs(this.s[fe])+Math.abs(this.s[fe+1]))){l[fe]=0;break}if(fe===A-2)Ae=4;else{var Re=void 0;for(Re=A-1;Re>=fe&&Re!==fe;Re--){var Ge=(Re!==A?Math.abs(l[Re]):0)+(Re!==fe+1?Math.abs(l[Re-1]):0);if(Math.abs(this.s[Re])<=oe+ne*Ge){this.s[Re]=0;break}}Re===fe?Ae=3:Re===A-1?Ae=1:(Ae=2,fe=Re)}switch(fe++,Ae){case 1:{var Ce=l[A-2];l[A-2]=0;for(var be=A-2;be>=fe;be--){var Fe=a.hypot(this.s[be],Ce),ye=this.s[be]/Fe,He=Ce/Fe;this.s[be]=Fe,be!==fe&&(Ce=-He*l[be-1],l[be-1]=ye*l[be-1]);for(var xe=0;xe=this.s[fe+1]);){var Et=this.s[fe];if(this.s[fe]=this.s[fe+1],this.s[fe+1]=Et,feMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,k=u(551).DimensionD,S=u(551).Layout,C=u(551).Integer,_=u(551).IGeometry,L=u(551).LGraph,O=u(551).Transform,D=u(551).LinkedList;function z(){h.call(this),this.toBeTiled={},this.constraints={}}z.prototype=Object.create(h.prototype);for(var F in h)z[F]=h[F];z.prototype.newGraphManager=function(){var A=new d(this);return this.graphManager=A,A},z.prototype.newGraph=function(A){return new f(null,this.graphManager,A)},z.prototype.newNode=function(A){return new p(this.graphManager,A)},z.prototype.newEdge=function(A){return new g(null,null,A)},z.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},z.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},z.prototype.layout=function(){var A=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return A&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},z.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(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function($){return R.has($)});this.graphManager.setAllNodesToApplyGravitation(N)}}else{var A=this.getFlatForest();if(A.length>0)this.positionNodesRadially(A);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(M){return R.has(M)});this.graphManager.setAllNodesToApplyGravitation(N),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},z.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%v.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 A=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(I){return A.has(I)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.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()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var N=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(N,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},z.prototype.getPositionsData=function(){for(var A=this.graphManager.getAllNodes(),R={},N=0;N0&&this.updateDisplacements();for(var N=0;N0&&(M.fixedNodeWeight=$)}}if(this.constraints.relativePlacementConstraint){var P=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(te){A.fixedNodesOnHorizontal.add(te),A.fixedNodesOnVertical.add(te)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var q=this.constraints.alignmentConstraint.vertical,N=0;N=2*te.length/3;ne--)Z=Math.floor(Math.random()*(ne+1)),ee=te[ne],te[ne]=te[Z],te[Z]=ee;return te},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(te){if(te.left){var Z=P.has(te.left)?P.get(te.left):te.left,ee=P.has(te.right)?P.get(te.right):te.right;A.nodesInRelativeHorizontal.includes(Z)||(A.nodesInRelativeHorizontal.push(Z),A.nodeToRelativeConstraintMapHorizontal.set(Z,[]),A.dummyToNodeForVerticalAlignment.has(Z)?A.nodeToTempPositionMapHorizontal.set(Z,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(Z,A.idToNodeMap.get(Z).getCenterX())),A.nodesInRelativeHorizontal.includes(ee)||(A.nodesInRelativeHorizontal.push(ee),A.nodeToRelativeConstraintMapHorizontal.set(ee,[]),A.dummyToNodeForVerticalAlignment.has(ee)?A.nodeToTempPositionMapHorizontal.set(ee,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(ee,A.idToNodeMap.get(ee).getCenterX())),A.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:te.gap}),A.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:te.gap})}else{var ne=B.has(te.top)?B.get(te.top):te.top,oe=B.has(te.bottom)?B.get(te.bottom):te.bottom;A.nodesInRelativeVertical.includes(ne)||(A.nodesInRelativeVertical.push(ne),A.nodeToRelativeConstraintMapVertical.set(ne,[]),A.dummyToNodeForHorizontalAlignment.has(ne)?A.nodeToTempPositionMapVertical.set(ne,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(ne)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(ne,A.idToNodeMap.get(ne).getCenterY())),A.nodesInRelativeVertical.includes(oe)||(A.nodesInRelativeVertical.push(oe),A.nodeToRelativeConstraintMapVertical.set(oe,[]),A.dummyToNodeForHorizontalAlignment.has(oe)?A.nodeToTempPositionMapVertical.set(oe,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(oe)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(oe,A.idToNodeMap.get(oe).getCenterY())),A.nodeToRelativeConstraintMapVertical.get(ne).push({bottom:oe,gap:te.gap}),A.nodeToRelativeConstraintMapVertical.get(oe).push({top:ne,gap:te.gap})}});else{var X=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(te){if(te.left){var Z=P.has(te.left)?P.get(te.left):te.left,ee=P.has(te.right)?P.get(te.right):te.right;X.has(Z)?X.get(Z).push(ee):X.set(Z,[ee]),X.has(ee)?X.get(ee).push(Z):X.set(ee,[Z])}else{var ne=B.has(te.top)?B.get(te.top):te.top,oe=B.has(te.bottom)?B.get(te.bottom):te.bottom;W.has(ne)?W.get(ne).push(oe):W.set(ne,[oe]),W.has(oe)?W.get(oe).push(ne):W.set(oe,[ne])}});var ie=function(Z,ee){var ne=[],oe=[],fe=new D,Ae=new Set,Re=0;return Z.forEach(function(Ge,Ce){if(!Ae.has(Ce)){ne[Re]=[],oe[Re]=!1;var be=Ce;for(fe.push(be),Ae.add(be),ne[Re].push(be);fe.length!=0;){be=fe.shift(),ee.has(be)&&(oe[Re]=!0);var Fe=Z.get(be);Fe.forEach(function(ye){Ae.has(ye)||(fe.push(ye),Ae.add(ye),ne[Re].push(ye))})}Re++}}),{components:ne,isFixed:oe}},K=ie(X,A.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var se=ie(W,A.fixedNodesOnVertical);this.componentsOnVertical=se.components,this.fixedComponentsOnVertical=se.isFixed}}},z.prototype.updateDisplacements=function(){var A=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(se){var te=A.idToNodeMap.get(se.nodeId);te.displacementX=0,te.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,N=0;N1){var B;for(B=0;BM&&(M=Math.floor(P.y)),$=Math.floor(P.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(x.WORLD_CENTER_X-P.x/2,x.WORLD_CENTER_Y-P.y/2))},z.radialLayout=function(A,R,N){var M=Math.max(this.maxDiagonalInTree(A),m.DEFAULT_RADIAL_SEPARATION);z.branchRadialLayout(R,null,0,359,0,M);var I=L.calculateBounds(A),$=new O;$.setDeviceOrgX(I.getMinX()),$.setDeviceOrgY(I.getMinY()),$.setWorldOrgX(N.x),$.setWorldOrgY(N.y);for(var P=0;P1;){var ee=Z[0];Z.splice(0,1);var ne=W.indexOf(ee);ne>=0&&W.splice(ne,1),se--,ie--}R!=null?te=(W.indexOf(Z[0])+1)%se:te=0;for(var oe=Math.abs(M-N)/ie,fe=te;K!=ie;fe=++fe%se){var Ae=W[fe].getOtherEnd(A);if(Ae!=R){var Re=(N+K*oe)%360,Ge=(Re+oe)%360;z.branchRadialLayout(Ae,A,Re,Ge,I+$,$),K++}}},z.maxDiagonalInTree=function(A){for(var R=C.MIN_VALUE,N=0;NR&&(R=I)}return R},z.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},z.prototype.groupZeroDegreeMembers=function(){var A=this,R={};this.memberGroups={},this.idToDummyNode={};for(var N=[],M=this.graphManager.getAllNodes(),I=0;I"u"&&(R[B]=[]),R[B]=R[B].concat($)}Object.keys(R).forEach(function(q){if(R[q].length>1){var V="DummyCompound_"+q;A.memberGroups[V]=R[q];var X=R[q][0].getParent(),W=new p(A.graphManager);W.id=V,W.paddingLeft=X.paddingLeft||0,W.paddingRight=X.paddingRight||0,W.paddingBottom=X.paddingBottom||0,W.paddingTop=X.paddingTop||0,A.idToDummyNode[V]=W;var ie=A.getGraphManager().add(A.newGraph(),W),K=X.getChild();K.add(W);for(var se=0;seI?(M.rect.x-=(M.labelWidth-I)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-I)/2):M.labelPosHorizontal=="right"&&M.setWidth(I+M.labelWidth)),M.labelHeight&&(M.labelPosVertical=="top"?(M.rect.y-=M.labelHeight,M.setHeight($+M.labelHeight),M.labelMarginTop=M.labelHeight):M.labelPosVertical=="center"&&M.labelHeight>$?(M.rect.y-=(M.labelHeight-$)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-$)/2):M.labelPosVertical=="bottom"&&M.setHeight($+M.labelHeight))}})},z.prototype.repopulateCompounds=function(){for(var A=this.compoundOrder.length-1;A>=0;A--){var R=this.compoundOrder[A],N=R.id,M=R.paddingLeft,I=R.paddingTop,$=R.labelMarginLeft,P=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[N],R.rect.x,R.rect.y,M,I,$,P)}},z.prototype.repopulateZeroDegreeMembers=function(){var A=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(N){var M=A.idToDummyNode[N],I=M.paddingLeft,$=M.paddingTop,P=M.labelMarginLeft,B=M.labelMarginTop;A.adjustLocations(R[N],M.rect.x,M.rect.y,I,$,P,B)})},z.prototype.getToBeTiled=function(A){var R=A.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var N=A.getChild();if(N==null)return this.toBeTiled[R]=!1,!1;for(var M=N.getNodes(),I=0;I0)return this.toBeTiled[R]=!1,!1;if($.getChild()==null){this.toBeTiled[$.id]=!1;continue}if(!this.getToBeTiled($))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},z.prototype.getNodeDegree=function(A){A.id;for(var R=A.getEdges(),N=0,M=0;MX&&(X=ie.rect.height)}N+=X+A.verticalPadding}},z.prototype.tileCompoundMembers=function(A,R){var N=this;this.tiledMemberPack=[],Object.keys(A).forEach(function(M){var I=R[M];if(N.tiledMemberPack[M]=N.tileNodes(A[M],I.paddingLeft+I.paddingRight),I.rect.width=N.tiledMemberPack[M].width,I.rect.height=N.tiledMemberPack[M].height,I.setCenter(N.tiledMemberPack[M].centerX,N.tiledMemberPack[M].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var $=I.rect.width,P=I.rect.height;I.labelWidth&&(I.labelPosHorizontal=="left"?(I.rect.x-=I.labelWidth,I.setWidth($+I.labelWidth),I.labelMarginLeft=I.labelWidth):I.labelPosHorizontal=="center"&&I.labelWidth>$?(I.rect.x-=(I.labelWidth-$)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-$)/2):I.labelPosHorizontal=="right"&&I.setWidth($+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(P+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>P?(I.rect.y-=(I.labelHeight-P)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-P)/2):I.labelPosVertical=="bottom"&&I.setHeight(P+I.labelHeight))}})},z.prototype.tileNodes=function(A,R){var N=this.tileNodesByFavoringDim(A,R,!0),M=this.tileNodesByFavoringDim(A,R,!1),I=this.getOrgRatio(N),$=this.getOrgRatio(M),P;return $B&&(B=se.getWidth())});var q=$/I,V=P/I,X=Math.pow(N-M,2)+4*(q+M)*(V+N)*I,W=(M-N+Math.sqrt(X))/(2*(q+M)),ie;R?(ie=Math.ceil(W),ie==W&&ie++):ie=Math.floor(W);var K=ie*(q+M)-M;return B>K&&(K=B),K+=M*2,K},z.prototype.tileNodesByFavoringDim=function(A,R,N){var M=m.TILING_PADDING_VERTICAL,I=m.TILING_PADDING_HORIZONTAL,$=m.TILING_COMPARE_BY,P={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:M,horizontalPadding:I,centerX:0,centerY:0};$&&(P.idealRowWidth=this.calcIdealRowWidth(A,N));var B=function(te){return te.rect.width*te.rect.height},q=function(te,Z){return B(Z)-B(te)};A.sort(function(se,te){var Z=q;return P.idealRowWidth?(Z=$,Z(se.id,te.id)):Z(se,te)});for(var V=0,X=0,W=0;W0&&(P+=A.horizontalPadding),A.rowWidth[N]=P,A.width0&&(B+=A.verticalPadding);var q=0;B>A.rowHeight[N]&&(q=A.rowHeight[N],A.rowHeight[N]=B,q=A.rowHeight[N]-q),A.height+=q,A.rows[N].push(R)},z.prototype.getShortestRowIndex=function(A){for(var R=-1,N=Number.MAX_VALUE,M=0;MN&&(R=M,N=A.rowWidth[M]);return R},z.prototype.canAddHorizontal=function(A,R,N){if(A.idealRowWidth){var M=A.rows.length-1,I=A.rowWidth[M];return I+R+A.horizontalPadding<=A.idealRowWidth}var $=this.getShortestRowIndex(A);if($<0)return!0;var P=A.rowWidth[$];if(P+A.horizontalPadding+R<=A.width)return!0;var B=0;A.rowHeight[$]0&&(B=N+A.verticalPadding-A.rowHeight[$]);var q;A.width-P>=R+A.horizontalPadding?q=(A.height+B)/(P+R+A.horizontalPadding):q=(A.height+B)/A.width,B=N+A.verticalPadding;var V;return A.width$&&R!=N){M.splice(-1,1),A.rows[N].push(I),A.rowWidth[R]=A.rowWidth[R]-$,A.rowWidth[N]=A.rowWidth[N]+$,A.width=A.rowWidth[instance.getLongestRowIndex(A)];for(var P=Number.MIN_VALUE,B=0;BP&&(P=M[B].height);R>0&&(P+=A.verticalPadding);var q=A.rowHeight[R]+A.rowHeight[N];A.rowHeight[R]=P,A.rowHeight[N]0)for(var K=I;K<=$;K++)ie[0]+=this.grid[K][P-1].length+this.grid[K][P].length-1;if($0)for(var K=P;K<=B;K++)ie[3]+=this.grid[I-1][K].length+this.grid[I][K].length-1;for(var se=C.MAX_VALUE,te,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(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*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var Et=0;we.forEach(function(ot){pe=="horizontal"?(qe.set(ot,b.has(ot)?w[b.get(ot)]:Pe.get(ot)),Et+=qe.get(ot)):(qe.set(ot,b.has(ot)?k[b.get(ot)]:Pe.get(ot)),Et+=qe.get(ot))}),Et=Et/we.length,ct.forEach(function(ot){re.has(ot)||qe.set(ot,Et)})}else{var yt=0;ct.forEach(function(ot){pe=="horizontal"?yt+=b.has(ot)?w[b.get(ot)]:Pe.get(ot):yt+=b.has(ot)?k[b.get(ot)]:Pe.get(ot)}),yt=yt/ct.length,ct.forEach(function(ot){qe.set(ot,yt)})}});for(var De=function(){var we=Ke.shift(),Et=j.get(we);Et.forEach(function(yt){if(qe.get(yt.id)ot&&(ot=St),NrDt&&(Dt=Nr)}}catch(xr){ut=!0,le=xr}finally{try{!vt&&At.return&&At.return()}finally{if(ut)throw le}}var me=(Et+ot)/2-(yt+Dt)/2,et=!0,lt=!1,Rt=void 0;try{for(var Ft=ct[Symbol.iterator](),or;!(et=(or=Ft.next()).done);et=!0){var ir=or.value;qe.set(ir,qe.get(ir)+me)}}catch(xr){lt=!0,Rt=xr}finally{try{!et&&Ft.return&&Ft.return()}finally{if(lt)throw Rt}}})}return qe},F=function(j){var pe=0,re=0,Pe=0,ve=0;if(j.forEach(function(Le){Le.left?w[b.get(Le.left)]-w[b.get(Le.right)]>=0?pe++:re++:k[b.get(Le.top)]-k[b.get(Le.bottom)]>=0?Pe++:ve++}),pe>re&&Pe>ve)for(var Ue=0;Uere)for(var Me=0;Meve)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(ce,j){M[j]=[ce.position.x,ce.position.y],I[j]=[w[b.get(ce.nodeId)],k[b.get(ce.nodeId)]]}),$=!0;else if(v.alignmentConstraint)(function(){var ce=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,pe=function(qe){var Le=new Set;j[qe].forEach(function(it){Le.add(it)});var Ke=new Set([].concat(h(Le)).filter(function(it){return B.has(it)})),De=void 0;Ke.size>0?De=w[b.get(Ke.values().next().value)]:De=D(Le).x,j[qe].forEach(function(it){M[ce]=[De,k[b.get(it)]],I[ce]=[w[b.get(it)],k[b.get(it)]],ce++})},re=0;re0?De=w[b.get(Ke.values().next().value)]:De=D(Le).y,Pe[qe].forEach(function(it){M[ce]=[w[b.get(it)],De],I[ce]=[w[b.get(it)],k[b.get(it)]],ce++})},Ue=0;UeW&&(W=X[K].length,ie=K);if(W0){var xe={x:0,y:0};v.fixedNodeConstraint.forEach(function(ce,j){var pe={x:w[b.get(ce.nodeId)],y:k[b.get(ce.nodeId)]},re=ce.position,Pe=O(re,pe);xe.x+=Pe.x,xe.y+=Pe.y}),xe.x/=v.fixedNodeConstraint.length,xe.y/=v.fixedNodeConstraint.length,w.forEach(function(ce,j){w[j]+=xe.x}),k.forEach(function(ce,j){k[j]+=xe.y}),v.fixedNodeConstraint.forEach(function(ce){w[b.get(ce.nodeId)]=ce.position.x,k[b.get(ce.nodeId)]=ce.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ve=v.alignmentConstraint.vertical,Je=function(j){var pe=new Set;Ve[j].forEach(function(ve){pe.add(ve)});var re=new Set([].concat(h(pe)).filter(function(ve){return B.has(ve)})),Pe=void 0;re.size>0?Pe=w[b.get(re.values().next().value)]:Pe=D(pe).x,pe.forEach(function(ve){B.has(ve)||(w[b.get(ve)]=Pe)})},nt=0;nt0?Pe=k[b.get(re.values().next().value)]:Pe=D(pe).y,pe.forEach(function(ve){B.has(ve)||(k[b.get(ve)]=Pe)})},Ee=0;Ee{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(e6)),e6.exports}var z0t=JS.exports,_ye;function G0t(){return _ye||(_ye=1,(function(t,e){(function(n,i){t.exports=i(F0t())})(z0t,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,x=!1,b=void 0;try{for(var w=g[Symbol.iterator](),k;!(v=(k=w.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&w.return&&w.return()}finally{if(x)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&$.merge(V)});for(var P=0;P<$.length;P++){var B=$[P];if(w=m.intersection(B.union(B.ancestors())),w!=null&&!x.has(w[0])){var q=w.union(w.descendants());q.forEach(function(V){v.push(V),x.add(V),F.merge(V),m.has(V)&&b.push(V)})}}};v.length!=0;)N();if(F.forEach(function(I){g.intersection(I.connectedEdges()).forEach(function($){F.has($.source())&&F.has($.target())&&F.merge($)})}),b.length==m.length&&(C=!0),!C||C&&_>1){k=b[0],S=k.connectedEdges().length,b.forEach(function(I){I.connectedEdges().length0&&y.set("dummy"+(y.size+1),L),O},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,k=!1,S=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),_;!(w=(_=C.next()).done);w=!0){var L=_.value,O=h(L,2),D=O[0],z=O[1],F=m.cy.getElementById(D);if(F){var A=F.boundingBox(),R=g.xCoords[z]-A.w/2,N=g.xCoords[z]+A.w/2,M=g.yCoords[z]-A.h/2,I=g.yCoords[z]+A.h/2;Rv&&(v=N),Mb&&(b=I)}}}catch(V){k=!0,S=V}finally{try{!w&&C.return&&C.return()}finally{if(k)throw S}}var $=p.x-(v+y)/2,P=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(V){return V+$}),g.yCoords=g.yCoords.map(function(V){return V+P})}else{Object.keys(g).forEach(function(V){var X=g[V],W=X.getRect().x,ie=X.getRect().x+X.getRect().width,K=X.getRect().y,se=X.getRect().y+X.getRect().height;Wv&&(v=ie),Kb&&(b=se)});var B=p.x-(v+y)/2,q=p.y-(b+x)/2;Object.keys(g).forEach(function(V){var X=g[V];X.setCenter(X.getCenterX()+B,X.getCenterY()+q)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,k=void 0,S=void 0,C=void 0,_=void 0,L=p.descendants().not(":parent"),O=L.length,D=0;Dk&&(v=k),xC&&(b=C),w<_&&(w=_)}var F={};return F.topLeftX=v,F.topLeftY=b,F.width=x-v,F.height=w-b,F},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(x){x.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,x=function(w,k){var S=w.cy,C=w.eles,_=C.nodes(),L=C.edges(),O=void 0,D=void 0,z=void 0,F={};w.randomize&&(O=k.nodeIndexes,D=k.xCoords,z=k.yCoords);var A=function(V){return typeof V=="function"},R=function(V,X){return A(V)?V(X):V},N=h.calcParentsWithoutChildren(S,C),M=function q(V,X,W,ie){for(var K=X.length,se=0;se0){var fe=void 0;fe=W.getGraphManager().add(W.newGraph(),ee),q(fe,Z,W,ie)}}},I=function(V,X,W){for(var ie=0,K=0,se=0;se0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=ie/K:A(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},$=function(V,X){X.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=X.fixedNodeConstraint),X.alignmentConstraint&&(V.constraints.alignmentConstraint=X.alignmentConstraint),X.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=X.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var P=new d,B=P.newGraphManager();return M(B.addRoot(),h.getTopMostNodes(_),P,w),I(P,B,L),$(P,w),P.runLayout(),F};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function w(k,S){for(var C=0;C0)if(N){var $=p.getTopMostNodes(C.eles.nodes());if(z=p.connectComponents(_,C.eles,$),z.forEach(function(Ge){var Ce=Ge.boundingBox();F.push({x:Ce.x1+Ce.w/2,y:Ce.y1+Ce.h/2})}),C.randomize&&z.forEach(function(Ge){C.eles=Ge,O.push(m(C))}),C.quality=="default"||C.quality=="proof"){var P=_.collection();if(C.tile){var B=new Map,q=[],V=[],X=0,W={nodeIndexes:B,xCoords:q,yCoords:V},ie=[];if(z.forEach(function(Ge,Ce){Ge.edges().length==0&&(Ge.nodes().forEach(function(be,Fe){P.merge(Ge.nodes()[Fe]),be.isParent()||(W.nodeIndexes.set(Ge.nodes()[Fe].id(),X++),W.xCoords.push(Ge.nodes()[0].position().x),W.yCoords.push(Ge.nodes()[0].position().y))}),ie.push(Ce))}),P.length>1){var K=P.boundingBox();F.push({x:K.x1+K.w/2,y:K.y1+K.h/2}),z.push(P),O.push(W);for(var se=ie.length-1;se>=0;se--)z.splice(ie[se],1),O.splice(ie[se],1),F.splice(ie[se],1)}}z.forEach(function(Ge,Ce){C.eles=Ge,D.push(v(C,O[Ce])),p.relocateComponent(F[Ce],D[Ce],C)})}else z.forEach(function(Ge,Ce){p.relocateComponent(F[Ce],O[Ce],C)});var te=new Set;if(z.length>1){var Z=[],ee=L.filter(function(Ge){return Ge.css("display")=="none"});z.forEach(function(Ge,Ce){var be=void 0;if(C.quality=="draft"&&(be=O[Ce].nodeIndexes),Ge.nodes().not(ee).length>0){var Fe={};Fe.edges=[],Fe.nodes=[];var ye=void 0;Ge.nodes().not(ee).forEach(function(He){if(C.quality=="draft")if(!He.isParent())ye=be.get(He.id()),Fe.nodes.push({x:O[Ce].xCoords[ye]-He.boundingbox().w/2,y:O[Ce].yCoords[ye]-He.boundingbox().h/2,width:He.boundingbox().w,height:He.boundingbox().h});else{var xe=p.calcBoundingBox(He,O[Ce].xCoords,O[Ce].yCoords,be);Fe.nodes.push({x:xe.topLeftX,y:xe.topLeftY,width:xe.width,height:xe.height})}else D[Ce][He.id()]&&Fe.nodes.push({x:D[Ce][He.id()].getLeft(),y:D[Ce][He.id()].getTop(),width:D[Ce][He.id()].getWidth(),height:D[Ce][He.id()].getHeight()})}),Ge.edges().forEach(function(He){var xe=He.source(),Ve=He.target();if(xe.css("display")!="none"&&Ve.css("display")!="none")if(C.quality=="draft"){var Je=be.get(xe.id()),nt=be.get(Ve.id()),tt=[],Ze=[];if(xe.isParent()){var Ee=p.calcBoundingBox(xe,O[Ce].xCoords,O[Ce].yCoords,be);tt.push(Ee.topLeftX+Ee.width/2),tt.push(Ee.topLeftY+Ee.height/2)}else tt.push(O[Ce].xCoords[Je]),tt.push(O[Ce].yCoords[Je]);if(Ve.isParent()){var Se=p.calcBoundingBox(Ve,O[Ce].xCoords,O[Ce].yCoords,be);Ze.push(Se.topLeftX+Se.width/2),Ze.push(Se.topLeftY+Se.height/2)}else Ze.push(O[Ce].xCoords[nt]),Ze.push(O[Ce].yCoords[nt]);Fe.edges.push({startX:tt[0],startY:tt[1],endX:Ze[0],endY:Ze[1]})}else D[Ce][xe.id()]&&D[Ce][Ve.id()]&&Fe.edges.push({startX:D[Ce][xe.id()].getCenterX(),startY:D[Ce][xe.id()].getCenterY(),endX:D[Ce][Ve.id()].getCenterX(),endY:D[Ce][Ve.id()].getCenterY()})}),Fe.nodes.length>0&&(Z.push(Fe),te.add(Ce))}});var ne=R.packComponents(Z,C.randomize).shifts;if(C.quality=="draft")O.forEach(function(Ge,Ce){var be=Ge.xCoords.map(function(ye){return ye+ne[Ce].dx}),Fe=Ge.yCoords.map(function(ye){return ye+ne[Ce].dy});Ge.xCoords=be,Ge.yCoords=Fe});else{var oe=0;te.forEach(function(Ge){Object.keys(D[Ge]).forEach(function(Ce){var be=D[Ge][Ce];be.setCenter(be.getCenterX()+ne[oe].dx,be.getCenterY()+ne[oe].dy)}),oe++})}}}else{var M=C.eles.boundingBox();if(F.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),C.randomize){var I=m(C);O.push(I)}C.quality=="default"||C.quality=="proof"?(D.push(v(C,O[0])),p.relocateComponent(F[0],D[0],C)):p.relocateComponent(F[0],O[0],C)}var fe=function(Ce,be){if(C.quality=="default"||C.quality=="proof"){typeof Ce=="number"&&(Ce=be);var Fe=void 0,ye=void 0,He=Ce.data("id");return D.forEach(function(Ve){He in Ve&&(Fe={x:Ve[He].getRect().getCenterX(),y:Ve[He].getRect().getCenterY()},ye=Ve[He])}),C.nodeDimensionsIncludeLabels&&(ye.labelWidth&&(ye.labelPosHorizontal=="left"?Fe.x+=ye.labelWidth/2:ye.labelPosHorizontal=="right"&&(Fe.x-=ye.labelWidth/2)),ye.labelHeight&&(ye.labelPosVertical=="top"?Fe.y+=ye.labelHeight/2:ye.labelPosVertical=="bottom"&&(Fe.y-=ye.labelHeight/2))),Fe==null&&(Fe={x:Ce.position("x"),y:Ce.position("y")}),{x:Fe.x,y:Fe.y}}else{var xe=void 0;return O.forEach(function(Ve){var Je=Ve.nodeIndexes.get(Ce.id());Je!=null&&(xe={x:Ve.xCoords[Je],y:Ve.yCoords[Je]})}),xe==null&&(xe={x:Ce.position("x"),y:Ce.position("y")}),{x:xe.x,y:xe.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var Ae=p.calcParentsWithoutChildren(_,L),Re=L.filter(function(Ge){return Ge.css("display")=="none"});C.eles=L.not(Re),L.nodes().not(":parent").not(Re).layoutPositions(S,C,fe),Ae.length>0&&Ae.forEach(function(Ge){Ge.position(fe(Ge))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,x=v.nodes(),b=v.nodes(":parent"),w=new Map,k=new Map,S=new Map,C=[],_=[],L=[],O=[],D=[],z=[],F=[],A=[],R=void 0,N=1e8,M=1e-9,I=m.piTol,$=m.samplingType,P=m.nodeSeparation,B=void 0,q=function(){for(var j=0,pe=0,re=!1;pe=ve;){Me=Pe[ve++];for(var Te=C[Me],ct=0;ctKe&&(Ke=D[Et],De=Et)}return De},X=function(j){var pe=void 0;if(j){pe=Math.floor(Math.random()*R);for(var Pe=0;Pe=1)break;Le=qe}for(var it=0;it=1)break;Le=qe}for(var ct=0;ct0&&(pe.isParent()?C[j].push(S.get(pe.id())):C[j].push(pe.id()))})});var Re=function(j){var pe=k.get(j),re=void 0;w.get(j).forEach(function(Pe){y.getElementById(Pe).isParent()?re=S.get(Pe):re=Pe,C[pe].push(re),C[k.get(re)].push(j)})},Ge=!0,Ce=!1,be=void 0;try{for(var Fe=w.keys()[Symbol.iterator](),ye;!(Ge=(ye=Fe.next()).done);Ge=!0){var He=ye.value;Re(He)}}catch(ce){Ce=!0,be=ce}finally{try{!Ge&&Fe.return&&Fe.return()}finally{if(Ce)throw be}}R=k.size;var xe=void 0;if(R>2){B=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(JS)),JS.exports}var q0t=G0t();const V0t=Ns(q0t);var Rye={L:"left",R:"right",T:"top",B:"bottom"},Lye={L:T(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:T(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:T(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:T(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},r6={L:T((t,e)=>t-e+2,"L"),R:T((t,e)=>t-2,"R"),T:T((t,e)=>t-e+2,"T"),B:T((t,e)=>t-2,"B")},W0t=T(function(t){return ps(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Iye=T(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),ps=T(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),$h=T(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),CP=T(function(t,e){const r=ps(t)&&$h(e),n=$h(t)&&ps(e);return r||n},"isArchitectureDirectionXY"),U0t=T(function(t){const e=t[0],r=t[1],n=ps(e)&&$h(r),i=$h(e)&&ps(r);return n||i},"isArchitecturePairXY"),H0t=T(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),kP=T(function(t,e){const r=`${t}${e}`;return H0t(r)?r:void 0},"getArchitectureDirectionPair"),Y0t=T(function([t,e],r){const n=r[0],i=r[1];return ps(n)?$h(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:ps(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),X0t=T(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),K0t=T(function(t,e){return CP(t,e)?"bend":ps(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),j0t=T(function(t){return t.type==="service"},"isArchitectureService"),Z0t=T(function(t){return t.type==="junction"},"isArchitectureJunction"),Dye=T(t=>t.data(),"edgeData"),hm=T(t=>t.data(),"nodeData"),Q0t=Fr.architecture,Mye=(Kv=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Mn,this.getAccTitle=Gn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getAccDescription=Vn,this.setAccDescription=qn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Dn()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(j0t)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(Z0t)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!Iye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Iye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=K0t(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=kP(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=kP(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=T(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=Y0t([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return ti({...Q0t,...lr().architecture})}getConfigField(e){return this.getConfig()[e]}},T(Kv,"ArchitectureDB"),Kv),J0t=T((t,e)=>{Fl(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),Nye={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("architecture",t);ae.debug(e);const r=(n=Nye.parser)==null?void 0:n.yy;if(!(r instanceof Mye))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");J0t(e,r)},"parse")},egt=T(t=>` + .treeView-node-icon { + color: ${i}; + } + .treeView-node-description { + font-size: ${e}; + fill: ${a}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${s}; + stroke: ${o}; + stroke-width: 1; + } + `},"styles"),P2t=$2t,B2t={db:iz,renderer:N2t,parser:E2t,styles:P2t};const F2t=Object.freeze(Object.defineProperty({__proto__:null,diagram:B2t},Symbol.toStringTag,{value:"Module"}));var x6={exports:{}},T6={exports:{}},w6={exports:{}},z2t=w6.exports,STe;function G2t(){return STe||(STe=1,(function(t,e){(function(n,i){t.exports=i()})(z2t,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var x=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){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 T=v.edges.slice(),x,w=T.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(S,1),x.target!=x.source&&x.target.edges.splice(E,1);var k=x.source.owner.getEdges().indexOf(x);if(k==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,x,w,C=this.getNodes(),k=C.length,S=0;ST&&(y=T),v>x&&(v=x)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,C,k,S,E,L,M=this.nodes,I=M.length,P=0;PC&&(v=C),TS&&(x=S),wC&&(v=C),TS&&(x=S),w=this.nodes.length){var I=0;T.forEach(function(P){P.owner==y&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,_=!0):(u[0]=y,u[1]=m,_=!0):O===N&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=x,u[1]=T,_=!0)),-D===N?f>h?(u[2]=L,u[3]=M,R=!0):(u[2]=E,u[3]=S,R=!0):D===N&&(f>h?(u[2]=k,u[3]=S,R=!0):(u[2]=I,u[3]=M,R=!0)),_&&R)return!1;if(h>f?d>p?(B=this.getCardinalDirection(O,N,4),F=this.getCardinalDirection(D,N,2)):(B=this.getCardinalDirection(-O,N,3),F=this.getCardinalDirection(-D,N,1)):d>p?(B=this.getCardinalDirection(-O,N,1),F=this.getCardinalDirection(-D,N,3)):(B=this.getCardinalDirection(O,N,2),F=this.getCardinalDirection(D,N,4)),!_)switch(B){case 1:z=m,G=h+-C/N,u[0]=G,u[1]=z;break;case 2:G=x,z=d+w*N,u[0]=G,u[1]=z;break;case 3:z=T,G=h+C/N,u[0]=G,u[1]=z;break;case 4:G=v,z=d+-w*N,u[0]=G,u[1]=z;break}if(!R)switch(F){case 1:V=S,W=f+-$/N,u[2]=W,u[3]=V;break;case 2:W=I,V=p+P*N,u[2]=W,u[3]=V;break;case 3:V=M,W=f+$/N,u[2]=W,u[3]=V;break;case 4:W=L,V=p+-P*N,u[2]=W,u[3]=V;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,x=void 0,w=void 0,C=void 0,k=void 0,S=void 0,E=void 0,L=void 0,M=void 0,I=void 0;return C=g-f,S=d-p,L=p*f-d*g,k=T-y,E=m-v,M=v*y-m*T,I=C*E-k*S,I===0?null:(x=(S*M-E*L)/I,w=(k*L-C*M)/I,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),x=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:x>=0&&x<=1?[x]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(S[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var L=E.getEdges(),x=0;x-1&&S.splice($,1)}w=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var T=this.edgeToDummyNodes.get(v),x=0;x=0&&y.splice(M,1);var I=k.getNeighborsList();I.forEach(function(_){if(v.indexOf(_)<0){var R=T.get(_),O=R-1;O==1&&E.push(_),T.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(x=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||C>=x[0].length)){for(var k=0;kd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(Ct){for(var dt=[];Ct-- >0;)dt.push(0);return dt})(Math.min(this.m+1,this.n)),this.U=(function(Ct){var dt=function ve(_t){if(_t.length==0)return 0;for(var gt=[],ft=0;ft<_t[0];ft++)gt.push(ve(_t.slice(1)));return gt};return dt(Ct)})([this.m,o]),this.V=(function(Ct){var dt=function ve(_t){if(_t.length==0)return 0;for(var gt=[],ft=0;ft<_t[0];ft++)gt.push(ve(_t.slice(1)));return gt};return dt(Ct)})([this.n,this.n]);for(var l=(function(Ct){for(var dt=[];Ct-- >0;)dt.push(0);return dt})(this.n),u=(function(Ct){for(var dt=[];Ct-- >0;)dt.push(0);return dt})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;D--)if(this.s[D]!==0){for(var N=D+1;N=0;H--){if((function(Ct,dt){return Ct&&dt})(H0;){var ae=void 0,_e=void 0;for(ae=_-2;ae>=-1&&ae!==-1;ae--)if(Math.abs(l[ae])<=ge+re*(Math.abs(this.s[ae])+Math.abs(this.s[ae+1]))){l[ae]=0;break}if(ae===_-2)_e=4;else{var Fe=void 0;for(Fe=_-1;Fe>=ae&&Fe!==ae;Fe--){var qe=(Fe!==_?Math.abs(l[Fe]):0)+(Fe!==ae+1?Math.abs(l[Fe-1]):0);if(Math.abs(this.s[Fe])<=ge+re*qe){this.s[Fe]=0;break}}Fe===ae?_e=3:Fe===_-1?_e=1:(_e=2,ae=Fe)}switch(ae++,_e){case 1:{var ue=l[_-2];l[_-2]=0;for(var de=_-2;de>=ae;de--){var Ce=a.hypot(this.s[de],ue),me=this.s[de]/Ce,$e=ue/Ce;this.s[de]=Ce,de!==ae&&(ue=-$e*l[de-1],l[de-1]=me*l[de-1]);for(var we=0;we=this.s[ae+1]);){var kt=this.s[ae];if(this.s[ae]=this.s[ae+1],this.s[ae+1]=kt,aeMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,x=u(551).Point,w=u(551).PointD,C=u(551).DimensionD,k=u(551).Layout,S=u(551).Integer,E=u(551).IGeometry,L=u(551).LGraph,M=u(551).Transform,I=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var $ in h)P[$]=h[$];P.prototype.newGraphManager=function(){var _=new d(this);return this.graphManager=_,_},P.prototype.newGraph=function(_){return new f(null,this.graphManager,_)},P.prototype.newNode=function(_){return new p(this.graphManager,_)},P.prototype.newEdge=function(_){return new g(null,null,_)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var _=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return _&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.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(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(B){return R.has(B)});this.graphManager.setAllNodesToApplyGravitation(O)}}else{var _=this.getFlatForest();if(_.length>0)this.positionNodesRadially(_);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(D){return R.has(D)});this.graphManager.setAllNodesToApplyGravitation(O),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.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%v.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 _=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(N){return _.has(N)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.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()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var O=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(O,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var _=this.graphManager.getAllNodes(),R={},O=0;O<_.length;O++){var D=_[O].rect,N=_[O].id;R[N]={id:N,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return R},P.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var _=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!_;)_=this.tick();this.graphManager.updateBounds()}},P.prototype.moveNodes=function(){for(var _=this.getAllNodes(),R,O=0;O<_.length;O++)R=_[O],R.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var O=0;O<_.length;O++)R=_[O],R.move()},P.prototype.initConstraintVariables=function(){var _=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var R=this.graphManager.getAllNodes(),O=0;O0&&(D.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var F=new Map,G=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){_.fixedNodesOnHorizontal.add(J),_.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,O=0;O=2*J.length/3;re--)Z=Math.floor(Math.random()*(re+1)),ee=J[re],J[re]=J[Z],J[Z]=ee;return J},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=F.has(J.left)?F.get(J.left):J.left,ee=F.has(J.right)?F.get(J.right):J.right;_.nodesInRelativeHorizontal.includes(Z)||(_.nodesInRelativeHorizontal.push(Z),_.nodeToRelativeConstraintMapHorizontal.set(Z,[]),_.dummyToNodeForVerticalAlignment.has(Z)?_.nodeToTempPositionMapHorizontal.set(Z,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(Z,_.idToNodeMap.get(Z).getCenterX())),_.nodesInRelativeHorizontal.includes(ee)||(_.nodesInRelativeHorizontal.push(ee),_.nodeToRelativeConstraintMapHorizontal.set(ee,[]),_.dummyToNodeForVerticalAlignment.has(ee)?_.nodeToTempPositionMapHorizontal.set(ee,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(ee,_.idToNodeMap.get(ee).getCenterX())),_.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:J.gap}),_.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:J.gap})}else{var re=G.has(J.top)?G.get(J.top):J.top,ge=G.has(J.bottom)?G.get(J.bottom):J.bottom;_.nodesInRelativeVertical.includes(re)||(_.nodesInRelativeVertical.push(re),_.nodeToRelativeConstraintMapVertical.set(re,[]),_.dummyToNodeForHorizontalAlignment.has(re)?_.nodeToTempPositionMapVertical.set(re,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(re)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(re,_.idToNodeMap.get(re).getCenterY())),_.nodesInRelativeVertical.includes(ge)||(_.nodesInRelativeVertical.push(ge),_.nodeToRelativeConstraintMapVertical.set(ge,[]),_.dummyToNodeForHorizontalAlignment.has(ge)?_.nodeToTempPositionMapVertical.set(ge,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(ge)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(ge,_.idToNodeMap.get(ge).getCenterY())),_.nodeToRelativeConstraintMapVertical.get(re).push({bottom:ge,gap:J.gap}),_.nodeToRelativeConstraintMapVertical.get(ge).push({top:re,gap:J.gap})}});else{var V=new Map,H=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=F.has(J.left)?F.get(J.left):J.left,ee=F.has(J.right)?F.get(J.right):J.right;V.has(Z)?V.get(Z).push(ee):V.set(Z,[ee]),V.has(ee)?V.get(ee).push(Z):V.set(ee,[Z])}else{var re=G.has(J.top)?G.get(J.top):J.top,ge=G.has(J.bottom)?G.get(J.bottom):J.bottom;H.has(re)?H.get(re).push(ge):H.set(re,[ge]),H.has(ge)?H.get(ge).push(re):H.set(ge,[re])}});var te=function(Z,ee){var re=[],ge=[],ae=new I,_e=new Set,Fe=0;return Z.forEach(function(qe,ue){if(!_e.has(ue)){re[Fe]=[],ge[Fe]=!1;var de=ue;for(ae.push(de),_e.add(de),re[Fe].push(de);ae.length!=0;){de=ae.shift(),ee.has(de)&&(ge[Fe]=!0);var Ce=Z.get(de);Ce.forEach(function(me){_e.has(me)||(ae.push(me),_e.add(me),re[Fe].push(me))})}Fe++}}),{components:re,isFixed:ge}},Y=te(V,_.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var se=te(H,_.fixedNodesOnVertical);this.componentsOnVertical=se.components,this.fixedComponentsOnVertical=se.isFixed}}},P.prototype.updateDisplacements=function(){var _=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(se){var J=_.idToNodeMap.get(se.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,O=0;O1){var G;for(G=0;GD&&(D=Math.floor(F.y)),B=Math.floor(F.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-F.x/2,T.WORLD_CENTER_Y-F.y/2))},P.radialLayout=function(_,R,O){var D=Math.max(this.maxDiagonalInTree(_),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(R,null,0,359,0,D);var N=L.calculateBounds(_),B=new M;B.setDeviceOrgX(N.getMinX()),B.setDeviceOrgY(N.getMinY()),B.setWorldOrgX(O.x),B.setWorldOrgY(O.y);for(var F=0;F<_.length;F++){var G=_[F];G.transform(B)}var z=new w(N.getMaxX(),N.getMaxY());return B.inverseTransformPoint(z)},P.branchRadialLayout=function(_,R,O,D,N,B){var F=(D-O+1)/2;F<0&&(F+=180);var G=(F+O)%360,z=G*E.TWO_PI/360,W=N*Math.cos(z),V=N*Math.sin(z);_.setCenter(W,V);var H=[];H=H.concat(_.getEdges());var te=H.length;R!=null&&te--;for(var Y=0,se=H.length,J,Z=_.getEdgesBetween(R);Z.length>1;){var ee=Z[0];Z.splice(0,1);var re=H.indexOf(ee);re>=0&&H.splice(re,1),se--,te--}R!=null?J=(H.indexOf(Z[0])+1)%se:J=0;for(var ge=Math.abs(D-O)/te,ae=J;Y!=te;ae=++ae%se){var _e=H[ae].getOtherEnd(_);if(_e!=R){var Fe=(O+Y*ge)%360,qe=(Fe+ge)%360;P.branchRadialLayout(_e,_,Fe,qe,N+B,B),Y++}}},P.maxDiagonalInTree=function(_){for(var R=S.MIN_VALUE,O=0;O<_.length;O++){var D=_[O],N=D.getDiagonal();N>R&&(R=N)}return R},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var _=this,R={};this.memberGroups={},this.idToDummyNode={};for(var O=[],D=this.graphManager.getAllNodes(),N=0;N"u"&&(R[G]=[]),R[G]=R[G].concat(B)}Object.keys(R).forEach(function(z){if(R[z].length>1){var W="DummyCompound_"+z;_.memberGroups[W]=R[z];var V=R[z][0].getParent(),H=new p(_.graphManager);H.id=W,H.paddingLeft=V.paddingLeft||0,H.paddingRight=V.paddingRight||0,H.paddingBottom=V.paddingBottom||0,H.paddingTop=V.paddingTop||0,_.idToDummyNode[W]=H;var te=_.getGraphManager().add(_.newGraph(),H),Y=V.getChild();Y.add(H);for(var se=0;seN?(D.rect.x-=(D.labelWidth-N)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-N)/2):D.labelPosHorizontal=="right"&&D.setWidth(N+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(B+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>B?(D.rect.y-=(D.labelHeight-B)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-B)/2):D.labelPosVertical=="bottom"&&D.setHeight(B+D.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var _=this.compoundOrder.length-1;_>=0;_--){var R=this.compoundOrder[_],O=R.id,D=R.paddingLeft,N=R.paddingTop,B=R.labelMarginLeft,F=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[O],R.rect.x,R.rect.y,D,N,B,F)}},P.prototype.repopulateZeroDegreeMembers=function(){var _=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(O){var D=_.idToDummyNode[O],N=D.paddingLeft,B=D.paddingTop,F=D.labelMarginLeft,G=D.labelMarginTop;_.adjustLocations(R[O],D.rect.x,D.rect.y,N,B,F,G)})},P.prototype.getToBeTiled=function(_){var R=_.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var O=_.getChild();if(O==null)return this.toBeTiled[R]=!1,!1;for(var D=O.getNodes(),N=0;N0)return this.toBeTiled[R]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},P.prototype.getNodeDegree=function(_){_.id;for(var R=_.getEdges(),O=0,D=0;DV&&(V=te.rect.height)}O+=V+_.verticalPadding}},P.prototype.tileCompoundMembers=function(_,R){var O=this;this.tiledMemberPack=[],Object.keys(_).forEach(function(D){var N=R[D];if(O.tiledMemberPack[D]=O.tileNodes(_[D],N.paddingLeft+N.paddingRight),N.rect.width=O.tiledMemberPack[D].width,N.rect.height=O.tiledMemberPack[D].height,N.setCenter(O.tiledMemberPack[D].centerX,O.tiledMemberPack[D].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=N.rect.width,F=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(B+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>B?(N.rect.x-=(N.labelWidth-B)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-B)/2):N.labelPosHorizontal=="right"&&N.setWidth(B+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(F+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>F?(N.rect.y-=(N.labelHeight-F)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-F)/2):N.labelPosVertical=="bottom"&&N.setHeight(F+N.labelHeight))}})},P.prototype.tileNodes=function(_,R){var O=this.tileNodesByFavoringDim(_,R,!0),D=this.tileNodesByFavoringDim(_,R,!1),N=this.getOrgRatio(O),B=this.getOrgRatio(D),F;return BG&&(G=se.getWidth())});var z=B/N,W=F/N,V=Math.pow(O-D,2)+4*(z+D)*(W+O)*N,H=(D-O+Math.sqrt(V))/(2*(z+D)),te;R?(te=Math.ceil(H),te==H&&te++):te=Math.floor(H);var Y=te*(z+D)-D;return G>Y&&(Y=G),Y+=D*2,Y},P.prototype.tileNodesByFavoringDim=function(_,R,O){var D=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:D,horizontalPadding:N,centerX:0,centerY:0};B&&(F.idealRowWidth=this.calcIdealRowWidth(_,O));var G=function(J){return J.rect.width*J.rect.height},z=function(J,Z){return G(Z)-G(J)};_.sort(function(se,J){var Z=z;return F.idealRowWidth?(Z=B,Z(se.id,J.id)):Z(se,J)});for(var W=0,V=0,H=0;H<_.length;H++){var te=_[H];W+=te.getCenterX(),V+=te.getCenterY()}F.centerX=W/_.length,F.centerY=V/_.length;for(var H=0;H<_.length;H++){var te=_[H];if(F.rows.length==0)this.insertNodeToRow(F,te,0,R);else if(this.canAddHorizontal(F,te.rect.width,te.rect.height)){var Y=F.rows.length-1;F.idealRowWidth||(Y=this.getShortestRowIndex(F)),this.insertNodeToRow(F,te,Y,R)}else this.insertNodeToRow(F,te,F.rows.length,R);this.shiftToLastRow(F)}return F},P.prototype.insertNodeToRow=function(_,R,O,D){var N=D;if(O==_.rows.length){var B=[];_.rows.push(B),_.rowWidth.push(N),_.rowHeight.push(0)}var F=_.rowWidth[O]+R.rect.width;_.rows[O].length>0&&(F+=_.horizontalPadding),_.rowWidth[O]=F,_.width0&&(G+=_.verticalPadding);var z=0;G>_.rowHeight[O]&&(z=_.rowHeight[O],_.rowHeight[O]=G,z=_.rowHeight[O]-z),_.height+=z,_.rows[O].push(R)},P.prototype.getShortestRowIndex=function(_){for(var R=-1,O=Number.MAX_VALUE,D=0;D<_.rows.length;D++)_.rowWidth[D]O&&(R=D,O=_.rowWidth[D]);return R},P.prototype.canAddHorizontal=function(_,R,O){if(_.idealRowWidth){var D=_.rows.length-1,N=_.rowWidth[D];return N+R+_.horizontalPadding<=_.idealRowWidth}var B=this.getShortestRowIndex(_);if(B<0)return!0;var F=_.rowWidth[B];if(F+_.horizontalPadding+R<=_.width)return!0;var G=0;_.rowHeight[B]0&&(G=O+_.verticalPadding-_.rowHeight[B]);var z;_.width-F>=R+_.horizontalPadding?z=(_.height+G)/(F+R+_.horizontalPadding):z=(_.height+G)/_.width,G=O+_.verticalPadding;var W;return _.widthB&&R!=O){D.splice(-1,1),_.rows[O].push(N),_.rowWidth[R]=_.rowWidth[R]-B,_.rowWidth[O]=_.rowWidth[O]+B,_.width=_.rowWidth[instance.getLongestRowIndex(_)];for(var F=Number.MIN_VALUE,G=0;GF&&(F=D[G].height);R>0&&(F+=_.verticalPadding);var z=_.rowHeight[R]+_.rowHeight[O];_.rowHeight[R]=F,_.rowHeight[O]0)for(var Y=N;Y<=B;Y++)te[0]+=this.grid[Y][F-1].length+this.grid[Y][F].length-1;if(B0)for(var Y=F;Y<=G;Y++)te[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var se=S.MAX_VALUE,J,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(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*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var kt=0;Re.forEach(function(lt){fe=="horizontal"?(We.set(lt,x.has(lt)?w[x.get(lt)]:Be.get(lt)),kt+=We.get(lt)):(We.set(lt,x.has(lt)?C[x.get(lt)]:Be.get(lt)),kt+=We.get(lt))}),kt=kt/Re.length,pt.forEach(function(lt){j.has(lt)||We.set(lt,kt)})}else{var bt=0;pt.forEach(function(lt){fe=="horizontal"?bt+=x.has(lt)?w[x.get(lt)]:Be.get(lt):bt+=x.has(lt)?C[x.get(lt)]:Be.get(lt)}),bt=bt/pt.length,pt.forEach(function(lt){We.set(lt,bt)})}});for(var Pe=function(){var Re=Ze.shift(),kt=Q.get(Re);kt.forEach(function(bt){if(We.get(bt.id)lt&&(lt=Et),NrNt&&(Nt=Nr)}}catch(Tr){dt=!0,ve=Tr}finally{try{!Ct&&_t.return&&_t.return()}finally{if(dt)throw ve}}var Ae=(kt+lt)/2-(bt+Nt)/2,tt=!0,ct=!1,Mt=void 0;try{for(var Wt=pt[Symbol.iterator](),gr;!(tt=(gr=Wt.next()).done);tt=!0){var lr=gr.value;We.set(lr,We.get(lr)+Ae)}}catch(Tr){ct=!0,Mt=Tr}finally{try{!tt&&Wt.return&&Wt.return()}finally{if(ct)throw Mt}}})}return We},$=function(Q){var fe=0,j=0,Be=0,Se=0;if(Q.forEach(function(Ne){Ne.left?w[x.get(Ne.left)]-w[x.get(Ne.right)]>=0?fe++:j++:C[x.get(Ne.top)]-C[x.get(Ne.bottom)]>=0?Be++:Se++}),fe>j&&Be>Se)for(var He=0;Hej)for(var De=0;DeSe)for(var We=0;We1)v.fixedNodeConstraint.forEach(function(oe,Q){D[Q]=[oe.position.x,oe.position.y],N[Q]=[w[x.get(oe.nodeId)],C[x.get(oe.nodeId)]]}),B=!0;else if(v.alignmentConstraint)(function(){var oe=0;if(v.alignmentConstraint.vertical){for(var Q=v.alignmentConstraint.vertical,fe=function(We){var Ne=new Set;Q[We].forEach(function(nt){Ne.add(nt)});var Ze=new Set([].concat(h(Ne)).filter(function(nt){return G.has(nt)})),Pe=void 0;Ze.size>0?Pe=w[x.get(Ze.values().next().value)]:Pe=I(Ne).x,Q[We].forEach(function(nt){D[oe]=[Pe,C[x.get(nt)]],N[oe]=[w[x.get(nt)],C[x.get(nt)]],oe++})},j=0;j0?Pe=w[x.get(Ze.values().next().value)]:Pe=I(Ne).y,Be[We].forEach(function(nt){D[oe]=[w[x.get(nt)],Pe],N[oe]=[w[x.get(nt)],C[x.get(nt)]],oe++})},He=0;HeH&&(H=V[Y].length,te=Y);if(H0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(oe,Q){var fe={x:w[x.get(oe.nodeId)],y:C[x.get(oe.nodeId)]},j=oe.position,Be=M(j,fe);we.x+=Be.x,we.y+=Be.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,w.forEach(function(oe,Q){w[Q]+=we.x}),C.forEach(function(oe,Q){C[Q]+=we.y}),v.fixedNodeConstraint.forEach(function(oe){w[x.get(oe.nodeId)]=oe.position.x,C[x.get(oe.nodeId)]=oe.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Le=v.alignmentConstraint.vertical,Ye=function(Q){var fe=new Set;Le[Q].forEach(function(Se){fe.add(Se)});var j=new Set([].concat(h(fe)).filter(function(Se){return G.has(Se)})),Be=void 0;j.size>0?Be=w[x.get(j.values().next().value)]:Be=I(fe).x,fe.forEach(function(Se){G.has(Se)||(w[x.get(Se)]=Be)})},ce=0;ce0?Be=C[x.get(j.values().next().value)]:Be=I(fe).y,fe.forEach(function(Se){G.has(Se)||(C[x.get(Se)]=Be)})},le=0;le{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(T6)),T6.exports}var V2t=x6.exports,ETe;function U2t(){return ETe||(ETe=1,(function(t,e){(function(n,i){t.exports=i(q2t())})(V2t,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,x=void 0;try{for(var w=g[Symbol.iterator](),C;!(v=(C=w.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(k){T=!0,x=k}finally{try{!v&&w.return&&w.return()}finally{if(T)throw x}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&B.merge(W)});for(var F=0;F1){C=x[0],k=C.connectedEdges().length,x.forEach(function(N){N.connectedEdges().length0&&y.set("dummy"+(y.size+1),L),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,C=!1,k=void 0;try{for(var S=g.nodeIndexes[Symbol.iterator](),E;!(w=(E=S.next()).done);w=!0){var L=E.value,M=h(L,2),I=M[0],P=M[1],$=m.cy.getElementById(I);if($){var _=$.boundingBox(),R=g.xCoords[P]-_.w/2,O=g.xCoords[P]+_.w/2,D=g.yCoords[P]-_.h/2,N=g.yCoords[P]+_.h/2;Rv&&(v=O),Dx&&(x=N)}}}catch(W){C=!0,k=W}finally{try{!w&&S.return&&S.return()}finally{if(C)throw k}}var B=p.x-(v+y)/2,F=p.y-(x+T)/2;g.xCoords=g.xCoords.map(function(W){return W+B}),g.yCoords=g.yCoords.map(function(W){return W+F})}else{Object.keys(g).forEach(function(W){var V=g[W],H=V.getRect().x,te=V.getRect().x+V.getRect().width,Y=V.getRect().y,se=V.getRect().y+V.getRect().height;Hv&&(v=te),Yx&&(x=se)});var G=p.x-(v+y)/2,z=p.y-(x+T)/2;Object.keys(g).forEach(function(W){var V=g[W];V.setCenter(V.getCenterX()+G,V.getCenterY()+z)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,x=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,C=void 0,k=void 0,S=void 0,E=void 0,L=p.descendants().not(":parent"),M=L.length,I=0;IC&&(v=C),TS&&(x=S),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,C){var k=w.cy,S=w.eles,E=S.nodes(),L=S.edges(),M=void 0,I=void 0,P=void 0,$={};w.randomize&&(M=C.nodeIndexes,I=C.xCoords,P=C.yCoords);var _=function(W){return typeof W=="function"},R=function(W,V){return _(W)?W(V):W},O=h.calcParentsWithoutChildren(k,S),D=function z(W,V,H,te){for(var Y=V.length,se=0;se0){var ae=void 0;ae=H.getGraphManager().add(H.newGraph(),ee),z(ae,Z,H,te)}}},N=function(W,V,H){for(var te=0,Y=0,se=0;se0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=te/Y:_(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},B=function(W,V){V.fixedNodeConstraint&&(W.constraints.fixedNodeConstraint=V.fixedNodeConstraint),V.alignmentConstraint&&(W.constraints.alignmentConstraint=V.alignmentConstraint),V.relativePlacementConstraint&&(W.constraints.relativePlacementConstraint=V.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new d,G=F.newGraphManager();return D(G.addRoot(),h.getTopMostNodes(E),F,w),N(F,G,L),B(F,w),F.runLayout(),$};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(C,k){for(var S=0;S0)if(O){var B=p.getTopMostNodes(S.eles.nodes());if(P=p.connectComponents(E,S.eles,B),P.forEach(function(qe){var ue=qe.boundingBox();$.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2})}),S.randomize&&P.forEach(function(qe){S.eles=qe,M.push(m(S))}),S.quality=="default"||S.quality=="proof"){var F=E.collection();if(S.tile){var G=new Map,z=[],W=[],V=0,H={nodeIndexes:G,xCoords:z,yCoords:W},te=[];if(P.forEach(function(qe,ue){qe.edges().length==0&&(qe.nodes().forEach(function(de,Ce){F.merge(qe.nodes()[Ce]),de.isParent()||(H.nodeIndexes.set(qe.nodes()[Ce].id(),V++),H.xCoords.push(qe.nodes()[0].position().x),H.yCoords.push(qe.nodes()[0].position().y))}),te.push(ue))}),F.length>1){var Y=F.boundingBox();$.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(F),M.push(H);for(var se=te.length-1;se>=0;se--)P.splice(te[se],1),M.splice(te[se],1),$.splice(te[se],1)}}P.forEach(function(qe,ue){S.eles=qe,I.push(v(S,M[ue])),p.relocateComponent($[ue],I[ue],S)})}else P.forEach(function(qe,ue){p.relocateComponent($[ue],M[ue],S)});var J=new Set;if(P.length>1){var Z=[],ee=L.filter(function(qe){return qe.css("display")=="none"});P.forEach(function(qe,ue){var de=void 0;if(S.quality=="draft"&&(de=M[ue].nodeIndexes),qe.nodes().not(ee).length>0){var Ce={};Ce.edges=[],Ce.nodes=[];var me=void 0;qe.nodes().not(ee).forEach(function($e){if(S.quality=="draft")if(!$e.isParent())me=de.get($e.id()),Ce.nodes.push({x:M[ue].xCoords[me]-$e.boundingbox().w/2,y:M[ue].yCoords[me]-$e.boundingbox().h/2,width:$e.boundingbox().w,height:$e.boundingbox().h});else{var we=p.calcBoundingBox($e,M[ue].xCoords,M[ue].yCoords,de);Ce.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else I[ue][$e.id()]&&Ce.nodes.push({x:I[ue][$e.id()].getLeft(),y:I[ue][$e.id()].getTop(),width:I[ue][$e.id()].getWidth(),height:I[ue][$e.id()].getHeight()})}),qe.edges().forEach(function($e){var we=$e.source(),Le=$e.target();if(we.css("display")!="none"&&Le.css("display")!="none")if(S.quality=="draft"){var Ye=de.get(we.id()),ce=de.get(Le.id()),ye=[],ke=[];if(we.isParent()){var le=p.calcBoundingBox(we,M[ue].xCoords,M[ue].yCoords,de);ye.push(le.topLeftX+le.width/2),ye.push(le.topLeftY+le.height/2)}else ye.push(M[ue].xCoords[Ye]),ye.push(M[ue].yCoords[Ye]);if(Le.isParent()){var pe=p.calcBoundingBox(Le,M[ue].xCoords,M[ue].yCoords,de);ke.push(pe.topLeftX+pe.width/2),ke.push(pe.topLeftY+pe.height/2)}else ke.push(M[ue].xCoords[ce]),ke.push(M[ue].yCoords[ce]);Ce.edges.push({startX:ye[0],startY:ye[1],endX:ke[0],endY:ke[1]})}else I[ue][we.id()]&&I[ue][Le.id()]&&Ce.edges.push({startX:I[ue][we.id()].getCenterX(),startY:I[ue][we.id()].getCenterY(),endX:I[ue][Le.id()].getCenterX(),endY:I[ue][Le.id()].getCenterY()})}),Ce.nodes.length>0&&(Z.push(Ce),J.add(ue))}});var re=R.packComponents(Z,S.randomize).shifts;if(S.quality=="draft")M.forEach(function(qe,ue){var de=qe.xCoords.map(function(me){return me+re[ue].dx}),Ce=qe.yCoords.map(function(me){return me+re[ue].dy});qe.xCoords=de,qe.yCoords=Ce});else{var ge=0;J.forEach(function(qe){Object.keys(I[qe]).forEach(function(ue){var de=I[qe][ue];de.setCenter(de.getCenterX()+re[ge].dx,de.getCenterY()+re[ge].dy)}),ge++})}}}else{var D=S.eles.boundingBox();if($.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),S.randomize){var N=m(S);M.push(N)}S.quality=="default"||S.quality=="proof"?(I.push(v(S,M[0])),p.relocateComponent($[0],I[0],S)):p.relocateComponent($[0],M[0],S)}var ae=function(ue,de){if(S.quality=="default"||S.quality=="proof"){typeof ue=="number"&&(ue=de);var Ce=void 0,me=void 0,$e=ue.data("id");return I.forEach(function(Le){$e in Le&&(Ce={x:Le[$e].getRect().getCenterX(),y:Le[$e].getRect().getCenterY()},me=Le[$e])}),S.nodeDimensionsIncludeLabels&&(me.labelWidth&&(me.labelPosHorizontal=="left"?Ce.x+=me.labelWidth/2:me.labelPosHorizontal=="right"&&(Ce.x-=me.labelWidth/2)),me.labelHeight&&(me.labelPosVertical=="top"?Ce.y+=me.labelHeight/2:me.labelPosVertical=="bottom"&&(Ce.y-=me.labelHeight/2))),Ce==null&&(Ce={x:ue.position("x"),y:ue.position("y")}),{x:Ce.x,y:Ce.y}}else{var we=void 0;return M.forEach(function(Le){var Ye=Le.nodeIndexes.get(ue.id());Ye!=null&&(we={x:Le.xCoords[Ye],y:Le.yCoords[Ye]})}),we==null&&(we={x:ue.position("x"),y:ue.position("y")}),{x:we.x,y:we.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var _e=p.calcParentsWithoutChildren(E,L),Fe=L.filter(function(qe){return qe.css("display")=="none"});S.eles=L.not(Fe),L.nodes().not(":parent").not(Fe).layoutPositions(k,S,ae),_e.length>0&&_e.forEach(function(qe){qe.position(ae(qe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=x}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),x=v.nodes(":parent"),w=new Map,C=new Map,k=new Map,S=[],E=[],L=[],M=[],I=[],P=[],$=[],_=[],R=void 0,O=1e8,D=1e-9,N=m.piTol,B=m.samplingType,F=m.nodeSeparation,G=void 0,z=function(){for(var Q=0,fe=0,j=!1;fe=Se;){De=Be[Se++];for(var Ie=S[De],pt=0;ptZe&&(Ze=I[kt],Pe=kt)}return Pe},V=function(Q){var fe=void 0;if(Q){fe=Math.floor(Math.random()*R);for(var Be=0;Be=1)break;Ne=We}for(var nt=0;nt=1)break;Ne=We}for(var pt=0;pt0&&(fe.isParent()?S[Q].push(k.get(fe.id())):S[Q].push(fe.id()))})});var Fe=function(Q){var fe=C.get(Q),j=void 0;w.get(Q).forEach(function(Be){y.getElementById(Be).isParent()?j=k.get(Be):j=Be,S[fe].push(j),S[C.get(j)].push(Q)})},qe=!0,ue=!1,de=void 0;try{for(var Ce=w.keys()[Symbol.iterator](),me;!(qe=(me=Ce.next()).done);qe=!0){var $e=me.value;Fe($e)}}catch(oe){ue=!0,de=oe}finally{try{!qe&&Ce.return&&Ce.return()}finally{if(ue)throw de}}R=C.size;var we=void 0;if(R>2){G=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(x6)),x6.exports}var H2t=U2t();const Y2t=kd(H2t);var ATe={L:"left",R:"right",T:"top",B:"bottom"},_Te={L:b(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:b(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:b(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:b(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},C6={L:b((t,e)=>t-e+2,"L"),R:b((t,e)=>t-2,"R"),T:b((t,e)=>t-e+2,"T"),B:b((t,e)=>t-2,"B")},X2t=b(function(t){return Ps(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),RTe=b(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Ps=b(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),vd=b(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),lz=b(function(t,e){const r=Ps(t)&&vd(e),n=vd(t)&&Ps(e);return r||n},"isArchitectureDirectionXY"),j2t=b(function(t){const e=t[0],r=t[1],n=Ps(e)&&vd(r),i=vd(e)&&Ps(r);return n||i},"isArchitecturePairXY"),K2t=b(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),cz=b(function(t,e){const r=`${t}${e}`;return K2t(r)?r:void 0},"getArchitectureDirectionPair"),Z2t=b(function([t,e],r){const n=r[0],i=r[1];return Ps(n)?vd(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Ps(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Q2t=b(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),J2t=b(function(t,e){return lz(t,e)?"bend":Ps(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),ebt=b(function(t){return t.type==="service"},"isArchitectureService"),tbt=b(function(t){return t.type==="junction"},"isArchitectureJunction"),LTe=b(t=>t.data(),"edgeData"),i1=b(t=>t.data(),"nodeData"),rbt=jr.architecture,ITe=(V2=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qn,this.getAccTitle=Qn,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getAccDescription=ei,this.setAccDescription=Jn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",zn()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(ebt)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(tbt)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!RTe(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!RTe(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds[n]!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=J2t(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=cz(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=cz(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=b(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=Z2t([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return ri({...rbt,...sr().architecture})}getConfigField(e){return this.getConfig()[e]}},b(V2,"ArchitectureDB"),V2),nbt=b((t,e)=>{var r;Cs(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),MTe={parser:{yy:void 0},parse:b(async t=>{var n;const e=await Xo("architecture",t);he.debug(e);const r=(n=MTe.parser)==null?void 0:n.yy;if(!(r instanceof ITe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");nbt(e,r)},"parse")},ibt=b(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3171,19 +3204,19 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[X]||X)+"'":oe="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),tgt=egt,dm=T(t=>`${t}`,"wrapIcon"),cw={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:dm('')},server:{body:dm('')},disk:{body:dm('')},internet:{body:dm('')},cloud:{body:dm('')},unknown:HV,blank:{body:dm("")}}},rgt=T(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var O,D;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:x}=Dye(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:k,y:S}=u[0].midpoint();let{x:C,y:_}=u[0].targetEndpoint();const L=i+4;if(p&&(ps(d)?b+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(ps(m)?C+=m==="L"?-L:L:_+=m==="T"?-L:L+18),!p&&((O=r.getNode(h))==null?void 0:O.type)==="junction"&&(ps(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((D=r.getNode(g))==null?void 0:D.type)==="junction"&&(ps(m)?C+=m==="L"?s:-s:_+=m==="T"?s:-s),u[0]._private.rscratch){const z=t.insert("g");if(z.insert("path").attr("d",`M ${b},${w} L ${k},${S} L${C},${_} `).attr("class","edge").attr("id",`${n}-${Up(h,g,{prefix:"L"})}`),f){const F=ps(d)?r6[d](b,o):b-l,A=$h(d)?r6[d](w,o):w-l;z.insert("polygon").attr("points",Lye[d](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(y){const F=ps(m)?r6[m](C,o):C-l,A=$h(m)?r6[m](_,o):_-l;z.insert("polygon").attr("points",Lye[m](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(x){const F=CP(d,m)?"XY":ps(d)?"X":"Y";let A=0;F==="X"?A=Math.abs(b-C):F==="Y"?A=Math.abs(w-_)/1.5:A=Math.abs(b-C)/2;const R=z.append("g");if(await Ua(R,x,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},$e()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),F==="X")R.attr("transform","translate("+k+", "+S+")");else if(F==="Y")R.attr("transform","translate("+k+", "+S+") rotate(-90)");else if(F==="XY"){const N=kP(d,m);if(N&&U0t(N)){const M=R.node().getBoundingClientRect(),[I,$]=X0t(N);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*$*45})`);const P=R.node().getBoundingClientRect();R.attr("transform",` - translate(${k}, ${S-M.height/2}) - translate(${I*P.width/2}, ${$*P.height/2}) - rotate(${-1*I*$*45}, 0, ${M.height/2}) - `)}}}}}))},"drawEdges"),ngt=T(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=hm(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,x=g;if(h.icon){const b=y.append("g");b.html(`${await Iu(h.icon,{height:a,width:a,fallbackPrefix:cw.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=a,x+=s/2-1-2}if(h.label){const b=y.append("g");await Ua(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},$e()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),igt=T(async function(t,e,r,n){const i=$e();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Ua(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Iu(a.icon,{height:o,width:o,fallbackPrefix:cw.prefix})}`);else if(a.iconText){l.html(`${await Iu("blank",{height:o,width:o,fallbackPrefix:cw.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(qr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),agt=T(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");XV([{name:cw.prefix,icons:cw}]),$l.use(V0t);function Oye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}T(Oye,"addServices");function $ye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}T($ye,"addJunctions");function Pye(t,e){e.nodes().map(r=>{const n=hm(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}T(Pye,"positionNodes");function Bye(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}T(Bye,"addGroups");function Fye(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=CP(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}T(Fye,"addEdges");function zye(t,e,r){const n=T((o,l)=>Object.entries(o).reduce((u,[h,d])=>{var g;let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let m=0;m{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{var g,m,y;const p=((g=t.getNode(h))==null?void 0:g.in)??"default";l[f]??(l[f]={}),(m=l[f])[p]??(m[p]=[]),l[f][p].push(h),u[d]??(u[d]={}),(y=u[d])[p]??(y[p]=[]),u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}T(zye,"getAlignments");function Gye(t,e){const r=[],n=T(a=>`${a[0]},${a[1]}`,"posToStr"),i=T(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),y=s[m];y&&!l[m]&&(o.push(m),r.push({[Rye[p]]:y,[Rye[W0t(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}T(Gye,"getRelativeConstraints");function qye(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=pt("body").append("div").attr("id","cy").attr("style","display:none"),u=$l({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Bye(r,u),Oye(t,u,i),$ye(e,u,i),Fye(n,u);const h=zye(i,a,s),d=Gye(a,i),f=i.getConfigField("iconSize"),p=i.getConfigField("idealEdgeLengthMultiplier")*f,g=.5*f,m=i.getConfigField("edgeElasticity"),y=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(v){const[x,b]=v.connectedNodes(),{parent:w}=hm(x),{parent:k}=hm(b);return w===k?p:g},edgeElasticity(v){const[x,b]=v.connectedNodes(),{parent:w}=hm(x),{parent:k}=hm(b);return w===k?m:.001},alignmentConstraint:h,relativePlacementConstraint:d});y.one("layoutstop",()=>{var x;function v(b,w,k,S){let C,_;const{x:L,y:O}=b,{x:D,y:z}=w;_=(S-O+(L-k)*(O-z)/(L-D))/Math.sqrt(1+Math.pow((O-z)/(L-D),2)),C=Math.sqrt(Math.pow(S-O,2)+Math.pow(k-L,2)-Math.pow(_,2));const F=Math.sqrt(Math.pow(D-L,2)+Math.pow(z-O,2));C=C/F;let A=(D-L)*(S-O)-(z-O)*(k-L);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let R=(D-L)*(k-L)+(z-O)*(S-O);switch(!0){case R>=0:R=1;break;case R<0:R=-1;break}return _=Math.abs(_)*A,C=C*R,{distances:_,weights:C}}T(v,"getSegmentWeights"),u.startBatch();for(const b of Object.values(u.edges()))if((x=b.data)!=null&&x.call(b)){const{x:w,y:k}=b.source().position(),{x:S,y:C}=b.target().position();if(w!==S&&k!==C){const _=b.sourceEndpoint(),L=b.targetEndpoint(),{sourceDir:O}=Dye(b),[D,z]=$h(O)?[_.x,L.y]:[L.x,_.y],{weights:F,distances:A}=v(_,L,D,z);b.style("segment-distances",A),b.style("segment-weights",F)}}u.endBatch(),y.run()}),y.run(),u.ready(v=>{ae.info("Ready",v),o(u)})})}T(qye,"layoutArchitecture");var sgt=T(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=ms(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await igt(i,f,a,e),agt(i,f,s,e);const g=await qye(a,s,o,l,i,u);await rgt(d,g,i,e),await ngt(p,g,i,e),Pye(i,g),Ap(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),ogt={draw:sgt},lgt={parser:Nye,get db(){return new Mye},renderer:ogt,styles:tgt};const cgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:lgt},Symbol.toStringTag,{value:"Module"}));var Vye="position frame",Wye="frame positioned",EP="position relation",Uye="relation positioned",ugt=T(function(t){ae.debug("options str",t)},"setOptions"),hgt=T(function(){return{}},"getOptions"),dgt=T(function(){Hye(),Dn()},"clear");function Hye(){SP={}}T(Hye,"reset");var fgt=Fr.eventmodeling,pgt=T(()=>ti({...fgt,...lr().eventmodeling}),"getConfig"),SP={};function Yye(){let t=ggt;const{ast:e}=SP,r=AP();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=eve(n,e.dataEntities,r);t=i6(t,{$kind:Vye,index:i,frame:n,textProps:a});let s;sve(n)?(ae.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=i6(t,{$kind:EP,index:i,frame:n,sourceFrame:o})})):t=i6(t,{$kind:EP,index:i,frame:n})}),t={...t,sortedSwimlanesArray:_P(t.swimlanes)},t}T(Yye,"getState");function Xye(t){SP.ast=t}T(Xye,"setAst");var nn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function AP(){return nn}T(AP,"getDiagramProps");var ggt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function Kye(t){const e=t.split(".");if(e.length===2)return e[0]}T(Kye,"extractNamespace");function jye(t){const e=t.split(".");return e.length===2?e[1]:t}T(jye,"extractName");function Zye(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}T(Zye,"findSwimlaneByNamespace");function n6(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}T(n6,"findNextAvailableIndex");function Qye(t,e){const r=Kye(t.entityIdentifier),n=Zye(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||nn.labelUiAutomation}:r?{index:n6(e,0,100),label:nn.labelUiAutomationPrefix+r}:{index:0,label:nn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||nn.labelCommandReadModel}:r?{index:n6(e,100,200),label:nn.labelCommandReadModelPrefix+r}:{index:100,label:nn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||nn.labelEvents}:r?{index:n6(e,200,300),label:nn.labelEventsPrefix+r}:{index:200,label:nn.labelEvents}}}T(Qye,"calculateSwimlaneProps");function Jye(t){const{themeVariables:e}=lr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}T(Jye,"calculateEntityVisualProps");function eve(t,e,r){const n=lr(),i=qr(jye(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${X2(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=X2(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ -`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=X2(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
    ")}const u=a!==void 0;u&&(l+=`

    ${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=F4(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ae.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}T(eve,"calculateTextProps");function tve(t,e){const r=e,n=Jye(r.frame),i={width:r.textProps.width+2*nn.boxTextPadding,height:r.textProps.height+2*nn.boxTextPadding};return[{$kind:Wye,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}T(tve,"decidePositionFrame");function rve(t,e,r){return e===void 0?nn.contentStartX:e.index===t.index&&t.r?t.r+nn.boxPadding:r===void 0?nn.contentStartX:r.r-nn.boxOverlap+nn.boxPadding}T(rve,"calculateX");function nve(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}T(nve,"calculateMaxRight");function _P(t){return Object.values(t).sort((e,r)=>e.index-r.index)}T(_P,"sortedSwimlanesArray");function ive(t,e){const r=e,n=Qye(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*nn.swimlaneMinHeight+nn.swimlaneGap,height:nn.swimlaneMinHeight,maxHeight:nn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(nn.boxMinWidth,Math.min(nn.boxMaxWidth,r.dimension.width))+2*nn.boxPadding,height:Math.max(nn.boxMinHeight,Math.min(nn.boxMaxHeight,r.dimension.height))+2*nn.boxPadding},l=rve(i,s,a),u=l+o.width+nn.boxPadding,h=nve(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(nn.swimlaneMinHeight,i.maxHeight)+2*nn.swimlanePadding;const d={x:l,y:nn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=_P(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}T(sve,"hasSourceFrame");function RP(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}T(RP,"findBoxByFrame");function ove(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}T(ove,"findBoxByLineIndex");function lve(t,e){const r=e;if(Bpe(r.frame)||ave(r.index,r.frame))return[];const n=RP(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=RP(t.boxes,r.sourceFrame):i=ove(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:Uye,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}T(lve,"decidePositionRelation");function cve(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}T(cve,"evolveRelationPositioned");var mgt={[Vye]:tve,[EP]:lve},ygt={[Wye]:ive,[Uye]:cve};function uve(t,e){const r=mgt[e.$kind];if(r==null)return[];const n=r(t,e);return ae.debug("decided events",n),n}T(uve,"decide");function hve(t,e){const r=e.reduce((n,i)=>{const a=ygt[i.$kind];return a==null?n:a(n,i)},t);return ae.debug("evolve events",{state:t,newState:r,events:e}),r}T(hve,"evolve");function i6(t,e){const r=uve(t,e);return hve(t,r)}T(i6,"dispatch");var LP={getConfig:pgt,setOptions:ugt,getOptions:hgt,clear:dgt,setAccTitle:Mn,getAccTitle:Gn,getAccDescription:Vn,setAccDescription:qn,setDiagramTitle:Wn,getDiagramTitle:Nn,setAst:Xye,getDiagramProps:AP,getState:Yye},vgt={parse:T(async t=>{const e=await Qo("eventmodeling",t);ae.debug(e),LP.setAst(e),Fl(e,LP)},"parse")},IP=$e(),bgt=IP==null?void 0:IP.eventmodeling;function dve(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}T(dve,"renderD3Box");function fve(t,e){return t>e}T(fve,"dirUpwards");function pve(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=fve(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ae.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}T(pve,"renderD3Relation");function gve(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}T(gve,"renderD3Swimlane");var xgt=T(function(t,e,r,n){if(ae.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!bgt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=$e(),o=pt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(gve(o,u.maxR,l,a)),u.boxes.forEach(dve(o,l)),u.relations.forEach(pve(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),W6(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),Tgt={draw:xgt},wgt=T(t=>"","getStyles"),Cgt=wgt,kgt={parser:vgt,db:LP,renderer:Tgt,styles:Cgt};const Egt=Object.freeze(Object.defineProperty({__proto__:null,diagram:kgt},Symbol.toStringTag,{value:"Module"}));var DP=(function(){var t=T(function(v,x,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=x);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:T(function(x,b,w,k,S,C,_){var L=C.length-1;switch(S){case 6:case 7:return k;case 15:k.addNode(C[L-1].length,C[L].trim());break;case 16:k.addNode(0,C[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(x,b){if(b.recoverable)this.trace(x);else{var w=new Error(x);throw w.hash=b,w}},"parseError"),parse:T(function(x){var b=this,w=[0],k=[],S=[null],C=[],_=this.table,L="",O=0,D=0,z=2,F=1,A=C.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(N.yy[M]=this.yy[M]);R.setInput(x,N.yy),N.yy.lexer=R,N.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var I=R.yylloc;C.push(I);var $=R.options&&R.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function P(ne){w.length=w.length-2*ne,S.length=S.length-ne,C.length=C.length-ne}T(P,"popStack");function B(){var ne;return ne=k.pop()||R.lex()||F,typeof ne!="number"&&(ne instanceof Array&&(k=ne,ne=k.pop()),ne=b.symbols_[ne]||ne),ne}T(B,"lex");for(var q,V,X,W,ie={},K,se,te,Z;;){if(V=w[w.length-1],this.defaultActions[V]?X=this.defaultActions[V]:((q===null||typeof q>"u")&&(q=B()),X=_[V]&&_[V][q]),typeof X>"u"||!X.length||!X[0]){var ee="";Z=[];for(K in _[V])this.terminals_[K]&&K>z&&Z.push("'"+this.terminals_[K]+"'");R.showPosition?ee="Parse error on line "+(O+1)+`: +`,"getStyles"),abt=ibt;function uz(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}b(uz,"withSeededRandom");var a1=b(t=>`${t}`,"wrapIcon"),oC={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:a1('')},server:{body:a1('')},disk:{body:a1('')},internet:{body:a1('')},cloud:{body:a1('')},unknown:xH,blank:{body:a1("")}}},sbt=b(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var M,I;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=LTe(u);let{x,y:w}=u[0].sourceEndpoint();const{x:C,y:k}=u[0].midpoint();let{x:S,y:E}=u[0].targetEndpoint();const L=i+4;if(p&&(Ps(d)?x+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(Ps(m)?S+=m==="L"?-L:L:E+=m==="T"?-L:L+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(Ps(d)?x+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((I=r.getNode(g))==null?void 0:I.type)==="junction"&&(Ps(m)?S+=m==="L"?s:-s:E+=m==="T"?s:-s),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${x},${w} L ${C},${k} L${S},${E} `).attr("class","edge").attr("id",`${n}-${I0(h,g,{prefix:"L"})}`),f){const $=Ps(d)?C6[d](x,o):x-l,_=vd(d)?C6[d](w,o):w-l;P.insert("polygon").attr("points",_Te[d](o)).attr("transform",`translate(${$},${_})`).attr("class","arrow")}if(y){const $=Ps(m)?C6[m](S,o):S-l,_=vd(m)?C6[m](E,o):E-l;P.insert("polygon").attr("points",_Te[m](o)).attr("transform",`translate(${$},${_})`).attr("class","arrow")}if(T){const $=lz(d,m)?"XY":Ps(d)?"X":"Y";let _=0;$==="X"?_=Math.abs(x-S):$==="Y"?_=Math.abs(w-E)/1.5:_=Math.abs(x-S)/2;const R=P.append("g");if(await Ja(R,T,{useHtmlLabels:!1,width:_,classes:"architecture-service-label"},Ve()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),$==="X")R.attr("transform","translate("+C+", "+k+")");else if($==="Y")R.attr("transform","translate("+C+", "+k+") rotate(-90)");else if($==="XY"){const O=cz(d,m);if(O&&j2t(O)){const D=R.node().getBoundingClientRect(),[N,B]=Q2t(O);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*B*45})`);const F=R.node().getBoundingClientRect();R.attr("transform",` + translate(${C}, ${k-D.height/2}) + translate(${N*F.width/2}, ${B*F.height/2}) + rotate(${-1*N*B*45}, 0, ${D.height/2}) + `)}}}}}))},"drawEdges"),obt=b(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=i1(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const x=y.append("g");x.html(`${await Jc(h.icon,{height:a,width:a,fallbackPrefix:oC.prefix})}`),x.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const x=y.append("g");await Ja(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Ve()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),lbt=b(async function(t,e,r,n){const i=Ve();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Ja(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Jc(a.icon,{height:o,width:o,fallbackPrefix:oC.prefix})}`);else if(a.iconText){l.html(`${await Jc("blank",{height:o,width:o,fallbackPrefix:oC.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Qr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),cbt=b(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");ZR([{name:oC.prefix,icons:oC}]),dc.use(Y2t);function DTe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}b(DTe,"addServices");function NTe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}b(NTe,"addJunctions");function OTe(t,e){e.nodes().map(r=>{const n=i1(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}b(OTe,"positionNodes");function $Te(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}b($Te,"addGroups");function PTe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=lz(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}b(PTe,"addEdges");function BTe(t,e,r,n=[]){const i=b((f,p)=>Object.entries(f).reduce((g,[m,y])=>{var x;let v=0;const T=Object.entries(y);if(T.length===1)return g[m]=T[0][1],g;for(let w=0;w{const p={},g={};return Object.entries(f).forEach(([m,[y,v]])=>{var x,w,C;const T=((x=t.getNode(m))==null?void 0:x.in)??"default";p[v]??(p[v]={}),(w=p[v])[T]??(w[T]=[]),p[v][T].push(m),g[y]??(g[y]={}),(C=g[y])[T]??(C[T]=[]),g[y][T].push(m)}),{horiz:Object.values(i(p,"horizontal")).filter(m=>m.length>1),vert:Object.values(i(g,"vertical")).filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=b(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}b(BTe,"getAlignments");function FTe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=b(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=Object.fromEntries(Object.entries(h).map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d[m];if(y){const v=u(m);Object.entries(g).forEach(([T,x])=>{const w=l([v[0]+x[0],v[1]+x[1]]),C=d[w];if(C&&!p[w]){if(f.push(w),o.has(`${y}|${C}`))return;n.push({[ATe[T]]:C,[ATe[X2t(T)]]:y,gap:a*i})}})}}}}),n}b(FTe,"getRelativeConstraints");function zTe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=mt("body").append("div").attr("id","cy").attr("style","display:none"),u=dc({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),$Te(r,u),DTe(t,u,i),NTe(e,u,i),PTe(n,u);const h=i.getLayoutHints(),d=BTe(i,a,s,h),f=FTe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),T=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){const[w,C]=x.connectedNodes(),{parent:k}=i1(w),{parent:S}=i1(C);return k===S?g:m},edgeElasticity(x){const[w,C]=x.connectedNodes(),{parent:k}=i1(w),{parent:S}=i1(C);return k===S?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});T.one("layoutstop",()=>{var w;function x(C,k,S,E){let L,M;const{x:I,y:P}=C,{x:$,y:_}=k;M=(E-P+(I-S)*(P-_)/(I-$))/Math.sqrt(1+Math.pow((P-_)/(I-$),2)),L=Math.sqrt(Math.pow(E-P,2)+Math.pow(S-I,2)-Math.pow(M,2));const R=Math.sqrt(Math.pow($-I,2)+Math.pow(_-P,2));L=L/R;let O=($-I)*(E-P)-(_-P)*(S-I);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}let D=($-I)*(S-I)+(_-P)*(E-P);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}return M=Math.abs(M)*O,L=L*D,{distances:M,weights:L}}b(x,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((w=C.data)!=null&&w.call(C)){const{x:k,y:S}=C.source().position(),{x:E,y:L}=C.target().position();if(k!==E&&S!==L){const M=C.sourceEndpoint(),I=C.targetEndpoint(),{sourceDir:P}=LTe(C),[$,_]=vd(P)?[M.x,I.y]:[I.x,M.y],{weights:R,distances:O}=x(M,I,$,_);C.style("segment-distances",O),C.style("segment-weights",R)}}u.endBatch(),uz(v,()=>T.run())});try{uz(v,()=>T.run())}catch(x){throw x instanceof RangeError&&x.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):x}u.ready(x=>{he.info("Ready",x),o(u)})})}b(zTe,"layoutArchitecture");var ubt=b(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=Ka(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await lbt(i,f,a,e),cbt(i,f,s,e);const g=await zTe(a,s,o,l,i,u);await sbt(d,g,i,e),await obt(p,g,i,e),OTe(i,g),d0(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),hbt={draw:ubt},dbt={parser:MTe,get db(){return new ITe},renderer:hbt,styles:abt};const fbt=Object.freeze(Object.defineProperty({__proto__:null,diagram:dbt},Symbol.toStringTag,{value:"Module"}));var GTe="position frame",WTe="frame positioned",hz="position relation",qTe="relation positioned",pbt=b(function(t){he.debug("options str",t)},"setOptions"),gbt=b(function(){return{}},"getOptions"),mbt=b(function(){VTe(),zn()},"clear");function VTe(){dz={}}b(VTe,"reset");var ybt=jr.eventmodeling,vbt=b(()=>ri({...ybt,...sr().eventmodeling}),"getConfig"),dz={};function UTe(){let t=bbt;const{ast:e}=dz,r=fz();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=QTe(n,e.dataEntities,r);t=k6(t,{$kind:GTe,index:i,frame:n,textProps:a});let s;iwe(n)?(he.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=k6(t,{$kind:hz,index:i,frame:n,sourceFrame:o})})):t=k6(t,{$kind:hz,index:i,frame:n})}),t={...t,sortedSwimlanesArray:pz(t.swimlanes)},t}b(UTe,"getState");function HTe(t){dz.ast=t}b(HTe,"setAst");var Cn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function fz(){return Cn}b(fz,"getDiagramProps");var bbt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function YTe(t){const e=t.split(".");if(e.length===2)return e[0]}b(YTe,"extractNamespace");function XTe(t){const e=t.split(".");return e.length===2?e[1]:t}b(XTe,"extractName");function jTe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}b(jTe,"findSwimlaneByNamespace");function S6(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}b(S6,"findNextAvailableIndex");function KTe(t,e){const r=YTe(t.entityIdentifier),n=jTe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Cn.labelUiAutomation}:r?{index:S6(e,0,100),label:Cn.labelUiAutomationPrefix+r}:{index:0,label:Cn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Cn.labelCommandReadModel}:r?{index:S6(e,100,200),label:Cn.labelCommandReadModelPrefix+r}:{index:100,label:Cn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Cn.labelEvents}:r?{index:S6(e,200,300),label:Cn.labelEventsPrefix+r}:{index:200,label:Cn.labelEvents}}}b(KTe,"calculateSwimlaneProps");function ZTe(t){const{themeVariables:e}=sr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}b(ZTe,"calculateEntityVisualProps");function QTe(t,e,r){const n=sr(),i=Qr(XTe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${Wb(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Qr(a,n),a=Wb(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ +`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Qr(a,n),a=Wb(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
    ")}const u=a!==void 0;u&&(l+=`

    ${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=F4(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return he.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}b(QTe,"calculateTextProps");function JTe(t,e){const r=e,n=ZTe(r.frame),i={width:r.textProps.width+2*Cn.boxTextPadding,height:r.textProps.height+2*Cn.boxTextPadding};return[{$kind:WTe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}b(JTe,"decidePositionFrame");function ewe(t,e,r){return e===void 0?Cn.contentStartX:e.index===t.index&&t.r?t.r+Cn.boxPadding:r===void 0?Cn.contentStartX:r.r-Cn.boxOverlap+Cn.boxPadding}b(ewe,"calculateX");function twe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}b(twe,"calculateMaxRight");function pz(t){return Object.values(t).sort((e,r)=>e.index-r.index)}b(pz,"sortedSwimlanesArray");function rwe(t,e){const r=e,n=KTe(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*Cn.swimlaneMinHeight+Cn.swimlaneGap,height:Cn.swimlaneMinHeight,maxHeight:Cn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(Cn.boxMinWidth,Math.min(Cn.boxMaxWidth,r.dimension.width))+2*Cn.boxPadding,height:Math.max(Cn.boxMinHeight,Math.min(Cn.boxMaxHeight,r.dimension.height))+2*Cn.boxPadding},l=ewe(i,s,a),u=l+o.width+Cn.boxPadding,h=twe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Cn.swimlaneMinHeight,i.maxHeight)+2*Cn.swimlanePadding;const d={x:l,y:Cn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=pz(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}b(iwe,"hasSourceFrame");function gz(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}b(gz,"findBoxByFrame");function awe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}b(awe,"findBoxByLineIndex");function swe(t,e){const r=e;if(_ye(r.frame)||nwe(r.index,r.frame))return[];const n=gz(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=gz(t.boxes,r.sourceFrame):i=awe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:qTe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}b(swe,"decidePositionRelation");function owe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}b(owe,"evolveRelationPositioned");var xbt={[GTe]:JTe,[hz]:swe},Tbt={[WTe]:rwe,[qTe]:owe};function lwe(t,e){const r=xbt[e.$kind];if(r==null)return[];const n=r(t,e);return he.debug("decided events",n),n}b(lwe,"decide");function cwe(t,e){const r=e.reduce((n,i)=>{const a=Tbt[i.$kind];return a==null?n:a(n,i)},t);return he.debug("evolve events",{state:t,newState:r,events:e}),r}b(cwe,"evolve");function k6(t,e){const r=lwe(t,e);return cwe(t,r)}b(k6,"dispatch");var mz={getConfig:vbt,setOptions:pbt,getOptions:gbt,clear:mbt,setAccTitle:qn,getAccTitle:Qn,getAccDescription:ei,setAccDescription:Jn,setDiagramTitle:ti,getDiagramTitle:Vn,setAst:HTe,getDiagramProps:fz,getState:UTe},wbt={parse:b(async t=>{const e=await Xo("eventmodeling",t);he.debug(e),mz.setAst(e),Cs(e,mz)},"parse")},yz=Ve(),Cbt=yz==null?void 0:yz.eventmodeling;function uwe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}b(uwe,"renderD3Box");function hwe(t,e){return t>e}b(hwe,"dirUpwards");function dwe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=hwe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;he.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}b(dwe,"renderD3Relation");function fwe(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}b(fwe,"renderD3Swimlane");var Sbt=b(function(t,e,r,n){if(he.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!Cbt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Ve(),o=mt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(fwe(o,u.maxR,l,a)),u.boxes.forEach(uwe(o,l)),u.relations.forEach(dwe(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),m_(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),kbt={draw:Sbt},Ebt=b(t=>"","getStyles"),Abt=Ebt,_bt={parser:wbt,db:mz,renderer:kbt,styles:Abt};const Rbt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_bt},Symbol.toStringTag,{value:"Module"}));var vz=(function(){var t=b(function(v,T,x,w){for(x=x||{},w=v.length;w--;x[v[w]]=T);return x},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:b(function(T,x,w,C,k,S,E){var L=S.length-1;switch(k){case 6:case 7:return C;case 15:C.addNode(S[L-1].length,S[L].trim());break;case 16:C.addNode(0,S[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:b(function(T,x){if(x.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=x,w}},"parseError"),parse:b(function(T){var x=this,w=[0],C=[],k=[null],S=[],E=this.table,L="",M=0,I=0,P=2,$=1,_=S.slice.call(arguments,1),R=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);R.setInput(T,O.yy),O.yy.lexer=R,O.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var N=R.yylloc;S.push(N);var B=R.options&&R.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(re){w.length=w.length-2*re,k.length=k.length-re,S.length=S.length-re}b(F,"popStack");function G(){var re;return re=C.pop()||R.lex()||$,typeof re!="number"&&(re instanceof Array&&(C=re,re=C.pop()),re=x.symbols_[re]||re),re}b(G,"lex");for(var z,W,V,H,te={},Y,se,J,Z;;){if(W=w[w.length-1],this.defaultActions[W]?V=this.defaultActions[W]:((z===null||typeof z>"u")&&(z=G()),V=E[W]&&E[W][z]),typeof V>"u"||!V.length||!V[0]){var ee="";Z=[];for(Y in E[W])this.terminals_[Y]&&Y>P&&Z.push("'"+this.terminals_[Y]+"'");R.showPosition?ee="Parse error on line "+(M+1)+`: `+R.showPosition()+` -Expecting `+Z.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ee="Parse error on line "+(O+1)+": Unexpected "+(q==F?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(ee,{text:R.match,token:this.terminals_[q]||q,line:R.yylineno,loc:I,expected:Z})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+q);switch(X[0]){case 1:w.push(q),S.push(R.yytext),C.push(R.yylloc),w.push(X[1]),q=null,D=R.yyleng,L=R.yytext,O=R.yylineno,I=R.yylloc;break;case 2:if(se=this.productions_[X[1]][1],ie.$=S[S.length-se],ie._$={first_line:C[C.length-(se||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(se||1)].first_column,last_column:C[C.length-1].last_column},$&&(ie._$.range=[C[C.length-(se||1)].range[0],C[C.length-1].range[1]]),W=this.performAction.apply(ie,[L,D,O,N.yy,X[1],S,C].concat(A)),typeof W<"u")return W;se&&(w=w.slice(0,-1*se*2),S=S.slice(0,-1*se),C=C.slice(0,-1*se)),w.push(this.productions_[X[1]][0]),S.push(ie.$),C.push(ie._$),te=_[w[w.length-2]][w[w.length-1]],w.push(te);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:T(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:T(function(x,b){return this.yy=b||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var b=x.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:T(function(x){var b=x.length,w=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===k.length?this.yylloc.first_column:0)+k[k.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(x){this.unput(this.match.slice(x))},"less"),pastInput:T(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var x=this.pastInput(),b=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+b+"^"},"showPosition"),test_match:T(function(x,b){var w,k,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),k=x[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var C in S)this[C]=S[C];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,b,w,k;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),C=0;Cb[0].length)){if(b=w,k=C,this.options.backtrack_lexer){if(x=this.test_match(w,S[C]),x!==!1)return x;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(x=this.test_match(b,S[k]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var b=this.next();return b||this.lex()},"lex"),begin:T(function(b){this.conditionStack.push(b)},"begin"),popState:T(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:T(function(b){this.begin(b)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(b,w,k,S){switch(k){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return T(y,"Parser"),y.prototype=g,g.Parser=y,new y})();DP.parser=DP;var Sgt=DP,Agt=(jv=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,Dn()}getRoot(){return this.root}addNode(e,r){const n=It.sanitizeText(r,$e());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],Wn(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Gn()}setAccTitle(e){Mn(e)}getAccDescription(){return Vn()}setAccDescription(e){qn(e)}getDiagramTitle(){return Nn()}setDiagramTitle(e){Wn(e)}},T(jv,"IshikawaDB"),jv),_gt=14,fm=250,Rgt=30,Lgt=60,Igt=5,mve=82*Math.PI/180,yve=Math.cos(mve),vve=Math.sin(mve),bve=T((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;vi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),Dgt=T((t,e,r,n)=>{var N,M;const a=n.db.getRoot();if(!a)return;const s=$e(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Tc(s.fontSize)[0]??_gt,d=o==="handDrawn",f=a.children??[],p=((N=s.ishikawa)==null?void 0:N.diagramPadding)??20,g=((M=s.ishikawa)==null?void 0:M.useMaxWidth)??!1,m=ms(e),y=m.append("g").attr("class","ishikawa"),v=d?jt.svg(m.node()):void 0,x=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,k=fm;const S=d?void 0:pm(y,w,k,w,k,"ishikawa-spine");if(Mgt(y,w,k,a.text,h,x),!f.length){d&&pm(y,w,k,w,k,"ishikawa-spine",x),bve(m,p,g);return}w-=20;const C=f.filter((I,$)=>$%2===0),_=f.filter((I,$)=>$%2===1),L=xve(C),O=xve(_),D=L.total+O.total;let z=fm,F=fm;if(D>0){const I=fm*2,$=fm*.3;z=Math.max($,I*(L.total/D)),F=Math.max($,I*(O.total/D))}const A=h*2;z=Math.max(z,L.max*A),F=Math.max(F,O.max*A),k=Math.max(z,fm),S&&S.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const R=Math.ceil(f.length/2);for(let I=0;IMath.min(P,B.getBBox().x),1/0)}if(d)pm(y,w,k,0,k,"ishikawa-spine",x);else{S.attr("x1",w);const I=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",I)}bve(m,p,g)},"draw"),xve=T(t=>{const e=T(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),Mgt=T((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=a6(o,Tve(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Ngt=T((t,e)=>{const r=[],n=[],i=T((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:Tve(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),Ogt=T((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=a6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),MP=T((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),$gt=T((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-yve*u,d=vve*u*i,f=r+h,p=n+d;if(pm(t,r,n,f,p,"ishikawa-branch",o),o&&MP(t,r,n,r-f,n-p,o),Ogt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Ngt(l,i),y=g.length,v=new Array(y);for(const[S,C]of m.entries())v[C]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-yve,w=vve*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,C]of g.entries()){const _=v[S],L=x.get(C.parentIndex),O=t.append("g").attr("class","ishikawa-sub-group");let D=0,z=0,F=0;if(C.depth%2===0){const A=L.y1-L.y0;D=wve(L.x0,L.x1,A?(_-L.y0)/A:.5),z=_,F=D-(C.childCount>0?Lgt+C.childCount*Igt:Rgt),pm(O,D,_,F,_,"ishikawa-sub-branch",o),o&&MP(O,D,_,1,0,o),a6(O,C.text,F,_,"ishikawa-label align","end",s)}else{const A=L.childrenDrawn++;D=wve(L.x0,L.x1,(L.childCount-A)/(L.childCount+1)),z=L.y0,F=D+b*((_-z)/w),pm(O,D,z,F,_,"ishikawa-sub-branch",o),o&&MP(O,D,z,D-F,z-_,o),a6(O,C.text,F,_,k,"end",s)}C.childCount>0&&x.set(S,{x0:D,y0:z,x1:F,y1:_,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),Pgt=T(t=>t.split(/|\n/),"splitLines"),Tve=T((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),a6=T((t,e,r,n,i,a,s)=>{const o=Pgt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),wve=T((t,e,r)=>t+(e-t)*r,"lerp"),pm=T((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),Bgt={draw:Dgt},Fgt=T(t=>` +Expecting `+Z.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ee="Parse error on line "+(M+1)+": Unexpected "+(z==$?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ee,{text:R.match,token:this.terminals_[z]||z,line:R.yylineno,loc:N,expected:Z})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+z);switch(V[0]){case 1:w.push(z),k.push(R.yytext),S.push(R.yylloc),w.push(V[1]),z=null,I=R.yyleng,L=R.yytext,M=R.yylineno,N=R.yylloc;break;case 2:if(se=this.productions_[V[1]][1],te.$=k[k.length-se],te._$={first_line:S[S.length-(se||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(se||1)].first_column,last_column:S[S.length-1].last_column},B&&(te._$.range=[S[S.length-(se||1)].range[0],S[S.length-1].range[1]]),H=this.performAction.apply(te,[L,I,M,O.yy,V[1],k,S].concat(_)),typeof H<"u")return H;se&&(w=w.slice(0,-1*se*2),k=k.slice(0,-1*se),S=S.slice(0,-1*se)),w.push(this.productions_[V[1]][0]),k.push(te.$),S.push(te._$),J=E[w[w.length-2]][w[w.length-1]],w.push(J);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:b(function(x,w){if(this.yy.parser)this.yy.parser.parseError(x,w);else throw new Error(x)},"parseError"),setInput:b(function(T,x){return this.yy=x||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var x=T.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:b(function(T){var x=T.length,w=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===C.length?this.yylloc.first_column:0)+C[C.length-w.length].length-w[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(T){this.unput(this.match.slice(T))},"less"),pastInput:b(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var T=this.pastInput(),x=new Array(T.length+1).join("-");return T+this.upcomingInput()+` +`+x+"^"},"showPosition"),test_match:b(function(T,x){var w,C,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),C=T[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],w=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var S in k)this[S]=k[S];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,x,w,C;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),S=0;Sx[0].length)){if(x=w,C=S,this.options.backtrack_lexer){if(T=this.test_match(w,k[S]),T!==!1)return T;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(T=this.test_match(x,k[C]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var x=this.next();return x||this.lex()},"lex"),begin:b(function(x){this.conditionStack.push(x)},"begin"),popState:b(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:b(function(x){this.begin(x)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(x,w,C,k){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return b(y,"Parser"),y.prototype=g,g.Parser=y,new y})();vz.parser=vz;var Lbt=vz,Ibt=(U2=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,zn()}getRoot(){return this.root}addNode(e,r){const n=$t.sanitizeText(r,Ve());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ti(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Qn()}setAccTitle(e){qn(e)}getAccDescription(){return ei()}setAccDescription(e){Jn(e)}getDiagramTitle(){return Vn()}setDiagramTitle(e){ti(e)}},b(U2,"IshikawaDB"),U2),Mbt=14,s1=250,Dbt=30,Nbt=60,Obt=5,pwe=82*Math.PI/180,gwe=Math.cos(pwe),mwe=Math.sin(pwe),ywe=b((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;bi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),$bt=b((t,e,r,n)=>{var O,D;const a=n.db.getRoot();if(!a)return;const s=Ve(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Zc(s.fontSize)[0]??Mbt,d=o==="handDrawn",f=a.children??[],p=((O=s.ishikawa)==null?void 0:O.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=Ka(e),y=m.append("g").attr("class","ishikawa"),v=d?tr.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,x=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",x).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,C=s1;const k=d?void 0:o1(y,w,C,w,C,"ishikawa-spine");if(Pbt(y,w,C,a.text,h,T),!f.length){d&&o1(y,w,C,w,C,"ishikawa-spine",T),ywe(m,p,g);return}w-=20;const S=f.filter((N,B)=>B%2===0),E=f.filter((N,B)=>B%2===1),L=vwe(S),M=vwe(E),I=L.total+M.total;let P=s1,$=s1;if(I>0){const N=s1*2,B=s1*.3;P=Math.max(B,N*(L.total/I)),$=Math.max(B,N*(M.total/I))}const _=h*2;P=Math.max(P,L.max*_),$=Math.max($,M.max*_),C=Math.max(P,s1),k&&k.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const R=Math.ceil(f.length/2);for(let N=0;NMath.min(F,G.getBBox().x),1/0)}if(d)o1(y,w,C,0,C,"ishikawa-spine",T);else{k.attr("x1",w);const N=`url(#${x})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}ywe(m,p,g)},"draw"),vwe=b(t=>{const e=b(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),Pbt=b((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=E6(o,bwe(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Bbt=b((t,e)=>{const r=[],n=[],i=b((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:bwe(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),Fbt=b((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=E6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),bz=b((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),zbt=b((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-gwe*u,d=mwe*u*i,f=r+h,p=n+d;if(o1(t,r,n,f,p,"ishikawa-branch",o),o&&bz(t,r,n,r-f,n-p,o),Fbt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Bbt(l,i),y=g.length,v=new Array(y);for(const[k,S]of m.entries())v[S]=n+d*((k+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const x=-gwe,w=mwe*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[k,S]of g.entries()){const E=v[k],L=T.get(S.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let I=0,P=0,$=0;if(S.depth%2===0){const _=L.y1-L.y0;I=xwe(L.x0,L.x1,_?(E-L.y0)/_:.5),P=E,$=I-(S.childCount>0?Nbt+S.childCount*Obt:Dbt),o1(M,I,E,$,E,"ishikawa-sub-branch",o),o&&bz(M,I,E,1,0,o),E6(M,S.text,$,E,"ishikawa-label align","end",s)}else{const _=L.childrenDrawn++;I=xwe(L.x0,L.x1,(L.childCount-_)/(L.childCount+1)),P=L.y0,$=I+x*((E-P)/w),o1(M,I,P,$,E,"ishikawa-sub-branch",o),o&&bz(M,I,P,I-$,P-E,o),E6(M,S.text,$,E,C,"end",s)}S.childCount>0&&T.set(k,{x0:I,y0:P,x1:$,y1:E,childCount:S.childCount,childrenDrawn:0})}},"drawBranch"),Gbt=b(t=>t.split(/|\n/),"splitLines"),bwe=b((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),E6=b((t,e,r,n,i,a,s)=>{const o=Gbt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),xwe=b((t,e,r)=>t+(e-t)*r,"lerp"),o1=b((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),Wbt={draw:$bt},qbt=b(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3246,18 +3279,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ee="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),zgt=Fgt,Ggt={parser:Sgt,get db(){return new Agt},renderer:Bgt,styles:zgt};const qgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ggt},Symbol.toStringTag,{value:"Module"})),Cve=1e-10;function s6(t,e){const r=Wgt(t),n=r.filter(o=>Vgt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=Eve(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=NP(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-Cve,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function Vgt(t,e){return e.every(r=>Ds(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return NP(t,n)+NP(e,i)}function kve(t,e){const r=Ds(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function Eve(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function Ugt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)$P(e))}function gm(t,e){let r=0;for(let n=0;nk.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),w=e.slice();for(let k=0;k{const L=_.slice();return L.fx=_.fx,L.id=_.id,L});C.sort((_,L)=>_.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(x.fx>S.fx?(bu(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let _=1;_o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(bu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=gm(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Ygt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),BP(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fOP(t,e,n)-r,0,t+e)}function Xgt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=FP(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function jgt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function Zgt(t,e={}){let r=Jgt(t,e);const n=e.lossFunction||mm;if(t.length>=8){const i=Qgt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>jgt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+Rve>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function Lve(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=OP(o.radius,l.radius,Ds(o,l))}else i=s6(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function emt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&Ds(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function tmt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function zP(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function Ive(t,e,r){e==null&&(e=Math.PI/2);let n=Nve(t).map(u=>Object.assign({},u));const i=tmt(n);for(const u of i){emt(u,e,r);const h=zP(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function Mve(t){const e={};for(const r of t)e[r.setid]=r;return e}function Nve(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function rmt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],x=0,b=function(C){if(C in y)return y[C];var _=y[C]=v[x];return x+=1,x>=v.length&&(x=0),_},w=_ve,k=mm;function S(C){let _=C.datum();const L=new Set;_.forEach(K=>{K.size==0&&K.sets.length==1&&L.add(K.sets[0])}),_=_.filter(K=>!K.sets.some(se=>L.has(se)));let O={},D={};if(_.length>0){let K=w(_,{lossFunction:k,distinct:p});o&&(K=Ive(K,s,f)),O=Dve(K,r,n,i,l),D=$ve(O,_,m)}const z={};_.forEach(K=>{K.label&&(z[K.sets]=K.label)});function F(K){if(K.sets in z)return z[K.sets];if(K.sets.length==1)return""+K.sets[0]}C.selectAll("svg").data([O]).enter().append("svg");const A=C.select("svg");e?A.attr("viewBox",`0 0 ${r} ${n}`):A.attr("width",r).attr("height",n);const R={};let N=!1;A.selectAll(".venn-area path").each(function(K){const se=this.getAttribute("d");K.sets.length==1&&se&&!p&&(N=!0,R[K.sets[0]]=amt(se))});function M(K){return se=>{const te=K.sets.map(Z=>{let ee=R[Z],ne=O[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),ne||(ne={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-se)+ne.x*se,y:ee.y*(1-se)+ne.y*se,radius:ee.radius*(1-se)+ne.radius*se}});return Fve(te,g)}}const I=A.selectAll(".venn-area").data(_,K=>K.sets),$=I.enter().append("g").attr("class",K=>`venn-area venn-${K.sets.length==1?"circle":"intersection"}${K.colour||K.color?" venn-coloured":""}`).attr("data-venn-sets",K=>K.sets.join("_")),P=$.append("path"),B=$.append("text").attr("class","label").text(K=>F(K)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(P.style("fill-opacity","0").filter(K=>K.sets.length==1).style("fill",K=>K.colour?K.colour:K.color?K.color:b(K.sets)).style("fill-opacity",".25"),B.style("fill",K=>K.colour||K.color?"#FFF":t.textFill?t.textFill:K.sets.length==1?b(K.sets):"#444"));function q(K){return typeof K.transition=="function"?K.transition("venn").duration(a):K}let V=C;N&&typeof V.transition=="function"?(V=q(C),V.selectAll("path").attrTween("d",M)):V.selectAll("path").attr("d",K=>Fve(K.sets.map(se=>O[se])),g);const X=V.selectAll("text").filter(K=>K.sets in D).text(K=>F(K)).attr("x",K=>Math.floor(D[K.sets].x)).attr("y",K=>Math.floor(D[K.sets].y));u&&(N?"on"in X?X.on("end",GP(O,F)):X.each("end",GP(O,F)):X.each(GP(O,F)));const W=q(I.exit()).remove();typeof I.transition=="function"&&W.selectAll("path").attrTween("d",M);const ie=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(B.style("font-size","0px"),X.style("font-size",d),ie.style("font-size","0px")),{circles:O,textCentres:D,nodes:I,enter:$,update:V,exit:W}}return S.wrap=function(C){return arguments.length?(u=C,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(C){return arguments.length?(r=C,S):r},S.height=function(C){return arguments.length?(n=C,S):n},S.padding=function(C){return arguments.length?(i=C,S):i},S.distinct=function(C){return arguments.length?(p=C,S):p},S.colours=function(C){return arguments.length?(b=C,S):b},S.colors=function(C){return arguments.length?(b=C,S):b},S.fontSize=function(C){return arguments.length?(d=C,S):d},S.round=function(C){return arguments.length?(g=C,S):g},S.duration=function(C){return arguments.length?(a=C,S):a},S.layoutFunction=function(C){return arguments.length?(w=C,S):w},S.normalize=function(C){return arguments.length?(o=C,S):o},S.scaleToFit=function(C){return arguments.length?(l=C,S):l},S.styled=function(C){return arguments.length?(h=C,S):h},S.orientation=function(C){return arguments.length?(s=C,S):s},S.orientationOrder=function(C){return arguments.length?(f=C,S):f},S.lossFunction=function(C){return arguments.length?(k=C==="default"?mm:C==="logRatio"?Lve:C,S):k},S}function GP(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),x=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+w*f}em`)})}}function qP(t,e,r){let n=e[0].radius-Ds(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=Ave(h=>-1*qP({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(Ds(o,h)>h.radius){l=!1;break}for(const h of e)if(Ds(o,h)h.p1))}function nmt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function imt(t,e,r){const n=[];return n.push(` +`,"getStyles"),Vbt=qbt,Ubt={parser:Lbt,get db(){return new Ibt},renderer:Wbt,styles:Vbt};const Hbt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ubt},Symbol.toStringTag,{value:"Module"})),Twe=1e-10;function A6(t,e){const r=Xbt(t),n=r.filter(o=>Ybt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=Cwe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(x=g.radius*2),(f==null||f.width>x)&&(f={circle:g,width:x,p1:h,p2:l,large:x>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=xz(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-Twe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function Ybt(t,e){return e.every(r=>ro(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return xz(t,n)+xz(e,i)}function wwe(t,e){const r=ro(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function Cwe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function jbt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)wz(e))}function l1(t,e){let r=0;for(let n=0;nC.fx-k.fx,v=e.slice(),T=e.slice(),x=e.slice(),w=e.slice();for(let C=0;C{const L=E.slice();return L.fx=E.fx,L.id=E.id,L});S.sort((E,L)=>E.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:S})}f=0;for(let S=0;S=g[p-1].fx){let S=!1;if(T.fx>k.fx?(Ju(x,1+h,v,-h,k),x.fx=t(x),x.fx=1)break;for(let E=1;Eo+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Ju(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=l1(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Zbt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),Sz(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fTz(t,e,n)-r,0,t+e)}function Qbt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=kz(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function ext(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function txt(t,e={}){let r=nxt(t,e);const n=e.lossFunction||c1;if(t.length>=8){const i=rxt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>ext(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+Awe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function _we(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=Tz(o.radius,l.radius,ro(o,l))}else i=A6(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function ixt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&ro(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function axt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function Ez(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function Rwe(t,e,r){e==null&&(e=Math.PI/2);let n=Mwe(t).map(u=>Object.assign({},u));const i=axt(n);for(const u of i){ixt(u,e,r);const h=Ez(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function Iwe(t){const e={};for(const r of t)e[r.setid]=r;return e}function Mwe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function sxt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,x=function(S){if(S in y)return y[S];var E=y[S]=v[T];return T+=1,T>=v.length&&(T=0),E},w=Ewe,C=c1;function k(S){let E=S.datum();const L=new Set;E.forEach(Y=>{Y.size==0&&Y.sets.length==1&&L.add(Y.sets[0])}),E=E.filter(Y=>!Y.sets.some(se=>L.has(se)));let M={},I={};if(E.length>0){let Y=w(E,{lossFunction:C,distinct:p});o&&(Y=Rwe(Y,s,f)),M=Lwe(Y,r,n,i,l),I=Nwe(M,E,m)}const P={};E.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function $(Y){if(Y.sets in P)return P[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}S.selectAll("svg").data([M]).enter().append("svg");const _=S.select("svg");e?_.attr("viewBox",`0 0 ${r} ${n}`):_.attr("width",r).attr("height",n);const R={};let O=!1;_.selectAll(".venn-area path").each(function(Y){const se=this.getAttribute("d");Y.sets.length==1&&se&&!p&&(O=!0,R[Y.sets[0]]=cxt(se))});function D(Y){return se=>{const J=Y.sets.map(Z=>{let ee=R[Z],re=M[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),re||(re={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-se)+re.x*se,y:ee.y*(1-se)+re.y*se,radius:ee.radius*(1-se)+re.radius*se}});return Pwe(J,g)}}const N=_.selectAll(".venn-area").data(E,Y=>Y.sets),B=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),F=B.append("path"),G=B.append("text").attr("class","label").text(Y=>$(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(F.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:x(Y.sets)).style("fill-opacity",".25"),G.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?x(Y.sets):"#444"));function z(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let W=S;O&&typeof W.transition=="function"?(W=z(S),W.selectAll("path").attrTween("d",D)):W.selectAll("path").attr("d",Y=>Pwe(Y.sets.map(se=>M[se])),g);const V=W.selectAll("text").filter(Y=>Y.sets in I).text(Y=>$(Y)).attr("x",Y=>Math.floor(I[Y.sets].x)).attr("y",Y=>Math.floor(I[Y.sets].y));u&&(O?"on"in V?V.on("end",Az(M,$)):V.each("end",Az(M,$)):V.each(Az(M,$)));const H=z(N.exit()).remove();typeof N.transition=="function"&&H.selectAll("path").attrTween("d",D);const te=H.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(G.style("font-size","0px"),V.style("font-size",d),te.style("font-size","0px")),{circles:M,textCentres:I,nodes:N,enter:B,update:W,exit:H}}return k.wrap=function(S){return arguments.length?(u=S,k):u},k.useViewBox=function(){return e=!0,k},k.width=function(S){return arguments.length?(r=S,k):r},k.height=function(S){return arguments.length?(n=S,k):n},k.padding=function(S){return arguments.length?(i=S,k):i},k.distinct=function(S){return arguments.length?(p=S,k):p},k.colours=function(S){return arguments.length?(x=S,k):x},k.colors=function(S){return arguments.length?(x=S,k):x},k.fontSize=function(S){return arguments.length?(d=S,k):d},k.round=function(S){return arguments.length?(g=S,k):g},k.duration=function(S){return arguments.length?(a=S,k):a},k.layoutFunction=function(S){return arguments.length?(w=S,k):w},k.normalize=function(S){return arguments.length?(o=S,k):o},k.scaleToFit=function(S){return arguments.length?(l=S,k):l},k.styled=function(S){return arguments.length?(h=S,k):h},k.orientation=function(S){return arguments.length?(s=S,k):s},k.orientationOrder=function(S){return arguments.length?(f=S,k):f},k.lossFunction=function(S){return arguments.length?(C=S==="default"?c1:S==="logRatio"?_we:S,k):C},k}function Az(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(x){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=x,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const x=h.join(" ");m.textContent=x,x.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((x,w)=>{x.setAttribute("x",v),x.setAttribute("y",T),x.setAttribute("dy",`${y+w*f}em`)})}}function _z(t,e,r){let n=e[0].radius-ro(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=kwe(h=>-1*_z({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(ro(o,h)>h.radius){l=!1;break}for(const h of e)if(ro(o,h)h.p1))}function oxt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function lxt(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function amt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function Pve(t){if(t.length===0)return[];const e={};return s6(t,e),e.arcs}function Bve(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return imt(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function cxt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function Owe(t){if(t.length===0)return[];const e={};return A6(t,e),e.arcs}function $we(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return lxt(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` -A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Fve(t,e){return Bve(Pve(t),e)}function smt(t,e={}){const{lossFunction:r,layoutFunction:n=_ve,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?mm:r==="logRatio"?Lve:r,distinct:f});i&&(g=Ive(g,a,s));const m=Dve(g,o,l,u,h),y=$ve(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),x=t.map(w=>{const k=w.sets.map(_=>v.get(_)),S=Pve(k),C=Bve(S,p);return{circles:k,arcs:S,path:C,area:w,has:new Set(w.sets)}});function b(w){let k="";for(const S of x)S.has.size>w.length&&w.every(C=>S.has.has(C))&&(k+=" "+S.path);return k}return x.map(({circles:w,arcs:k,path:S,area:C})=>({data:C,text:y[C.sets],circles:w,arcs:k,path:S,distinctPath:S+b(C.sets)}))}var VP=(function(){var t=T(function(x,b,w,k){for(w=w||{},k=x.length;k--;w[x[k]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:T(function(b,w,k,S,C,_,L){var O=_.length-1;switch(C){case 1:return _[O-1];case 2:case 3:case 4:this.$=[];break;case 5:_[O-1].push(_[O]),this.$=_[O-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[O];break;case 8:S.setDiagramTitle(_[O].substr(6)),this.$=_[O].substr(6);break;case 9:S.addSubsetData([_[O]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([_[O-1]],_[O],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([_[O-2]],void 0,parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([_[O-3]],_[O-2],parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(_[O].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O]),S.addSubsetData(_[O],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(_[O-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-1]),S.addSubsetData(_[O-1],_[O],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(_[O-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-2]),S.addSubsetData(_[O-2],void 0,parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(_[O-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-3]),S.addSubsetData(_[O-3],_[O-2],parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(_[O-1],_[O],void 0);break;case 20:case 21:S.addTextData(_[O-2],_[O-1],_[O]);break;case 23:S.addStyleData(_[O-1],_[O]);break;case 24:case 25:case 26:var D=S.getCurrentSets();if(!D)throw new Error("text requires set");S.addTextData(D,_[O],void 0);break;case 27:case 28:var D=S.getCurrentSets();if(!D)throw new Error("text requires set");S.addTextData(D,_[O-1],_[O]);break;case 29:case 41:this.$=[_[O]];break;case 30:case 42:this.$=[..._[O-2],_[O]];break;case 31:this.$=[_[O-2],_[O]];break;case 33:this.$=_[O].join(" ");break;case 34:this.$=[_[O]];break;case 35:_[O-1].push(_[O]),this.$=_[O-1];break;case 43:case 44:this.$=_[O];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:T(function(b,w){if(w.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=w,k}},"parseError"),parse:T(function(b){var w=this,k=[0],S=[],C=[null],_=[],L=this.table,O="",D=0,z=0,F=2,A=1,R=_.slice.call(arguments,1),N=Object.create(this.lexer),M={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(M.yy[I]=this.yy[I]);N.setInput(b,M.yy),M.yy.lexer=N,M.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var $=N.yylloc;_.push($);var P=N.options&&N.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(oe){k.length=k.length-2*oe,C.length=C.length-oe,_.length=_.length-oe}T(B,"popStack");function q(){var oe;return oe=S.pop()||N.lex()||A,typeof oe!="number"&&(oe instanceof Array&&(S=oe,oe=S.pop()),oe=w.symbols_[oe]||oe),oe}T(q,"lex");for(var V,X,W,ie,K={},se,te,Z,ee;;){if(X=k[k.length-1],this.defaultActions[X]?W=this.defaultActions[X]:((V===null||typeof V>"u")&&(V=q()),W=L[X]&&L[X][V]),typeof W>"u"||!W.length||!W[0]){var ne="";ee=[];for(se in L[X])this.terminals_[se]&&se>F&&ee.push("'"+this.terminals_[se]+"'");N.showPosition?ne="Parse error on line "+(D+1)+`: -`+N.showPosition()+` -Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error on line "+(D+1)+": Unexpected "+(V==A?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ne,{text:N.match,token:this.terminals_[V]||V,line:N.yylineno,loc:$,expected:ee})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+V);switch(W[0]){case 1:k.push(V),C.push(N.yytext),_.push(N.yylloc),k.push(W[1]),V=null,z=N.yyleng,O=N.yytext,D=N.yylineno,$=N.yylloc;break;case 2:if(te=this.productions_[W[1]][1],K.$=C[C.length-te],K._$={first_line:_[_.length-(te||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(te||1)].first_column,last_column:_[_.length-1].last_column},P&&(K._$.range=[_[_.length-(te||1)].range[0],_[_.length-1].range[1]]),ie=this.performAction.apply(K,[O,z,D,M.yy,W[1],C,_].concat(R)),typeof ie<"u")return ie;te&&(k=k.slice(0,-1*te*2),C=C.slice(0,-1*te),_=_.slice(0,-1*te)),k.push(this.productions_[W[1]][0]),C.push(K.$),_.push(K._$),Z=L[k[k.length-2]][k[k.length-1]],k.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var x={EOF:1,parseError:T(function(w,k){if(this.yy.parser)this.yy.parser.parseError(w,k);else throw new Error(w)},"parseError"),setInput:T(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:T(function(b){var w=b.length,k=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===S.length?this.yylloc.first_column:0)+S[S.length-k.length].length-k[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(b){this.unput(this.match.slice(b))},"less"),pastInput:T(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+w+"^"},"showPosition"),test_match:T(function(b,w){var k,S,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],k=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var _ in C)this[_]=C[_];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,k,S;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),_=0;_w[0].length)){if(w=k,S=_,this.options.backtrack_lexer){if(b=this.test_match(k,C[_]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,C[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var w=this.next();return w||this.lex()},"lex"),begin:T(function(w){this.conditionStack.push(w)},"begin"),popState:T(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:T(function(w){this.begin(w)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(w,k,S,C){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return x})();m.lexer=y;function v(){this.yy={}}return T(v,"Parser"),v.prototype=m,m.Parser=v,new v})();VP.parser=VP;var omt=VP,WP=[],UP=[],HP=[],YP=new Set,XP,KP=!1,lmt=T((t,e,r)=>{const n=o6(t).sort(),i=r??10/Math.pow(t.length,2);XP=n,n.length===1&&YP.add(n[0]),WP.push({sets:n,size:i,label:e?uw(e):void 0})},"addSubsetData"),cmt=T(()=>WP,"getSubsetData"),uw=T(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),umt=T(t=>t&&uw(t),"normalizeStyleValue"),hmt=T((t,e,r)=>{const n=uw(e);UP.push({sets:o6(t).sort(),id:n,label:r?uw(r):void 0})},"addTextData"),dmt=T((t,e)=>{const r=o6(t).sort(),n={};for(const[i,a]of e)n[i]=umt(a)??a;HP.push({targets:r,styles:n})},"addStyleData"),fmt=T(()=>HP,"getStyleData"),o6=T(t=>t.map(e=>uw(e)),"normalizeIdentifierList"),pmt=T(t=>{const r=o6(t).filter(n=>!YP.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),gmt=T(()=>UP,"getTextData"),mmt=T(()=>XP,"getCurrentSets"),ymt=T(()=>KP,"getIndentMode"),vmt=T(t=>{KP=t},"setIndentMode"),bmt=Fr.venn;function zve(){return ti(bmt,lr().venn)}T(zve,"getConfig");var xmt=T(()=>{Dn(),WP.length=0,UP.length=0,HP.length=0,YP.clear(),XP=void 0,KP=!1},"customClear"),Tmt={getConfig:zve,clear:xmt,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,getAccDescription:Vn,setAccDescription:qn,addSubsetData:lmt,getSubsetData:cmt,addTextData:hmt,addStyleData:dmt,validateUnionIdentifiers:pmt,getTextData:gmt,getStyleData:fmt,getCurrentSets:mmt,getIndentMode:ymt,setIndentMode:vmt},wmt=T(t=>` +A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Pwe(t,e){return $we(Owe(t),e)}function uxt(t,e={}){const{lossFunction:r,layoutFunction:n=Ewe,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?c1:r==="logRatio"?_we:r,distinct:f});i&&(g=Rwe(g,a,s));const m=Lwe(g,o,l,u,h),y=Nwe(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const C=w.sets.map(E=>v.get(E)),k=Owe(C),S=$we(k,p);return{circles:C,arcs:k,path:S,area:w,has:new Set(w.sets)}});function x(w){let C="";for(const k of T)k.has.size>w.length&&w.every(S=>k.has.has(S))&&(C+=" "+k.path);return C}return T.map(({circles:w,arcs:C,path:k,area:S})=>({data:S,text:y[S.sets],circles:w,arcs:C,path:k,distinctPath:k+x(S.sets)}))}var Rz=(function(){var t=b(function(T,x,w,C){for(w=w||{},C=T.length;C--;w[T[C]]=x);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:b(function(x,w,C,k,S,E,L){var M=E.length-1;switch(S){case 1:return E[M-1];case 2:case 3:case 4:this.$=[];break;case 5:E[M-1].push(E[M]),this.$=E[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[M];break;case 8:k.setDiagramTitle(E[M].substr(6)),this.$=E[M].substr(6);break;case 9:k.addSubsetData([E[M]],void 0,void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 10:k.addSubsetData([E[M-1]],E[M],void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 11:k.addSubsetData([E[M-2]],void 0,parseFloat(E[M])),k.setIndentMode&&k.setIndentMode(!0);break;case 12:k.addSubsetData([E[M-3]],E[M-2],parseFloat(E[M])),k.setIndentMode&&k.setIndentMode(!0);break;case 13:if(E[M].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(E[M]),k.addSubsetData(E[M],void 0,void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 14:if(E[M-1].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(E[M-1]),k.addSubsetData(E[M-1],E[M],void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 15:if(E[M-2].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(E[M-2]),k.addSubsetData(E[M-2],void 0,parseFloat(E[M])),k.setIndentMode&&k.setIndentMode(!0);break;case 16:if(E[M-3].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(E[M-3]),k.addSubsetData(E[M-3],E[M-2],parseFloat(E[M])),k.setIndentMode&&k.setIndentMode(!0);break;case 17:case 18:case 19:k.addTextData(E[M-1],E[M],void 0);break;case 20:case 21:k.addTextData(E[M-2],E[M-1],E[M]);break;case 23:k.addStyleData(E[M-1],E[M]);break;case 24:case 25:case 26:var I=k.getCurrentSets();if(!I)throw new Error("text requires set");k.addTextData(I,E[M],void 0);break;case 27:case 28:var I=k.getCurrentSets();if(!I)throw new Error("text requires set");k.addTextData(I,E[M-1],E[M]);break;case 29:case 41:this.$=[E[M]];break;case 30:case 42:this.$=[...E[M-2],E[M]];break;case 31:this.$=[E[M-2],E[M]];break;case 33:this.$=E[M].join(" ");break;case 34:this.$=[E[M]];break;case 35:E[M-1].push(E[M]),this.$=E[M-1];break;case 43:case 44:this.$=E[M];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:b(function(x,w){if(w.recoverable)this.trace(x);else{var C=new Error(x);throw C.hash=w,C}},"parseError"),parse:b(function(x){var w=this,C=[0],k=[],S=[null],E=[],L=this.table,M="",I=0,P=0,$=2,_=1,R=E.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(D.yy[N]=this.yy[N]);O.setInput(x,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var B=O.yylloc;E.push(B);var F=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(ge){C.length=C.length-2*ge,S.length=S.length-ge,E.length=E.length-ge}b(G,"popStack");function z(){var ge;return ge=k.pop()||O.lex()||_,typeof ge!="number"&&(ge instanceof Array&&(k=ge,ge=k.pop()),ge=w.symbols_[ge]||ge),ge}b(z,"lex");for(var W,V,H,te,Y={},se,J,Z,ee;;){if(V=C[C.length-1],this.defaultActions[V]?H=this.defaultActions[V]:((W===null||typeof W>"u")&&(W=z()),H=L[V]&&L[V][W]),typeof H>"u"||!H.length||!H[0]){var re="";ee=[];for(se in L[V])this.terminals_[se]&&se>$&&ee.push("'"+this.terminals_[se]+"'");O.showPosition?re="Parse error on line "+(I+1)+`: +`+O.showPosition()+` +Expecting `+ee.join(", ")+", got '"+(this.terminals_[W]||W)+"'":re="Parse error on line "+(I+1)+": Unexpected "+(W==_?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(re,{text:O.match,token:this.terminals_[W]||W,line:O.yylineno,loc:B,expected:ee})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+W);switch(H[0]){case 1:C.push(W),S.push(O.yytext),E.push(O.yylloc),C.push(H[1]),W=null,P=O.yyleng,M=O.yytext,I=O.yylineno,B=O.yylloc;break;case 2:if(J=this.productions_[H[1]][1],Y.$=S[S.length-J],Y._$={first_line:E[E.length-(J||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(J||1)].first_column,last_column:E[E.length-1].last_column},F&&(Y._$.range=[E[E.length-(J||1)].range[0],E[E.length-1].range[1]]),te=this.performAction.apply(Y,[M,P,I,D.yy,H[1],S,E].concat(R)),typeof te<"u")return te;J&&(C=C.slice(0,-1*J*2),S=S.slice(0,-1*J),E=E.slice(0,-1*J)),C.push(this.productions_[H[1]][0]),S.push(Y.$),E.push(Y._$),Z=L[C[C.length-2]][C[C.length-1]],C.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:b(function(w,C){if(this.yy.parser)this.yy.parser.parseError(w,C);else throw new Error(w)},"parseError"),setInput:b(function(x,w){return this.yy=w||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var w=x.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:b(function(x){var w=x.length,C=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===k.length?this.yylloc.first_column:0)+k[k.length-C.length].length-C[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(x){this.unput(this.match.slice(x))},"less"),pastInput:b(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var x=this.pastInput(),w=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+w+"^"},"showPosition"),test_match:b(function(x,w){var C,k,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),k=x[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],C=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in S)this[E]=S[E];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,w,C,k;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),E=0;Ew[0].length)){if(w=C,k=E,this.options.backtrack_lexer){if(x=this.test_match(C,S[E]),x!==!1)return x;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(x=this.test_match(w,S[k]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var w=this.next();return w||this.lex()},"lex"),begin:b(function(w){this.conditionStack.push(w)},"begin"),popState:b(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:b(function(w){this.begin(w)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:b(function(w,C,k,S){switch(k){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return b(v,"Parser"),v.prototype=m,m.Parser=v,new v})();Rz.parser=Rz;var hxt=Rz,Lz=[],Iz=[],Mz=[],Dz=new Set,Nz,Oz=!1,dxt=b((t,e,r)=>{const n=_6(t).sort(),i=r??10/Math.pow(t.length,2);Nz=n,n.length===1&&Dz.add(n[0]),Lz.push({sets:n,size:i,label:e?lC(e):void 0})},"addSubsetData"),fxt=b(()=>Lz,"getSubsetData"),lC=b(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),pxt=b(t=>t&&lC(t),"normalizeStyleValue"),gxt=b((t,e,r)=>{const n=lC(e);Iz.push({sets:_6(t).sort(),id:n,label:r?lC(r):void 0})},"addTextData"),mxt=b((t,e)=>{const r=_6(t).sort(),n={};for(const[i,a]of e)n[i]=pxt(a)??a;Mz.push({targets:r,styles:n})},"addStyleData"),yxt=b(()=>Mz,"getStyleData"),_6=b(t=>t.map(e=>lC(e)),"normalizeIdentifierList"),vxt=b(t=>{const r=_6(t).filter(n=>!Dz.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),bxt=b(()=>Iz,"getTextData"),xxt=b(()=>Nz,"getCurrentSets"),Txt=b(()=>Oz,"getIndentMode"),wxt=b(t=>{Oz=t},"setIndentMode"),Cxt=jr.venn;function Bwe(){return ri(Cxt,sr().venn)}b(Bwe,"getConfig");var Sxt=b(()=>{zn(),Lz.length=0,Iz.length=0,Mz.length=0,Dz.clear(),Nz=void 0,Oz=!1},"customClear"),kxt={getConfig:Bwe,clear:Sxt,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn,addSubsetData:dxt,getSubsetData:fxt,addTextData:gxt,addStyleData:mxt,validateUnionIdentifiers:vxt,getTextData:bxt,getStyleData:yxt,getCurrentSets:xxt,getIndentMode:Txt,setIndentMode:wxt},Ext=b(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3279,7 +3312,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),Cmt=wmt;function Gve(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}T(Gve,"buildStyleByKey");var kmt=T((t,e,r,n)=>{var A,R,N;const i=n.db,a=(A=i.getConfig)==null?void 0:A.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=lr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(R=i.getDiagramTitle)==null?void 0:R.call(i),f=i.getSubsetData(),p=i.getTextData(),g=Gve(i.getStyleData()),m=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,x=m/1600,b=d?48*x:0,w=s.primaryTextColor??s.textColor,k=ms(e);k.attr("viewBox",`0 0 ${m} ${y}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const S=pt(document.createElement("div")),C=rmt().width(m).height(y-b);S.datum(f).call(C);const _=u?jt.svg(S.select("svg").node()):void 0,L=smt(f,{width:m,height:y-b,padding:(a==null?void 0:a.padding)??15}),O=new Map;for(const M of L){const I=Ph([...M.data.sets].sort());O.set(I,M)}p.length>0&&qve(a,O,S,p,x,g);const D=Fa(s.background||"#f4f4f4");S.selectAll(".venn-circle").each(function(M,I){var se;const $=pt(this),B=Ph([...M.sets].sort()),q=g.get(B),V=(q==null?void 0:q.fill)||h[I%h.length]||s.primaryColor;$.classed(`venn-set-${I%8}`,!0);const X=(q==null?void 0:q["fill-opacity"])??.1,W=(q==null?void 0:q.stroke)||V,ie=(q==null?void 0:q["stroke-width"])||`${5*x}`;if(u&&_){const te=O.get(B);if(te&&te.circles.length>0){const Z=te.circles[0],ee=_.circle(Z.x,Z.y,Z.radius*2,{roughness:.7,seed:l,fill:hB(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+I*60,stroke:W,strokeWidth:parseFloat(String(ie))});$.select("path").remove(),(se=$.node())==null||se.insertBefore(ee,$.select("text").node())}}else $.select("path").style("fill",V).style("fill-opacity",X).style("stroke",W).style("stroke-width",ie).style("stroke-opacity",.95);const K=(q==null?void 0:q.color)||(D?at(V,30):st(V,30));$.select("text").style("font-size",`${48*x}px`).style("fill",K)}),u&&_?S.selectAll(".venn-intersection").each(function(M){var V;const I=pt(this),P=Ph([...M.sets].sort()),B=g.get(P),q=B==null?void 0:B.fill;if(q){const X=I.select("path"),W=X.attr("d");if(W){const ie=_.path(W,{roughness:.7,seed:l,fill:hB(q,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),K=X.node();(V=K==null?void 0:K.parentNode)==null||V.insertBefore(ie,K),X.remove()}}else I.select("path").style("fill-opacity",0);I.select("text").style("font-size",`${48*x}px`).style("fill",(B==null?void 0:B.color)??s.vennSetTextColor??w)}):(S.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",M=>{var P;const $=Ph([...M.sets].sort());return((P=g.get($))==null?void 0:P.color)??s.vennSetTextColor??w}),S.selectAll(".venn-intersection path").style("fill-opacity",M=>{var P;const $=Ph([...M.sets].sort());return(P=g.get($))!=null&&P.fill?1:0}).style("fill",M=>{var P;const $=Ph([...M.sets].sort());return((P=g.get($))==null?void 0:P.fill)??"transparent"}));const z=k.append("g").attr("transform",`translate(0, ${b})`),F=S.select("svg").node();if(F&&"childNodes"in F)for(const M of[...F.childNodes])(N=z.node())==null||N.appendChild(M);vi(k,y,m,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Ph(t){return t.join("|")}T(Ph,"stableSetsKey");function qve(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Ph(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,x*2*.95),k=Math.max(60*i,x*2*.95),_=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),L=g-w/2,O=m-k/2+_,D=Math.max(1,Math.ceil(Math.sqrt(f.length))),z=Math.max(1,Math.ceil(f.length/D)),F=w/D,A=k/z;for(const[R,N]of f.entries()){const M=R%D,I=Math.floor(R/D),$=L+F*(M+.5),P=O+A*(I+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",L+F*M).attr("y",O+A*I).attr("width",F).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=F*.9,q=A*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",q).attr("x",$-B/2).attr("y",P-q/2).attr("overflow","visible"),X=(h=a.get(N.id))==null?void 0:h.color,W=V.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(N.label??N.id);X&&W.style("color",X)}}}T(qve,"renderTextNodes");var Emt={draw:kmt},Smt={parser:omt,db:Tmt,renderer:Emt,styles:Cmt};const Amt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Smt},Symbol.toStringTag,{value:"Module"}));var Vve=(Zv=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Mn,this.getAccTitle=Gn,this.setDiagramTitle=Wn,this.getDiagramTitle=Nn,this.getAccDescription=Vn,this.setAccDescription=qn}getNodes(){return this.nodes}getConfig(){const e=Fr,r=lr();return ti({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{w_(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Dn(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},T(Zv,"TreeMapDB"),Zv);function Wve(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}T(Wve,"buildHierarchy");var _mt=T((t,e)=>{Fl(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=Rmt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=Wve(r),i=T((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),Rmt=T(t=>t.name?String(t.name):"","getItemName"),Uve={parser:{yy:void 0},parse:T(async t=>{var e;try{const n=await Qo("treemap",t);ae.debug("Treemap AST:",n);const i=(e=Uve.parser)==null?void 0:e.yy;if(!(i instanceof Vve))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");_mt(n,i)}catch(r){throw ae.error("Error parsing treemap:",r),r}},"parse")},Lmt=10,ym=10,hw=25,Imt=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??Lmt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=lr();if(!l)return;const h=o?30:0,d=ms(e),f=a.nodeWidth?a.nodeWidth*ym:960,p=a.nodeHeight?a.nodeHeight*ym:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),vi(d,m,g,a.useMaxWidth);let y;try{const A=a.valueFormat||",";if(A==="$0,0")y=T(R=>"$"+Qh(",")(R),"valueFormat");else if(A.startsWith("$")&&A.includes(",")){const R=/\.\d+/.exec(A),N=R?R[0]:"";y=T(M=>"$"+Qh(","+N)(M),"valueFormat")}else if(A.startsWith("$")){const R=A.substring(1);y=T(N=>"$"+Qh(R||"")(N),"valueFormat")}else y=Qh(A)}catch(A){ae.error("Error creating format function:",A),y=Qh(",")}const v=Jh().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),x=Jh().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Jh().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=xA(l).sum(A=>A.value??0).sort((A,R)=>(R.value??0)-(A.value??0)),C=E5e().size([f,p]).paddingTop(A=>A.children&&A.children.length>0?hw+ym:0).paddingInner(s).paddingLeft(A=>A.children&&A.children.length>0?ym:0).paddingRight(A=>A.children&&A.children.length>0?ym:0).paddingBottom(A=>A.children&&A.children.length>0?ym:0).round(!0)(k),_=C.descendants().filter(A=>A.children&&A.children.length>0),L=w.selectAll(".treemapSection").data(_).enter().append("g").attr("class","treemapSection").attr("transform",A=>`translate(${A.x0},${A.y0})`);L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",hw).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",A=>A.depth===0?"display: none;":""),L.append("clipPath").attr("id",(A,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-12)).attr("height",hw),L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class",(A,R)=>`treemapSection section${R}`).attr("fill",A=>v(A.data.name)).attr("fill-opacity",.6).attr("stroke",A=>x(A.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",A=>{if(A.depth===0)return"display: none;";const R=Kt({cssCompiledStyles:A.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",hw/2).attr("dominant-baseline","middle").text(A=>A.depth===0?"":A.data.name).attr("font-weight","bold").attr("style",A=>{if(A.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Kt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).each(function(A){if(A.depth===0)return;const R=pt(this),N=A.data.name;R.text(N);const M=A.x1-A.x0,I=6;let $;a.showValues!==!1&&A.value?$=M-10-30-10-I:$=M-I-6;const B=Math.max(15,$),q=R.node();if(q.getComputedTextLength()>B){let W=N;for(;W.length>0;){if(W=N.substring(0,W.length-1),W.length===0){R.text("..."),q.getComputedTextLength()>B&&R.text("");break}if(R.text(W+"..."),q.getComputedTextLength()<=B)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",A=>A.x1-A.x0-10).attr("y",hw/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(A=>A.value?y(A.value):"").attr("font-style","italic").attr("style",A=>{if(A.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Kt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")});const O=C.leaves(),D=w.selectAll(".treemapLeafGroup").data(O).enter().append("g").attr("class",(A,R)=>`treemapNode treemapLeafGroup leaf${R}${A.data.classSelector?` ${A.data.classSelector}`:""}x`).attr("transform",A=>`translate(${A.x0},${A.y0})`);D.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class","treemapLeaf").attr("fill",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("style",A=>Kt({cssCompiledStyles:A.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("stroke-width",3),D.append("clipPath").attr("id",(A,R)=>`clip-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-4)).attr("height",A=>Math.max(0,A.y1-A.y0-4)),D.append("text").attr("class","treemapLabel").attr("x",A=>(A.x1-A.x0)/2).attr("y",A=>(A.y1-A.y0)/2).attr("style",A=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+b(A.data.name)+";",N=Kt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).attr("clip-path",(A,R)=>`url(#clip-${e}-${R})`).text(A=>A.data.name).each(function(A){const R=pt(this),N=A.x1-A.x0,M=A.y1-A.y0,I=R.node(),$=4,P=N-2*$,B=M-2*$;if(P<10||B<10){R.style("display","none");return}let q=parseInt(R.style("font-size"),10);const V=8,X=28,W=.6,ie=6,K=2;for(;I.getComputedTextLength()>P&&q>V;)q--,R.style("font-size",`${q}px`);let se=Math.max(ie,Math.min(X,Math.round(q*W))),te=q+K+se;for(;te>B&&q>V&&(q--,se=Math.max(ie,Math.min(X,Math.round(q*W))),!(seP||q(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const N="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+b(R.data.name)+";",M=Kt({cssCompiledStyles:R.data.cssCompiledStyles});return N+M.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,N)=>`url(#clip-${e}-${N})`).text(R=>R.value?y(R.value):"").each(function(R){const N=pt(this),M=this.parentNode;if(!M){N.style("display","none");return}const I=pt(M).select(".treemapLabel");if(I.empty()||I.style("display")==="none"){N.style("display","none");return}const $=parseFloat(I.style("font-size")),P=28,B=.6,q=6,V=2,X=Math.max(q,Math.min(P,Math.round($*B)));N.style("font-size",`${X}px`);const ie=(R.y1-R.y0)/2+$/2+V;N.attr("y",ie);const K=R.x1-R.x0,Z=R.y1-R.y0-4,ee=K-8;N.node().getComputedTextLength()>ee||ie+X>Z||X{const e=kp(),r=lr(),n=ti(e,r.themeVariables),i=ti(Nmt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),Axt=Ext;function Fwe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}b(Fwe,"buildStyleByKey");var _xt=b((t,e,r,n)=>{var R,O,D;const i=n.db,a=(R=i.getConfig)==null?void 0:R.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=sr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(O=i.getDiagramTitle)==null?void 0:O.call(i),f=i.getSubsetData(),p=i.getTextData(),g=Fwe(i.getStyleData()),m=Gwe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,x=y/1600,w=d?48*x:0,C=s.primaryTextColor??s.textColor,k=Ka(e);k.attr("viewBox",`0 0 ${y} ${v}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const S=mt(document.createElement("div")),E=sxt().width(y).height(v-w);S.datum(m).call(E);const L=u?tr.svg(S.select("svg").node()):void 0,M=uxt(m,{width:y,height:v-w,padding:(a==null?void 0:a.padding)??15}),I=new Map;for(const N of M){const B=bd([...N.data.sets].sort());I.set(B,N)}p.length>0&&zwe(a,I,S,p,x,g);const P=ls(s.background||"#f4f4f4");S.selectAll(".venn-circle").each(function(N,B){var J;const F=mt(this),z=bd([...N.sets].sort()),W=g.get(z),V=(W==null?void 0:W.fill)||h[B%h.length]||s.primaryColor;F.classed(`venn-set-${B%8}`,!0);const H=(W==null?void 0:W["fill-opacity"])??.1,te=(W==null?void 0:W.stroke)||V,Y=(W==null?void 0:W["stroke-width"])||`${5*x}`;if(u&&L){const Z=I.get(z);if(Z&&Z.circles.length>0){const ee=Z.circles[0],re=L.circle(ee.x,ee.y,ee.radius*2,{roughness:.7,seed:l,fill:iG(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+B*60,stroke:te,strokeWidth:parseFloat(String(Y))});F.select("path").remove(),(J=F.node())==null||J.insertBefore(re,F.select("text").node())}}else F.select("path").style("fill",V).style("fill-opacity",H).style("stroke",te).style("stroke-width",Y).style("stroke-opacity",.95);const se=(W==null?void 0:W.color)||(P?st(V,30):ot(V,30));F.select("text").style("font-size",`${48*x}px`).style("fill",se)}),u&&L?S.selectAll(".venn-intersection").each(function(N){var V;const B=mt(this),G=bd([...N.sets].sort()),z=g.get(G),W=z==null?void 0:z.fill;if(W){const H=B.select("path"),te=H.attr("d");if(te){const Y=L.path(te,{roughness:.7,seed:l,fill:iG(W,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),se=H.node();(V=se==null?void 0:se.parentNode)==null||V.insertBefore(Y,se),H.remove()}}else B.select("path").style("fill-opacity",0);B.select("text").style("font-size",`${48*x}px`).style("fill",(z==null?void 0:z.color)??s.vennSetTextColor??C)}):(S.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",N=>{var G;const F=bd([...N.sets].sort());return((G=g.get(F))==null?void 0:G.color)??s.vennSetTextColor??C}),S.selectAll(".venn-intersection path").style("fill-opacity",N=>{var G;const F=bd([...N.sets].sort());return(G=g.get(F))!=null&&G.fill?1:0}).style("fill",N=>{var G;const F=bd([...N.sets].sort());return((G=g.get(F))==null?void 0:G.fill)??"transparent"}));const $=k.append("g").attr("transform",`translate(0, ${w})`),_=S.select("svg").node();if(_&&"childNodes"in _)for(const N of[..._.childNodes])(D=$.node())==null||D.appendChild(N);bi(k,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function bd(t){return t.join("|")}b(bd,"stableSetsKey");function zwe(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=bd(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const x=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&x.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),C=Math.max(60*i,T*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),L=g-w/2,M=m-C/2+E,I=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/I)),$=w/I,_=C/P;for(const[R,O]of f.entries()){const D=R%I,N=Math.floor(R/I),B=L+$*(D+.5),F=M+_*(N+.5);s&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",L+$*D).attr("y",M+_*N).attr("width",$).attr("height",_).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const G=$*.9,z=_*.9,W=x.append("foreignObject").attr("class","venn-text-node-fo").attr("width",G).attr("height",z).attr("x",B-G/2).attr("y",F-z/2).attr("overflow","visible"),V=(h=a.get(O.id))==null?void 0:h.color,H=W.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(O.label??O.id);V&&H.style("color",V)}}}b(zwe,"renderTextNodes");function Gwe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}b(Gwe,"ensurePairwiseSubsets");var Rxt={draw:_xt},Lxt={parser:hxt,db:kxt,renderer:Rxt,styles:Axt};const Ixt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lxt},Symbol.toStringTag,{value:"Module"}));var Wwe=(H2=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=qn,this.getAccTitle=Qn,this.setDiagramTitle=ti,this.getDiagramTitle=Vn,this.getAccDescription=ei,this.setAccDescription=Jn}getNodes(){return this.nodes}getConfig(){const e=jr,r=sr();return ri({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{MR(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){zn(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},b(H2,"TreeMapDB"),H2);function qwe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}b(qwe,"buildHierarchy");var Mxt=b((t,e)=>{Cs(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=Dxt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=qwe(r),i=b((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),Dxt=b(t=>t.name?String(t.name):"","getItemName"),Vwe={parser:{yy:void 0},parse:b(async t=>{var e;try{const n=await Xo("treemap",t);he.debug("Treemap AST:",n);const i=(e=Vwe.parser)==null?void 0:e.yy;if(!(i instanceof Wwe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mxt(n,i)}catch(r){throw he.error("Error parsing treemap:",r),r}},"parse")},Nxt=10,u1=10,cC=25,Oxt=b((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??Nxt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=sr();if(!l)return;const h=o?30:0,d=Ka(e),f=a.nodeWidth?a.nodeWidth*u1:960,p=a.nodeHeight?a.nodeHeight*u1:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),bi(d,m,g,a.useMaxWidth);let y;try{const z=a.valueFormat||",";if(z==="$0,0")y=b(W=>"$"+$d(",")(W),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const W=/\.\d+/.exec(z),V=W?W[0]:"";y=b(H=>"$"+$d(","+V)(H),"valueFormat")}else if(z.startsWith("$")){const W=z.substring(1);y=b(V=>"$"+$d(W||"")(V),"valueFormat")}else y=$d(z)}catch(z){he.error("Error creating format function:",z),y=$d(",")}const v=Pd().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=Pd().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),x=Pd().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=H_(l).sum(z=>z.value??0).sort((z,W)=>(W.value??0)-(z.value??0)),S=VAe().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?cC+u1:0).paddingInner(s).paddingLeft(z=>z.children&&z.children.length>0?u1:0).paddingRight(z=>z.children&&z.children.length>0?u1:0).paddingBottom(z=>z.children&&z.children.length>0?u1:0).round(!0)(C),E=S.descendants().filter(z=>z.children&&z.children.length>0),L=w.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",z=>`translate(${z.x0},${z.y0})`);L.append("rect").attr("width",z=>z.x1-z.x0).attr("height",cC).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",z=>z.depth===0?"display: none;":""),L.append("clipPath").attr("id",(z,W)=>`clip-section-${e}-${W}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-12)).attr("height",cC),L.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class",(z,W)=>`treemapSection section${W}`).attr("fill",z=>v(z.data.name)).attr("fill-opacity",.6).attr("stroke",z=>T(z.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",z=>{if(z.depth===0)return"display: none;";const W=Qt({cssCompiledStyles:z.data.cssCompiledStyles});return W.nodeStyles+";"+W.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",cC/2).attr("dominant-baseline","middle").text(z=>z.depth===0?"":z.data.name).attr("font-weight","bold").attr("clip-path",(z,W)=>`url(#clip-section-${e}-${W})`).attr("style",z=>{if(z.depth===0)return"display: none;";const W="dominant-baseline: middle; font-size: 12px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",V=Qt({cssCompiledStyles:z.data.cssCompiledStyles});return W+V.labelStyles.replace("color:","fill:")}).each(function(z){if(z.depth===0)return;const W=mt(this),V=z.data.name;W.text(V);const H=z.x1-z.x0,te=6;let Y;a.showValues!==!1&&z.value?Y=H-10-30-10-te:Y=H-te-6;const J=Math.max(15,Y),Z=W.node();if(Z.getComputedTextLength()>J){let ge=V;for(;ge.length>0;){if(ge=V.substring(0,ge.length-1),ge.length===0){W.text("..."),Z.getComputedTextLength()>J&&W.text("");break}if(W.text(ge+"..."),Z.getComputedTextLength()<=J)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",cC/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(z=>z.value?y(z.value):"").attr("font-style","italic").attr("style",z=>{if(z.depth===0)return"display: none;";const W="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",V=Qt({cssCompiledStyles:z.data.cssCompiledStyles});return W+V.labelStyles.replace("color:","fill:")});const M=S.leaves(),I=M.length>20,P=I?16:38,$=I?14:28,_=I?4:8,R=I?4:6,O=I?2:4,D=I?8:10,N=I?1:2,B=w.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(z,W)=>`treemapNode treemapLeafGroup leaf${W}${z.data.classSelector?` ${z.data.classSelector}`:""}x`).attr("transform",z=>`translate(${z.x0},${z.y0})`);B.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class","treemapLeaf").attr("fill",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("style",z=>Qt({cssCompiledStyles:z.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("stroke-width",3),B.append("clipPath").attr("id",(z,W)=>`clip-${e}-${W}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-4)).attr("height",z=>Math.max(0,z.y1-z.y0-4)),B.append("text").attr("class","treemapLabel").attr("x",z=>(z.x1-z.x0)/2).attr("y",z=>(z.y1-z.y0)/2).attr("style",z=>{const W=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+x(z.data.name)+";",V=Qt({cssCompiledStyles:z.data.cssCompiledStyles});return W+V.labelStyles.replace("color:","fill:")}).attr("clip-path",(z,W)=>`url(#clip-${e}-${W})`).text(z=>z.data.name).each(function(z){const W=mt(this),V=z.x1-z.x0,H=z.y1-z.y0,te=W.node(),Y=V-2*O,se=H-2*O;if(YY&&J>_;)J--,W.style("font-size",`${J}px`);let ee=Math.max(R,Math.min($,Math.round(J*Z))),re=J+N+ee;for(;re>se&&J>_&&(J--,ee=Math.max(R,Math.min($,Math.round(J*Z))),!(eeY||J<_||se(W.x1-W.x0)/2).attr("y",function(W){return(W.y1-W.y0)/2}).attr("style",W=>{const V=`text-anchor: middle; dominant-baseline: hanging; font-size: ${$}px;fill:`+x(W.data.name)+";",H=Qt({cssCompiledStyles:W.data.cssCompiledStyles});return V+H.labelStyles.replace("color:","fill:")}).attr("clip-path",(W,V)=>`url(#clip-${e}-${V})`).text(W=>W.value?y(W.value):"").each(function(W){const V=mt(this),H=this.parentNode;if(!H){V.style("display","none");return}const te=mt(H).select(".treemapLabel");if(te.empty()||te.style("display")==="none"){V.style("display","none");return}const Y=parseFloat(te.style("font-size")),J=Math.max(R,Math.min($,Math.round(Y*.6)));V.style("font-size",`${J}px`);const ee=(W.y1-W.y0)/2+Y/2+N;V.attr("y",ee);const re=W.x1-W.x0,_e=W.y1-W.y0-4,Fe=re-2*O;V.node().getComputedTextLength()>Fe||ee+J>_e||J{const e=Gc(),r=sr(),n=ri(e,r.themeVariables),i=ri(Bxt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3302,26 +3335,26 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),$mt=Omt,Pmt={parser:Uve,get db(){return new Vve},renderer:Mmt,styles:$mt};const Bmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pmt},Symbol.toStringTag,{value:"Module"}));var l6=T((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),op=T((t,e,r)=>({x:l6(e,`${r} evolution`),y:l6(t,`${r} visibility`)}),"toCoordinates"),Hve=T(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),Fmt=T(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),zmt=T((t,e)=>{if(Fl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=op(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=op(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=op(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=l6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Hve(r.fromPort)??Hve(r.toPort);const{flow:a,label:s}=Fmt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=l6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=op(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=op(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=op(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=op(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),Yve={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("wardley",t);ae.debug(e);const r=(n=Yve.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");zmt(e,r)},"parse")},Gmt=(Qv=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},T(Qv,"WardleyBuilder"),Qv),$a=new Gmt;function Xve(){return $e()["wardley-beta"]}T(Xve,"getConfig");function Kve(t,e,r,n,i,a,s,o,l){$a.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}T(Kve,"addNode");function jve(t,e,r=!1,n,i){$a.addLink({source:t,target:e,dashed:r,label:n,flow:i})}T(jve,"addLink");function Zve(t,e,r){$a.addTrend({nodeId:t,targetX:e,targetY:r})}T(Zve,"addTrend");function Qve(t,e,r){$a.addAnnotation({number:t,coordinates:e,text:r})}T(Qve,"addAnnotation");function Jve(t,e,r){$a.addNote({text:t,x:e,y:r})}T(Jve,"addNote");function e2e(t,e,r){$a.addAccelerator({name:t,x:e,y:r})}T(e2e,"addAccelerator");function t2e(t,e,r){$a.addDeaccelerator({name:t,x:e,y:r})}T(t2e,"addDeaccelerator");function r2e(t,e){$a.setAnnotationsBox(t,e)}T(r2e,"setAnnotationsBox");function n2e(t,e){$a.setSize(t,e)}T(n2e,"setSize");function i2e(t){$a.startPipeline(t)}T(i2e,"startPipeline");function a2e(t,e){$a.addPipelineComponent(t,e)}T(a2e,"addPipelineComponent");function s2e(t){$a.setAxes(t)}T(s2e,"updateAxes");function o2e(t){return $a.getNode(t)}T(o2e,"getNode");function l2e(t){return $a.resolveNodeId(t)}T(l2e,"resolveNodeId");function c2e(){return $a.build()}T(c2e,"getWardleyData");function u2e(){$a.clear(),Dn()}T(u2e,"clear");var qmt={getConfig:Xve,addNode:Kve,addLink:jve,addTrend:Zve,addAnnotation:Qve,addNote:Jve,addAccelerator:e2e,addDeaccelerator:t2e,setAnnotationsBox:r2e,setSize:n2e,startPipeline:i2e,addPipelineComponent:a2e,updateAxes:s2e,getNode:o2e,resolveNodeId:l2e,getWardleyData:c2e,clear:u2e,setAccTitle:Mn,getAccTitle:Gn,setDiagramTitle:Wn,getDiagramTitle:Nn,getAccDescription:Vn,setAccDescription:qn},Vmt=["Genesis","Custom Built","Product","Commodity"],Wmt=T(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=$e();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Umt=T(()=>{const t=$e()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Hmt=T((t,e,r,n)=>{var I,$;ae.debug(`Rendering Wardley map -`+t);const i=Umt(),a=Wmt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((I=l.size)==null?void 0:I.width)??i.width,d=(($=l.size)==null?void 0:$.height)??i.height,f=ms(e);f.selectAll("*").remove(),vi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=T(P=>i.padding+P/100*m,"projectX"),x=T(P=>d-i.padding-P/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",k=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(k);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Vmt;if(S.length>0){const P=p.append("g").attr("class","wardley-stages"),B=l.axes.stageBoundaries,q=[];if(B&&B.length===S.length){let V=0;B.forEach(X=>{q.push({start:V,end:X}),V=X})}else{const V=1/S.length;S.forEach((X,W)=>{q.push({start:W*V,end:(W+1)*V})})}S.forEach((V,X)=>{const W=q[X],ie=i.padding+W.start*m,K=i.padding+W.end*m,se=(ie+K)/2;X>0&&P.append("line").attr("x1",ie).attr("x2",ie).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),P.append("text").attr("class","wardley-stage-label").attr("x",se).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const P=p.append("g").attr("class","wardley-grid");for(let B=1;B<4;B++){const q=B/4,V=i.padding+m*q;P.append("line").attr("x1",V).attr("x2",V).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),P.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*q).attr("y2",d-i.padding-y*q).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const C=new Map;if(l.nodes.forEach(P=>{C.set(P.id,{x:v(P.x),y:x(P.y),node:P})}),l.pipelines.length>0){const P=p.append("g").attr("class","wardley-pipelines"),B=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(q=>{if(q.componentIds.length===0)return;const V=q.componentIds.map(K=>({id:K,pos:C.get(K),node:l.nodes.find(se=>se.id===K)})).filter(K=>K.pos&&K.node).sort((K,se)=>K.node.x-se.node.x);for(let K=0;K{const se=C.get(K);se&&(X=Math.min(X,se.x),W=Math.max(W,se.x),ie=se.y)}),X!==1/0&&W!==-1/0){const se=i.nodeRadius*4,te=ie-se/2,Z=C.get(q.nodeId);if(Z){const ee=(X+W)/2;Z.x=ee,Z.y=te-s/6}P.append("rect").attr("class","wardley-pipeline-box").attr("x",X-15).attr("y",te).attr("width",W-X+30).attr("height",se).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(P=>{L.set(P.nodeId,new Set(P.componentIds))});const O=l.links.filter(P=>{if(!C.has(P.source)||!C.has(P.target))return!1;const B=L.get(P.target);return!(B!=null&&B.has(P.source))});_.selectAll("line").data(O).enter().append("line").attr("class",P=>`wardley-link${P.dashed?" wardley-link--dashed":""}`).attr("x1",P=>{const B=C.get(P.source),q=C.get(P.target),X=l.nodes.find(se=>se.id===P.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=q.x-B.x,ie=q.y-B.y,K=Math.sqrt(W*W+ie*ie);return B.x+W/K*X}).attr("y1",P=>{const B=C.get(P.source),q=C.get(P.target),X=l.nodes.find(se=>se.id===P.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=q.x-B.x,ie=q.y-B.y,K=Math.sqrt(W*W+ie*ie);return B.y+ie/K*X}).attr("x2",P=>{const B=C.get(P.source),q=C.get(P.target),X=l.nodes.find(se=>se.id===P.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=B.x-q.x,ie=B.y-q.y,K=Math.sqrt(W*W+ie*ie);return q.x+W/K*X}).attr("y2",P=>{const B=C.get(P.source),q=C.get(P.target),X=l.nodes.find(se=>se.id===P.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=B.x-q.x,ie=B.y-q.y,K=Math.sqrt(W*W+ie*ie);return q.y+ie/K*X}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",P=>P.dashed?"6 6":null).attr("marker-end",P=>P.flow==="forward"||P.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",P=>P.flow==="backward"||P.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),_.selectAll("text").data(O.filter(P=>P.label)).enter().append("text").attr("class","wardley-link-label").attr("x",P=>{const B=C.get(P.source),q=C.get(P.target),V=(B.x+q.x)/2,X=q.y-B.y,W=q.x-B.x,ie=Math.sqrt(W*W+X*X),K=8,se=X/ie;return V+se*K}).attr("y",P=>{const B=C.get(P.source),q=C.get(P.target),V=(B.y+q.y)/2,X=q.x-B.x,W=q.y-B.y,ie=Math.sqrt(X*X+W*W),K=8,se=-X/ie;return V+se*K}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",P=>{const B=C.get(P.source),q=C.get(P.target),V=(B.x+q.x)/2,X=(B.y+q.y)/2,W=q.x-B.x,ie=q.y-B.y,K=Math.sqrt(W*W+ie*ie),se=8,te=ie/K,Z=-W/K,ee=V+te*se,ne=X+Z*se;let oe=Math.atan2(ie,W)*180/Math.PI;return(oe>90||oe<-90)&&(oe+=180),`rotate(${oe} ${ee} ${ne})`}).text(P=>P.label);const D=p.append("g").attr("class","wardley-trends"),z=l.trends.map(P=>{const B=C.get(P.nodeId);if(!B)return null;const q=v(P.targetX),V=x(P.targetY),X=q-B.x,W=V-B.y,ie=Math.sqrt(X*X+W*W),K=i.nodeRadius+2,se=ie>K?q-X/ie*K:q,te=ie>K?V-W/ie*K:V;return{origin:B,targetX:q,targetY:V,adjustedX2:se,adjustedY2:te}}).filter(P=>P!==null);D.selectAll("line").data(z).enter().append("line").attr("class","wardley-trend").attr("x1",P=>P.origin.x).attr("y1",P=>P.origin.y).attr("x2",P=>P.adjustedX2).attr("y2",P=>P.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const A=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",P=>["wardley-node",P.className?`wardley-node--${P.className}`:""].filter(Boolean).join(" "));A.filter(P=>P.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(P=>P.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(P=>P.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=A.filter(P=>P.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(P=>!P.isPipelineParent&&P.sourceStrategy!=="market"&&P.className!=="anchor").append("circle").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const N=i.nodeRadius*.7,M=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",P=>C.get(P.id).x).attr("y1",P=>C.get(P.id).y-M).attr("x2",P=>C.get(P.id).x-M*Math.cos(Math.PI/6)).attr("y2",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",P=>C.get(P.id).x-M*Math.cos(Math.PI/6)).attr("y1",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("x2",P=>C.get(P.id).x+M*Math.cos(Math.PI/6)).attr("y2",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",P=>C.get(P.id).x+M*Math.cos(Math.PI/6)).attr("y1",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("x2",P=>C.get(P.id).x).attr("y2",P=>C.get(P.id).y-M).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",P=>C.get(P.id).x).attr("cy",P=>C.get(P.id).y-M).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",P=>C.get(P.id).x-M*Math.cos(Math.PI/6)).attr("cy",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",P=>C.get(P.id).x+M*Math.cos(Math.PI/6)).attr("cy",P=>C.get(P.id).y+M*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),A.filter(P=>P.isPipelineParent===!0).append("rect").attr("x",P=>C.get(P.id).x-s/2).attr("y",P=>C.get(P.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(P=>P.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",P=>{const B=C.get(P.id);let q=P.isPipelineParent?s/2+15:i.nodeRadius+15;return P.sourceStrategy&&(q+=i.nodeRadius+10),B.x+q}).attr("y1",P=>{const B=C.get(P.id),q=P.isPipelineParent?s:i.nodeRadius*2;return B.y-q/2}).attr("x2",P=>{const B=C.get(P.id);let q=P.isPipelineParent?s/2+15:i.nodeRadius+15;return P.sourceStrategy&&(q+=i.nodeRadius+10),B.x+q}).attr("y2",P=>{const B=C.get(P.id),q=P.isPipelineParent?s:i.nodeRadius*2;return B.y+q/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),A.append("text").attr("x",P=>{const B=C.get(P.id);if(P.className==="anchor")return P.labelOffsetX!==void 0?B.x+P.labelOffsetX:B.x;let q=i.nodeLabelOffset;P.sourceStrategy&&P.labelOffsetX===void 0&&(q+=10);const V=P.labelOffsetX??q;return B.x+V}).attr("y",P=>{const B=C.get(P.id);if(P.className==="anchor")return P.labelOffsetY!==void 0?B.y+P.labelOffsetY:B.y-3;let q=-i.nodeLabelOffset;P.sourceStrategy&&P.labelOffsetY===void 0&&(q-=10);const V=P.labelOffsetY??q;return B.y+V}).attr("class","wardley-node-label").attr("fill",P=>P.className==="evolved"?a.evolutionStroke:P.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",P=>P.className==="anchor"?"bold":"normal").attr("text-anchor",P=>P.className==="anchor"?"middle":"start").attr("dominant-baseline",P=>P.className==="anchor"?"middle":"auto").text(P=>P.label),l.annotations.length>0){const P=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(B=>{const q=B.coordinates.map(V=>({x:v(V.x),y:x(V.y)}));if(q.length>1)for(let V=0;V{const X=P.append("g").attr("class","wardley-annotation");X.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),X.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.number)})}),l.annotationsBox){let B=v(l.annotationsBox.x),q=x(l.annotationsBox.y);const V=10,X=16,W=11,ie=P.append("g").attr("class","wardley-annotations-box"),K=[...l.annotations].filter(te=>te.text).sort((te,Z)=>te.number-Z.number),se=[];if(K.forEach((te,Z)=>{const ee=ie.append("text").attr("x",B+V).attr("y",q+V+(Z+1)*X).attr("font-size",W).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${te.number}. ${te.text}`);se.push(ee)}),se.length>0){let te=0,Z=0;se.forEach(Ge=>{const Ce=Ge.node(),be=Ce.getComputedTextLength();te=Math.max(te,be);const Fe=Ce.getBBox();Z=Math.max(Z,Fe.height)});const ee=te+V*2+105,ne=K.length*X+V*2+Z/2,oe=i.padding,fe=h-i.padding-ee,Ae=i.padding,Re=d-i.padding-ne;B=Math.max(oe,Math.min(B,fe)),q=Math.max(Ae,Math.min(q,Re)),se.forEach((Ge,Ce)=>{Ge.attr("x",B+V).attr("y",q+V+(Ce+1)*X)}),ie.insert("rect","text").attr("x",B).attr("y",q).attr("width",ee).attr("height",ne).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const P=p.append("g").attr("class","wardley-notes");l.notes.forEach(B=>{const q=v(B.x),V=x(B.y);P.append("text").attr("x",q).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.text)})}if(l.accelerators.length>0){const P=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(B=>{const q=v(B.x),V=x(B.y),X=60,W=30,ie=20,K=` - M ${q} ${V-W/2} - L ${q+X-ie} ${V-W/2} - L ${q+X-ie} ${V-W/2-8} - L ${q+X} ${V} - L ${q+X-ie} ${V+W/2+8} - L ${q+X-ie} ${V+W/2} - L ${q} ${V+W/2} + `},"getStyles"),zxt=Fxt,Gxt={parser:Vwe,get db(){return new Wwe},renderer:Pxt,styles:zxt};const Wxt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gxt},Symbol.toStringTag,{value:"Module"}));var R6=b((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),jp=b((t,e,r)=>({x:R6(e,`${r} evolution`),y:R6(t,`${r} visibility`)}),"toCoordinates"),Uwe=b(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),qxt=b(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Vxt=b((t,e)=>{if(Cs(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=jp(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=jp(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=jp(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=R6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Uwe(r.fromPort)??Uwe(r.toPort);const{flow:a,label:s}=qxt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=R6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=jp(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=jp(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=jp(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=jp(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),Hwe={parser:{yy:void 0},parse:b(async t=>{var n;const e=await Xo("wardley",t);he.debug(e);const r=(n=Hwe.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Vxt(e,r)},"parse")},Uxt=(Y2=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},b(Y2,"WardleyBuilder"),Y2),ss=new Uxt;function Ywe(){return Ve()["wardley-beta"]}b(Ywe,"getConfig");function Xwe(t,e,r,n,i,a,s,o,l){ss.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}b(Xwe,"addNode");function jwe(t,e,r=!1,n,i){ss.addLink({source:t,target:e,dashed:r,label:n,flow:i})}b(jwe,"addLink");function Kwe(t,e,r){ss.addTrend({nodeId:t,targetX:e,targetY:r})}b(Kwe,"addTrend");function Zwe(t,e,r){ss.addAnnotation({number:t,coordinates:e,text:r})}b(Zwe,"addAnnotation");function Qwe(t,e,r){ss.addNote({text:t,x:e,y:r})}b(Qwe,"addNote");function Jwe(t,e,r){ss.addAccelerator({name:t,x:e,y:r})}b(Jwe,"addAccelerator");function eCe(t,e,r){ss.addDeaccelerator({name:t,x:e,y:r})}b(eCe,"addDeaccelerator");function tCe(t,e){ss.setAnnotationsBox(t,e)}b(tCe,"setAnnotationsBox");function rCe(t,e){ss.setSize(t,e)}b(rCe,"setSize");function nCe(t){ss.startPipeline(t)}b(nCe,"startPipeline");function iCe(t,e){ss.addPipelineComponent(t,e)}b(iCe,"addPipelineComponent");function aCe(t){ss.setAxes(t)}b(aCe,"updateAxes");function sCe(t){return ss.getNode(t)}b(sCe,"getNode");function oCe(t){return ss.resolveNodeId(t)}b(oCe,"resolveNodeId");function lCe(){return ss.build()}b(lCe,"getWardleyData");function cCe(){ss.clear(),zn()}b(cCe,"clear");var Hxt={getConfig:Ywe,addNode:Xwe,addLink:jwe,addTrend:Kwe,addAnnotation:Zwe,addNote:Qwe,addAccelerator:Jwe,addDeaccelerator:eCe,setAnnotationsBox:tCe,setSize:rCe,startPipeline:nCe,addPipelineComponent:iCe,updateAxes:aCe,getNode:sCe,resolveNodeId:oCe,getWardleyData:lCe,clear:cCe,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn},Yxt=["Genesis","Custom Built","Product","Commodity"],Xxt=b(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Ve();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),jxt=b(()=>{const t=Ve()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Kxt=b((t,e,r,n)=>{var N,B;he.debug(`Rendering Wardley map +`+t);const i=jxt(),a=Xxt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((B=l.size)==null?void 0:B.height)??i.height,f=Ka(e);f.selectAll("*").remove(),bi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=b(F=>i.padding+F/100*m,"projectX"),T=b(F=>d-i.padding-F/100*y,"projectY"),x=p.append("g").attr("class","wardley-axes");x.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),x.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";x.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),x.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const k=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Yxt;if(k.length>0){const F=p.append("g").attr("class","wardley-stages"),G=l.axes.stageBoundaries,z=[];if(G&&G.length===k.length){let W=0;G.forEach(V=>{z.push({start:W,end:V}),W=V})}else{const W=1/k.length;k.forEach((V,H)=>{z.push({start:H*W,end:(H+1)*W})})}k.forEach((W,V)=>{const H=z[V],te=i.padding+H.start*m,Y=i.padding+H.end*m,se=(te+Y)/2;V>0&&F.append("line").attr("x1",te).attr("x2",te).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),F.append("text").attr("class","wardley-stage-label").attr("x",se).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(W)})}if(i.showGrid){const F=p.append("g").attr("class","wardley-grid");for(let G=1;G<4;G++){const z=G/4,W=i.padding+m*z;F.append("line").attr("x1",W).attr("x2",W).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),F.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*z).attr("y2",d-i.padding-y*z).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const S=new Map;if(l.nodes.forEach(F=>{S.set(F.id,{x:v(F.x),y:T(F.y),node:F})}),l.pipelines.length>0){const F=p.append("g").attr("class","wardley-pipelines"),G=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(z=>{if(z.componentIds.length===0)return;const W=z.componentIds.map(Y=>({id:Y,pos:S.get(Y),node:l.nodes.find(se=>se.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,se)=>Y.node.x-se.node.x);for(let Y=0;Y{const se=S.get(Y);se&&(V=Math.min(V,se.x),H=Math.max(H,se.x),te=se.y)}),V!==1/0&&H!==-1/0){const se=i.nodeRadius*4,J=te-se/2,Z=S.get(z.nodeId);if(Z){const ee=(V+H)/2;Z.x=ee,Z.y=J-s/6}F.append("rect").attr("class","wardley-pipeline-box").attr("x",V-15).attr("y",J).attr("width",H-V+30).attr("height",se).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(F=>{L.set(F.nodeId,new Set(F.componentIds))});const M=l.links.filter(F=>{if(!S.has(F.source)||!S.has(F.target))return!1;const G=L.get(F.target);return!(G!=null&&G.has(F.source))});E.selectAll("line").data(M).enter().append("line").attr("class",F=>`wardley-link${F.dashed?" wardley-link--dashed":""}`).attr("x1",F=>{const G=S.get(F.source),z=S.get(F.target),V=l.nodes.find(se=>se.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,H=z.x-G.x,te=z.y-G.y,Y=Math.sqrt(H*H+te*te);return G.x+H/Y*V}).attr("y1",F=>{const G=S.get(F.source),z=S.get(F.target),V=l.nodes.find(se=>se.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,H=z.x-G.x,te=z.y-G.y,Y=Math.sqrt(H*H+te*te);return G.y+te/Y*V}).attr("x2",F=>{const G=S.get(F.source),z=S.get(F.target),V=l.nodes.find(se=>se.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,H=G.x-z.x,te=G.y-z.y,Y=Math.sqrt(H*H+te*te);return z.x+H/Y*V}).attr("y2",F=>{const G=S.get(F.source),z=S.get(F.target),V=l.nodes.find(se=>se.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,H=G.x-z.x,te=G.y-z.y,Y=Math.sqrt(H*H+te*te);return z.y+te/Y*V}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",F=>F.dashed?"6 6":null).attr("marker-end",F=>F.flow==="forward"||F.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",F=>F.flow==="backward"||F.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(M.filter(F=>F.label)).enter().append("text").attr("class","wardley-link-label").attr("x",F=>{const G=S.get(F.source),z=S.get(F.target),W=(G.x+z.x)/2,V=z.y-G.y,H=z.x-G.x,te=Math.sqrt(H*H+V*V),Y=8,se=V/te;return W+se*Y}).attr("y",F=>{const G=S.get(F.source),z=S.get(F.target),W=(G.y+z.y)/2,V=z.x-G.x,H=z.y-G.y,te=Math.sqrt(V*V+H*H),Y=8,se=-V/te;return W+se*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",F=>{const G=S.get(F.source),z=S.get(F.target),W=(G.x+z.x)/2,V=(G.y+z.y)/2,H=z.x-G.x,te=z.y-G.y,Y=Math.sqrt(H*H+te*te),se=8,J=te/Y,Z=-H/Y,ee=W+J*se,re=V+Z*se;let ge=Math.atan2(te,H)*180/Math.PI;return(ge>90||ge<-90)&&(ge+=180),`rotate(${ge} ${ee} ${re})`}).text(F=>F.label);const I=p.append("g").attr("class","wardley-trends"),P=l.trends.map(F=>{const G=S.get(F.nodeId);if(!G)return null;const z=v(F.targetX),W=T(F.targetY),V=z-G.x,H=W-G.y,te=Math.sqrt(V*V+H*H),Y=i.nodeRadius+2,se=te>Y?z-V/te*Y:z,J=te>Y?W-H/te*Y:W;return{origin:G,targetX:z,targetY:W,adjustedX2:se,adjustedY2:J}}).filter(F=>F!==null);I.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",F=>F.origin.x).attr("y1",F=>F.origin.y).attr("x2",F=>F.adjustedX2).attr("y2",F=>F.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const _=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",F=>["wardley-node",F.className?`wardley-node--${F.className}`:""].filter(Boolean).join(" "));_.filter(F=>F.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(F=>F.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(F=>F.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=_.filter(F=>F.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(F=>!F.isPipelineParent&&F.sourceStrategy!=="market"&&F.className!=="anchor").append("circle").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const O=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",F=>S.get(F.id).x).attr("y1",F=>S.get(F.id).y-D).attr("x2",F=>S.get(F.id).x-D*Math.cos(Math.PI/6)).attr("y2",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",F=>S.get(F.id).x-D*Math.cos(Math.PI/6)).attr("y1",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("x2",F=>S.get(F.id).x+D*Math.cos(Math.PI/6)).attr("y2",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",F=>S.get(F.id).x+D*Math.cos(Math.PI/6)).attr("y1",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("x2",F=>S.get(F.id).x).attr("y2",F=>S.get(F.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",F=>S.get(F.id).x).attr("cy",F=>S.get(F.id).y-D).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",F=>S.get(F.id).x-D*Math.cos(Math.PI/6)).attr("cy",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",F=>S.get(F.id).x+D*Math.cos(Math.PI/6)).attr("cy",F=>S.get(F.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),_.filter(F=>F.isPipelineParent===!0).append("rect").attr("x",F=>S.get(F.id).x-s/2).attr("y",F=>S.get(F.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(F=>F.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",F=>{const G=S.get(F.id);let z=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&(z+=i.nodeRadius+10),G.x+z}).attr("y1",F=>{const G=S.get(F.id),z=F.isPipelineParent?s:i.nodeRadius*2;return G.y-z/2}).attr("x2",F=>{const G=S.get(F.id);let z=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&(z+=i.nodeRadius+10),G.x+z}).attr("y2",F=>{const G=S.get(F.id),z=F.isPipelineParent?s:i.nodeRadius*2;return G.y+z/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),_.append("text").attr("x",F=>{const G=S.get(F.id);if(F.className==="anchor")return F.labelOffsetX!==void 0?G.x+F.labelOffsetX:G.x;let z=i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetX===void 0&&(z+=10);const W=F.labelOffsetX??z;return G.x+W}).attr("y",F=>{const G=S.get(F.id);if(F.className==="anchor")return F.labelOffsetY!==void 0?G.y+F.labelOffsetY:G.y-3;let z=-i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetY===void 0&&(z-=10);const W=F.labelOffsetY??z;return G.y+W}).attr("class","wardley-node-label").attr("fill",F=>F.className==="evolved"?a.evolutionStroke:F.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",F=>F.className==="anchor"?"bold":"normal").attr("text-anchor",F=>F.className==="anchor"?"middle":"start").attr("dominant-baseline",F=>F.className==="anchor"?"middle":"auto").text(F=>F.label),l.annotations.length>0){const F=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(G=>{const z=G.coordinates.map(W=>({x:v(W.x),y:T(W.y)}));if(z.length>1)for(let W=0;W{const V=F.append("g").attr("class","wardley-annotation");V.append("circle").attr("cx",W.x).attr("cy",W.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),V.append("text").attr("x",W.x).attr("y",W.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(G.number)})}),l.annotationsBox){let G=v(l.annotationsBox.x),z=T(l.annotationsBox.y);const W=10,V=16,H=11,te=F.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(J=>J.text).sort((J,Z)=>J.number-Z.number),se=[];if(Y.forEach((J,Z)=>{const ee=te.append("text").attr("x",G+W).attr("y",z+W+(Z+1)*V).attr("font-size",H).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${J.number}. ${J.text}`);se.push(ee)}),se.length>0){let J=0,Z=0;se.forEach(qe=>{const ue=qe.node(),de=ue.getComputedTextLength();J=Math.max(J,de);const Ce=ue.getBBox();Z=Math.max(Z,Ce.height)});const ee=J+W*2+105,re=Y.length*V+W*2+Z/2,ge=i.padding,ae=h-i.padding-ee,_e=i.padding,Fe=d-i.padding-re;G=Math.max(ge,Math.min(G,ae)),z=Math.max(_e,Math.min(z,Fe)),se.forEach((qe,ue)=>{qe.attr("x",G+W).attr("y",z+W+(ue+1)*V)}),te.insert("rect","text").attr("x",G).attr("y",z).attr("width",ee).attr("height",re).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const F=p.append("g").attr("class","wardley-notes");l.notes.forEach(G=>{const z=v(G.x),W=T(G.y);F.append("text").attr("x",z).attr("y",W).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(G.text)})}if(l.accelerators.length>0){const F=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(G=>{const z=v(G.x),W=T(G.y),V=60,H=30,te=20,Y=` + M ${z} ${W-H/2} + L ${z+V-te} ${W-H/2} + L ${z+V-te} ${W-H/2-8} + L ${z+V} ${W} + L ${z+V-te} ${W+H/2+8} + L ${z+V-te} ${W+H/2} + L ${z} ${W+H/2} Z - `;P.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),P.append("text").attr("x",q+X/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.name)})}if(l.deaccelerators.length>0){const P=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(B=>{const q=v(B.x),V=x(B.y),X=60,W=30,ie=20,K=` - M ${q+X} ${V-W/2} - L ${q+ie} ${V-W/2} - L ${q+ie} ${V-W/2-8} - L ${q} ${V} - L ${q+ie} ${V+W/2+8} - L ${q+ie} ${V+W/2} - L ${q+X} ${V+W/2} + `;F.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",z+V/2).attr("y",W+H/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(G.name)})}if(l.deaccelerators.length>0){const F=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(G=>{const z=v(G.x),W=T(G.y),V=60,H=30,te=20,Y=` + M ${z+V} ${W-H/2} + L ${z+te} ${W-H/2} + L ${z+te} ${W-H/2-8} + L ${z} ${W} + L ${z+te} ${W+H/2+8} + L ${z+te} ${W+H/2} + L ${z+V} ${W+H/2} Z - `;P.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),P.append("text").attr("x",q+X/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.name)})}},"draw"),Ymt={draw:Hmt},Xmt=T(({wardley:t}={})=>{const e=kp(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.wardley,t);return` + `;F.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",z+V/2).attr("y",W+H/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(G.name)})}},"draw"),Zxt={draw:Kxt},Qxt=b(({wardley:t}={})=>{const e=Gc(),r=sr(),n=ri(e,r.themeVariables),i=ri(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -3379,4 +3412,152 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Kmt={parser:Yve,db:qmt,renderer:Ymt,styles:Xmt};const jmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kmt},Symbol.toStringTag,{value:"Module"})),Zmt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:B0e,createInfoServices:F0e},Symbol.toStringTag,{value:"Module"})),Qmt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:z0e,createPacketServices:G0e},Symbol.toStringTag,{value:"Module"})),Jmt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:q0e,createPieServices:V0e},Symbol.toStringTag,{value:"Module"})),e1t=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:W0e,createTreeViewServices:U0e},Symbol.toStringTag,{value:"Module"})),t1t=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:H0e,createArchitectureServices:Y0e},Symbol.toStringTag,{value:"Module"})),r1t=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:$0e,createGitGraphServices:P0e},Symbol.toStringTag,{value:"Module"})),n1t=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:J0e,createEventModelingServices:ege},Symbol.toStringTag,{value:"Module"})),i1t=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:m0e,createRadarServices:y0e},Symbol.toStringTag,{value:"Module"})),a1t=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:b0e,createRailroadServices:x0e},Symbol.toStringTag,{value:"Module"})),s1t=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:w0e,createRailroadEbnfServices:C0e},Symbol.toStringTag,{value:"Module"})),o1t=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:k0e,createRailroadAbnfServices:E0e},Symbol.toStringTag,{value:"Module"})),l1t=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:A0e,createRailroadPegServices:_0e},Symbol.toStringTag,{value:"Module"})),c1t=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:L0e,createTreemapServices:I0e},Symbol.toStringTag,{value:"Module"})),u1t=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:D0e,createWardleyServices:M0e},Symbol.toStringTag,{value:"Module"})),h1t=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:N0e,createCynefinServices:O0e},Symbol.toStringTag,{value:"Module"}))})(); + `},"styles"),Jxt={parser:Hwe,db:Hxt,renderer:Zxt,styles:Qxt};const eTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jxt},Symbol.toStringTag,{value:"Module"}));var uCe=b(()=>({domains:new Map,transitions:[]}),"createDefaultData"),uC=uCe(),tTt=b(()=>uC.domains,"getDomains"),rTt=b(()=>uC.transitions,"getTransitions"),nTt=b(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));uC.domains.set(r,{name:r,items:n})}},"setDomains"),iTt=b(t=>{t&&(uC.transitions=t.filter(e=>e.from===e.to?(he.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),aTt=b(()=>ri({...jr.cynefin,...sr().cynefin}),"getConfig"),sTt=b(()=>{zn(),uC=uCe()},"clear"),L6={getDomains:tTt,getTransitions:rTt,setDomains:nTt,setTransitions:iTt,getConfig:aTt,clear:sTt,setAccTitle:qn,getAccTitle:Qn,setDiagramTitle:ti,getDiagramTitle:Vn,getAccDescription:ei,setAccDescription:Jn},oTt=b(t=>{Cs(t,L6),L6.setDomains(t.domains),L6.setTransitions(t.transitions)},"populate"),lTt={parse:b(async t=>{const e=await Xo("cynefin",t);he.debug(e),oTt(e)},"parse")};function hC(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}b(hC,"seededRandom");function hCe(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),uTt=b(()=>{const t=Gc(),e=sr();return ri(t,e.themeVariables).cynefin},"getCynefinDomainColors"),$z=3,hTt=b((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=uTt();he.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,T=p+g*2,x={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=Ka(e);bi(w,T,v,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${v} ${T}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const C=w.append("g").attr("transform",`translate(${g}, ${g})`),k=cTt(f,p),S=dCe(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),L=["complex","complicated","chaotic","clear"];for(const N of L){const B=k[N];E.append("rect").attr("class","cynefinDomain").attr("x",B.x).attr("y",B.y).attr("width",B.w).attr("height",B.h).attr("fill",x[N]).attr("fill-opacity",.4).attr("stroke","none")}const M=C.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",fCe(f,p,S,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",pCe(f,p,S+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",gCe(f,p)).attr("fill","none");const I=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",mCe(f/2,p/2,I,P)).attr("fill",x.confusion).attr("fill-opacity",.5);const $=C.append("g").attr("class","cynefin-labels");for(const N of L){const B=k[N];$.append("text").attr("class","cynefinDomainLabel").attr("x",B.cx).attr("y",m?B.cy-30:B.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if($.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=C.append("g").attr("class","cynefin-subtitles");for(const B of L){const F=k[B],G=yCe[B];N.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(G.model),N.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(G.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(yCe.confusion.practice)}const _=C.append("g").attr("class","cynefin-items"),R=26,O=10,D=["complex","complicated","chaotic","clear","confusion"];for(const N of D){const B=a.get(N);if(!B||B.items.length===0)continue;const F=k[N],G=N==="confusion";let z=B.items,W=0;G&&B.items.length>$z&&(W=B.items.length-$z,z=B.items.slice(0,$z));let V;if(G){const H=m?22:14;V=F.cy+H}else V=F.cy+(m?25:15);if([...z].forEach((H,te)=>{const Y=V+te*(R+4),se=_.append("g"),J=se.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",R/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(H.label);let Z=H.label.length*7;const ee=J.node();if(ee&&typeof ee.getBBox=="function"){const ae=ee.getBBox();ae.width>0&&(Z=ae.width)}const re=Z+O*2,ge=F.cx-re/2;se.attr("transform",`translate(${ge}, ${Y})`),se.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",re).attr("height",R).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.95),J.attr("x",re/2).attr("y",R/2)}),W>0){const H=V+z.length*(R+4),te=`+${W} more`,Y=_.append("g"),se=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",R/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(te);let J=te.length*7;const Z=se.node();if(Z&&typeof Z.getBBox=="function"){const ge=Z.getBBox();ge.width>0&&(J=ge.width)}const ee=J+O*2,re=F.cx-ee/2;Y.attr("transform",`translate(${re}, ${H})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ee).attr("height",R).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.6),se.attr("x",ee/2).attr("y",R/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),B=`cynefin-arrow-${e}`;N.append("marker").attr("id",B).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const F=C.append("g").attr("class","cynefin-arrows");s.forEach(G=>{const z=k[G.from],W=k[G.to];if(!z||!W)return;if(G.from===G.to){he.warn(`Cynefin renderer: skipping self-loop on domain "${G.from}"`);return}const V=z.cx,H=z.cy,te=W.cx,Y=W.cy,se=(V+te)/2,J=(H+Y)/2,Z=te-V,ee=Y-H,re=Math.sqrt(Z*Z+ee*ee),ge=re*.15,ae=-ee/re,_e=Z/re,Fe=se+ae*ge,qe=J+_e*ge;F.append("path").attr("class","cynefinArrowLine").attr("d",`M${V},${H} Q${Fe},${qe} ${te},${Y}`).attr("fill","none").attr("marker-end",`url(#${B})`),G.label&&F.append("text").attr("class","cynefinArrowLabel").attr("x",Fe).attr("y",qe-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(G.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),dTt={draw:hTt},fTt=b(()=>{const t=Gc(),e=sr();return ri(t,e.themeVariables).cynefin},"getCynefinTheme"),pTt=b(()=>{const t=fTt();return` + .cynefinDomain { + stroke: none; + } + .cynefinDomainLabel { + font-size: ${t.domainFontSize}px; + font-weight: bold; + fill: ${t.labelColor}; + } + .cynefinSubtitle { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${t.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${t.itemFontSize}px; + fill: ${t.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${t.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${t.boundaryColor}; + stroke-width: ${t.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${t.cliffColor}; + stroke-width: ${t.cliffWidth}; + } + .cynefinConfusion { + stroke: ${t.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${t.arrowColor}; + stroke-width: ${t.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${t.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + } + .cynefinTitle { + font-size: ${t.domainFontSize+2}px; + font-weight: bold; + fill: ${t.labelColor}; + } + `},"styles"),gTt=pTt,mTt={parser:lTt,db:L6,renderer:dTt,styles:gTt};const yTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:mTt},Symbol.toStringTag,{value:"Module"}));var Pz="",Bz="",Fz="",zz=[],I6=new Map,xd=b(t=>Qr(t,Ve()),"sanitizeText"),h1=b(t=>{switch(t.type){case"terminal":return{...t,value:xd(t.value)};case"nonterminal":return{...t,name:xd(t.name)};case"sequence":return{...t,elements:t.elements.map(h1)};case"choice":return{...t,alternatives:t.alternatives.map(h1)};case"optional":return{...t,element:h1(t.element)};case"repetition":return{...t,element:h1(t.element),separator:t.separator?h1(t.separator):void 0};case"special":return{...t,text:xd(t.text)}}},"sanitizeAstNode"),vTt=b(()=>{Pz="",Bz="",Fz="",zz.length=0,I6.clear(),zn(),he.debug("[Railroad] Database cleared")},"clear"),vCe=b(t=>{Pz=xd(t),he.debug("[Railroad] Title set:",t)},"setTitle"),bCe=b(()=>Pz,"getTitle"),bTt=b(t=>{const e={...t,name:xd(t.name),definition:h1(t.definition),comment:t.comment?xd(t.comment):void 0};he.debug("[Railroad] Adding rule:",e.name),I6.has(e.name)&&he.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),zz.push(e),I6.set(e.name,e)},"addRule"),xTt=b(()=>zz,"getRules"),TTt=b(t=>I6.get(t),"getRule"),wTt=b(t=>{Bz=xd(t).replace(/^\s+/g,""),he.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),CTt=b(()=>Bz,"getAccTitle"),STt=b(t=>{Fz=xd(t).replace(/\n\s+/g,` +`),he.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),kTt=b(()=>Fz,"getAccDescription"),ETt=vCe,ATt=bCe,li={clear:vTt,setTitle:vCe,getTitle:bCe,addRule:bTt,getRules:xTt,getRule:TTt,setAccTitle:wTt,getAccTitle:CTt,setAccDescription:STt,getAccDescription:kTt,setDiagramTitle:ETt,getDiagramTitle:ATt},Ua={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},_Tt=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,RTt=/^[\w "',.-]+$/,LTt=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),xCe=b(t=>t?Object.keys(t).every(e=>e==="railroad"||LTt.has(e)):!1,"isRailroadStyleOptions"),ITt=b(t=>t?"railroad"in t&&t.railroad?t.railroad:xCe(t)?t:{}:{},"extractRailroadOverrides"),MTt=b(t=>{if(!t||xCe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Bn=b((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return _Tt.test(r)?r:e},"sanitizeColorValue"),TCe=b((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return RTt.test(r)?r:e},"sanitizeFontFamilyValue"),Kp=b((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),DTt=b(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),NTt=b(t=>{const e=TCe(t.fontFamily,Ua.fontFamily),r=DTt(t.fontSize)??Ua.fontSize;return{...Ua,fontFamily:e,fontSize:r,terminalFill:Bn(t.secondBkg??t.secondaryColor,Ua.terminalFill),terminalStroke:Bn(t.secondaryBorderColor??t.lineColor,Ua.terminalStroke),terminalTextColor:Bn(t.secondaryTextColor??t.textColor,Ua.terminalTextColor),nonTerminalFill:Bn(t.mainBkg??t.background,Ua.nonTerminalFill),nonTerminalStroke:Bn(t.primaryBorderColor??t.lineColor,Ua.nonTerminalStroke),nonTerminalTextColor:Bn(t.primaryTextColor??t.textColor,Ua.nonTerminalTextColor),lineColor:Bn(t.lineColor,Ua.lineColor),markerFill:Bn(t.lineColor,Ua.markerFill),commentFill:Bn(t.labelBackground??t.tertiaryColor,Ua.commentFill),commentStroke:Bn(t.tertiaryBorderColor??t.lineColor,Ua.commentStroke),commentTextColor:Bn(t.tertiaryTextColor??t.textColor,Ua.commentTextColor),specialFill:Bn(t.tertiaryColor??t.secondaryColor,Ua.specialFill),specialStroke:Bn(t.tertiaryBorderColor??t.secondaryBorderColor,Ua.specialStroke),ruleNameColor:Bn(t.titleColor??t.textColor,Ua.ruleNameColor)}},"buildThemeDefaults"),Gz=b(t=>{const e=sr(),r={...Gc(),...e.themeVariables??{},...MTt(t)},n=NTt(r),i={...e.railroad??{},...ITt(t)};return{compactMode:i.compactMode??n.compactMode,padding:Kp(i.padding,n.padding),verticalSeparation:Kp(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:Kp(i.horizontalSeparation,n.horizontalSeparation),arcRadius:Kp(i.arcRadius,n.arcRadius),fontSize:Kp(i.fontSize,n.fontSize),fontFamily:TCe(i.fontFamily,n.fontFamily),terminalFill:Bn(i.terminalFill,n.terminalFill),terminalStroke:Bn(i.terminalStroke,n.terminalStroke),terminalTextColor:Bn(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Bn(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Bn(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Bn(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Bn(i.lineColor,n.lineColor),strokeWidth:Kp(i.strokeWidth,n.strokeWidth),markerFill:Bn(i.markerFill,n.markerFill),commentFill:Bn(i.commentFill,n.commentFill),commentStroke:Bn(i.commentStroke,n.commentStroke),commentTextColor:Bn(i.commentTextColor,n.commentTextColor),specialFill:Bn(i.specialFill,n.specialFill),specialStroke:Bn(i.specialStroke,n.specialStroke),ruleNameColor:Bn(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:Kp(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),M6=b(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=Gz(t);return` + .railroad-diagram { + font-family: ${e}; + font-size: ${r}px; + } + + .railroad-terminal rect { + fill: ${n}; + stroke: ${i}; + stroke-width: ${h}px; + } + + .railroad-terminal text { + fill: ${a}; + font-family: ${e}; + font-size: ${r}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${s}; + stroke: ${o}; + stroke-width: ${h}px; + } + + .railroad-nonterminal text { + fill: ${l}; + font-family: ${e}; + font-size: ${r}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${u}; + stroke-width: ${h}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${d}; + } + + .railroad-comment ellipse { + fill: ${f}; + stroke: ${p}; + stroke-width: ${h}px; + } + + .railroad-comment text { + fill: ${g}; + font-style: italic; + font-family: ${e}; + font-size: ${r}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${m}; + stroke: ${y}; + stroke-width: ${h}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${l}; + font-family: ${e}; + font-size: ${r}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${v}; + font-family: ${e}; + font-size: ${r}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles"),Zo=(X2=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},b(X2,"PathBuilder"),X2),OTt=(j2=class{constructor(e,r=Gz()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new Zo,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const x=new Zo,w=m+f.dimensions.width,C=l-s*2;g===d?x.moveTo(w,g).lineTo(l,d):x.moveTo(w,g).lineTo(C,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",x.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new Zo().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Zo().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Zo().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new Zo().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Zo().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new Zo().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new Zo().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new Zo().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Zo().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},b(j2,"RailroadRenderer"),j2),wCe=b((t,e,r)=>{bi(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),$Tt=b((t,e,r)=>{he.debug(`[Railroad] Rendering diagram +`+t);try{const n=Ka(e);n.attr("class","railroad-diagram");const i=sr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=li.getRules();if(he.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){he.warn("[Railroad] No rules to render"),wCe(n,{height:100,width:200},a);return}const l=new OTt(n,Gz()).renderDiagram(s);wCe(n,l,a),he.debug("[Railroad] Render complete")}catch(n){throw he.error("[Railroad] Render error:",n),n}},"draw"),D6={draw:$Tt},PTt=EB().Railroad.parser.LangiumParser,d1=b(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(d1);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(d1);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:d1(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:d1(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:d1(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),BTt=b(t=>({name:t.name,definition:d1(t.definition)}),"transformRule"),FTt=b(t=>{Cs(t,li),t.title&&li.setTitle(t.title),t.rules.map(e=>li.addRule(BTt(e)))},"populateDb"),zTt={parse:b(t=>{li.clear(),he.debug("[Railroad Parser] Starting Langium parse");const e=PTt.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Gw(e);const r=e.value;he.debug("[Railroad Parser] Parsed rules:",r.rules.length),FTt(r),he.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:li}},GTt={parser:zTt,db:li,renderer:D6,styles:M6};const WTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:GTt},Symbol.toStringTag,{value:"Module"}));var qTt=AB().RailroadEbnf.parser.LangiumParser,N6=b(t=>{const e=t.alternatives.map(VTt);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),VTt=b(t=>{const e=t.elements.map(HTt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),CCe=b(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return N6(t.element);case"EbnfOptional":return{type:"optional",element:N6(t.element)};case"EbnfRepetition":return{type:"repetition",element:N6(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),UTt=b((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},CCe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),HTt=b(t=>t.postfixes.reduce((e,r)=>UTt(e,r),CCe(t.base)),"transformTerm"),YTt=b(t=>({name:t.name,definition:N6(t.definition)}),"transformRule"),XTt=b(t=>{Cs(t,li),t.title&&li.setTitle(t.title),t.rules.map(e=>li.addRule(YTt(e)))},"populateDb"),jTt={parse:b(t=>{li.clear(),he.debug("[EBNF Parser] Starting Langium parse");const e=qTt.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Gw(e);const r=e.value;he.debug("[EBNF Parser] Parsed rules:",r.rules.length),XTt(r),he.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:li}},KTt={parser:jTt,db:li,renderer:D6,styles:M6};const ZTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:KTt},Symbol.toStringTag,{value:"Module"}));var QTt=_B().RailroadAbnf.parser.LangiumParser,Wz=b(t=>{const e=t.alternatives.map(JTt);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),JTt=b(t=>{const e=t.elements.map(twt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),ewt=b(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),twt=b(t=>{const e=rwt(t.primary);if(!t.repeat)return e;const{min:r,max:n}=ewt(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),rwt=b(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return Wz(t.element);case"AbnfOptionalGroup":return{type:"optional",element:Wz(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),nwt=b(t=>({name:t.name,definition:Wz(t.definition)}),"transformRule"),iwt=b(t=>{Cs(t,li),t.title&&li.setTitle(t.title),t.rules.map(e=>li.addRule(nwt(e)))},"populateDb"),awt={parse:b(t=>{li.clear(),he.debug("[ABNF Parser] Starting Langium parse");const e=QTt.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Gw(e);const r=e.value;he.debug("[ABNF Parser] Parsed rules:",r.rules.length),iwt(r),he.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:li}},swt={parser:awt,db:li,renderer:D6,styles:M6};const owt=Object.freeze(Object.defineProperty({__proto__:null,diagram:swt},Symbol.toStringTag,{value:"Module"}));var lwt=RB().RailroadPeg.parser.LangiumParser,SCe=b(t=>{const e=t.alternatives.map(cwt);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),cwt=b(t=>{const e=t.elements.map(uwt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),uwt=b(t=>{const e=hwt(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${kCe(e)}`:`!${kCe(e)}`}:e},"transformPrefix"),kCe=b(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),hwt=b(t=>{const e=dwt(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),dwt=b(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return SCe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),fwt=b(t=>({name:t.name,definition:SCe(t.definition)}),"transformRule"),pwt=b(t=>{Cs(t,li),t.title&&li.setTitle(t.title),t.rules.map(e=>li.addRule(fwt(e)))},"populateDb"),gwt={parse:b(t=>{li.clear(),he.debug("[PEG Parser] Starting Langium parse");const e=lwt.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Gw(e);const r=e.value;he.debug("[PEG Parser] Parsed rules:",r.rules.length),pwt(r),he.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:li}},mwt={parser:gwt,db:li,renderer:D6,styles:M6};const ywt=Object.freeze(Object.defineProperty({__proto__:null,diagram:mwt},Symbol.toStringTag,{value:"Module"}));var vwt=1;function qz(){if(!(typeof globalThis>"u"))return globalThis}b(qz,"getCaptureGlobal");function ECe(){var t;return!!((t=qz())!=null&&t.mermaidCaptureSizes)}b(ECe,"shouldCaptureSizes");function ACe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}b(ACe,"capturedFromLocation");function _Ce(t,e){const r=qz();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}b(_Ce,"emitCapturedSizes");function RCe(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&_Ce({metadata:{captureVersion:vwt,capturedAt:new Date().toISOString(),capturedFrom:ACe()},nodes:r},t)}b(RCe,"captureNodeSizes");const bwt=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:RCe,shouldCaptureSizes:ECe},Symbol.toStringTag,{value:"Module"})),xwt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Sve,createInfoServices:kve},Symbol.toStringTag,{value:"Module"})),Twt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Eve,createPacketServices:Ave},Symbol.toStringTag,{value:"Module"})),wwt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:_ve,createPieServices:Rve},Symbol.toStringTag,{value:"Module"})),Cwt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Lve,createTreeViewServices:Ive},Symbol.toStringTag,{value:"Module"})),Swt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Mve,createArchitectureServices:Dve},Symbol.toStringTag,{value:"Module"})),kwt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:wve,createGitGraphServices:Cve},Symbol.toStringTag,{value:"Module"})),Ewt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Fve,createEventModelingServices:zve},Symbol.toStringTag,{value:"Module"})),Awt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:sve,createRadarServices:ove},Symbol.toStringTag,{value:"Module"})),_wt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:cve,createRailroadServices:EB},Symbol.toStringTag,{value:"Module"})),Rwt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:hve,createRailroadEbnfServices:AB},Symbol.toStringTag,{value:"Module"})),Lwt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:dve,createRailroadAbnfServices:_B},Symbol.toStringTag,{value:"Module"})),Iwt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:pve,createRailroadPegServices:RB},Symbol.toStringTag,{value:"Module"})),Mwt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:mve,createTreemapServices:yve},Symbol.toStringTag,{value:"Module"})),Dwt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:vve,createWardleyServices:bve},Symbol.toStringTag,{value:"Module"})),Nwt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:xve,createCynefinServices:Tve},Symbol.toStringTag,{value:"Module"}))})(); diff --git a/packages/cli/go.mod b/packages/cli/go.mod index c9c7be3..7c0e9d8 100644 --- a/packages/cli/go.mod +++ b/packages/cli/go.mod @@ -3,17 +3,15 @@ module github.com/openknowledge-sh/openknowledge/packages/cli go 1.26.5 require ( - github.com/gofrs/flock v0.12.1 + github.com/gofrs/flock v0.13.0 github.com/natefinch/atomic v1.0.1 - github.com/pelletier/go-toml/v2 v2.2.4 + github.com/pelletier/go-toml/v2 v2.4.3 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 - go.yaml.in/yaml/v3 v3.0.4 - golang.org/x/term v0.42.0 + go.yaml.in/yaml/v3 v3.0.5 + golang.org/x/term v0.45.0 ) require ( - github.com/kr/text v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - golang.org/x/sys v0.43.0 // indirect + golang.org/x/sys v0.47.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/packages/cli/go.sum b/packages/cli/go.sum index 6a76bd0..7acacc7 100644 --- a/packages/cli/go.sum +++ b/packages/cli/go.sum @@ -1,36 +1,26 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= +github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= github.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0A= github.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM= -github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= -github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdDPYVpY= +github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= -golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= -golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/cli/internal/okf/project_config_test.go b/packages/cli/internal/okf/project_config_test.go index ddd9801..ae4d105 100644 --- a/packages/cli/internal/okf/project_config_test.go +++ b/packages/cli/internal/okf/project_config_test.go @@ -74,7 +74,7 @@ func TestParseProjectConfigFailsClosedAcrossEverySection(t *testing.T) { content string expected string }{ - {name: "syntax", content: "[html.theme\nname = \"night\"\n", expected: "expected character ]"}, + {name: "syntax", content: "[html.theme\nname = \"night\"\n", expected: "close table name"}, {name: "unknown root", content: "[deployment]\nurl = \"https://example.test\"\n", expected: "fields in the document are missing in the target struct"}, {name: "unknown HTML field", content: "[html.theme]\ncss = \"theme.css\"\n", expected: "fields in the document are missing in the target struct"}, {name: "wrong HTML type", content: "[html.site]\nbase_url = 42\n", expected: "cannot decode TOML integer"}, @@ -86,7 +86,7 @@ func TestParseProjectConfigFailsClosedAcrossEverySection(t *testing.T) { {name: "unsafe publish backslash", content: "[publish]\nassets = 'assets\\secret.txt'\n", expected: "forward slashes"}, {name: "malformed publish glob", content: "[publish]\nassets = \"assets/[.txt\"\n", expected: "syntax error in pattern"}, {name: "unknown validation rule", content: "[validation.rules]\nnot-a-rule = \"warn\"\n", expected: "unknown validation rule"}, - {name: "wrong validation severity type", content: "[validation.rules]\nlink-target = true\n", expected: "cannot assign boolean"}, + {name: "wrong validation severity type", content: "[validation.rules]\nlink-target = true\n", expected: "boolean into string"}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { diff --git a/packages/npm/THIRD_PARTY_NOTICES.md b/packages/npm/THIRD_PARTY_NOTICES.md index e362146..2ac581b 100644 --- a/packages/npm/THIRD_PARTY_NOTICES.md +++ b/packages/npm/THIRD_PARTY_NOTICES.md @@ -22,7 +22,7 @@ source. ## Mermaid -The packaged Open Knowledge CLI embeds Mermaid 11.15.0 to render fenced +The packaged Open Knowledge CLI embeds Mermaid 11.16.0 to render fenced `mermaid` blocks in the local and static HTML viewers. - Upstream repository: https://github.com/mermaid-js/mermaid @@ -36,9 +36,9 @@ The embedded browser build retains upstream bundled dependency notices. The packaged Open Knowledge CLI uses the following libraries to serialize registry updates across processes and atomically replace the registry file: -- `github.com/gofrs/flock` v0.12.1 — BSD 3-Clause License +- `github.com/gofrs/flock` v0.13.0 — BSD 3-Clause License (`third_party/licenses/gofrs-flock-BSD-3-Clause.txt`) - `github.com/natefinch/atomic` v1.0.1 — MIT License (`third_party/licenses/natefinch-atomic-MIT.txt`) -- `golang.org/x/sys` v0.26.0 — BSD 3-Clause License +- `golang.org/x/sys` v0.47.0 — BSD 3-Clause License (`third_party/licenses/golang-x-sys-BSD-3-Clause.txt`) diff --git a/packages/npm/package.json b/packages/npm/package.json index 2c48289..5cc0036 100644 --- a/packages/npm/package.json +++ b/packages/npm/package.json @@ -27,6 +27,6 @@ "access": "public" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/web/package.json b/packages/web/package.json index a7f47e7..2e08a05 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -15,16 +15,16 @@ "start": "OPENKNOWLEDGE_WEB_ROOT=dist OPENKNOWLEDGE_WEB_EXPORT_WIKI=0 HOST=0.0.0.0 node scripts/serve.mjs" }, "engines": { - "node": ">=18" + "node": ">=20" }, "dependencies": { - "mermaid": "11.15.0" + "mermaid": "11.16.0" }, "devDependencies": { - "@types/node": "^20.19.43", - "oxlint": "1.15.0", + "@types/node": "^26.1.2", + "oxlint": "1.76.0", "typescript": "5.9.3", "vite": "6.4.3", - "vitest": "3.2.6" + "vitest": "4.1.10" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3288de..1973805 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,32 +9,32 @@ importers: .: devDependencies: playwright: - specifier: 1.61.1 - version: 1.61.1 + specifier: 1.62.1 + version: 1.62.1 packages/npm: {} packages/web: dependencies: mermaid: - specifier: 11.15.0 - version: 11.15.0 + specifier: 11.16.0 + version: 11.16.0 devDependencies: '@types/node': - specifier: ^20.19.43 - version: 20.19.43 + specifier: ^26.1.2 + version: 26.1.2 oxlint: - specifier: 1.15.0 - version: 1.15.0 + specifier: 1.76.0 + version: 1.76.0 typescript: specifier: 5.9.3 version: 5.9.3 vite: specifier: 6.4.3 - version: 6.4.3(@types/node@20.19.43) + version: 6.4.3(@types/node@26.1.2) vitest: - specifier: 3.2.6 - version: 3.2.6(@types/node@20.19.43) + specifier: 4.1.10 + version: 4.1.10(@types/node@26.1.2)(vite@6.4.3(@types/node@26.1.2)) packages: @@ -215,47 +215,125 @@ packages: '@mermaid-js/parser@1.2.0': resolution: {integrity: sha512-oYPyv8A4As1yH5Bx+04iQEQxXuIQDe0GKCNSRgao6z8AM9jixXIfP0vsppRLvGf+nKIOb9/LdpWA4YuJiVvESA==} - '@oxlint/darwin-arm64@1.15.0': - resolution: {integrity: sha512-fwYg7WDKI6eAErREBGMXkIAOqBuBFN0LWbQJvVNXCGjywGxsisdwkHnNu4UG8IpHo4P71mUxf3l2xm+5Xiy+TA==} + '@oxlint/binding-android-arm-eabi@1.76.0': + resolution: {integrity: sha512-ZHIE5Zt9AsPDcY4nOlofXt0YfneEeo+QrKMPcPzLf2Z6Q8VtV2W73d7SFJ920WUwyik783u/doKCs3KXdwG+7w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.76.0': + resolution: {integrity: sha512-shm/ngQilHK6bs+ElJWa4oHfNj5vL1Gl/iVEJldTQjpr0/67oSgr0KUpbmcnLig5Fo0v/l6j2567A7TOL89ONA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.76.0': + resolution: {integrity: sha512-rvJmrAPKSQ9aWJ6wIS6CK2tJjwzfW0ApQH9qokq6sfDvmHwoyIHxHFMq7z7i7GiV6fdE6s8qvBqWKPTu8RmT6Q==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@1.15.0': - resolution: {integrity: sha512-RtaAmB6NZZx4hvjCg6w35shzRY5fLclbMsToC92MTZ9lMDF9LotzcbyNHCZ1tvZb1tNPObpIsuX16BFeElF8nw==} + '@oxlint/binding-darwin-x64@1.76.0': + resolution: {integrity: sha512-U/zYdb7VYKGY6pA9Vd2rYl9O/HlCylcOlb5PGPvVLtg+oLGsk6H3XGKEMHKyqD3nmmtmlmwb/8SwU2vfSAtvMw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@1.15.0': - resolution: {integrity: sha512-8uV0lAbmqp93KTBlJWyCdQWuxTzLn+QrDRidUaCLJjn65uvv8KlRhZJoZoyLh17X6U/cgezYktWTMiMhxX56BA==} + '@oxlint/binding-freebsd-x64@1.76.0': + resolution: {integrity: sha512-WvKG9CAriuo0XNiFzpXjDngUZcRGFNpaK2kLyMUsnJlShxkT96u+BpJQ3KqdQwGOrvI14L6V8bAwXwAYNNY6Jg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.76.0': + resolution: {integrity: sha512-qJ5+RH99TqFRq3UCDxkW0zJJu9c+OAHFY72vGlxZLEpuO+MpKo3POgqb8sYipL9KYm8XY6ofb0HsOuvY6hQNqQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.76.0': + resolution: {integrity: sha512-PvPCVptkgVARsucgIqFQQcSmJ6xc6GtnVB5bRBekRahTc9eObMtjHfMjy5M+C2tHt5UCMttWM9RuSk/H9NqYeg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.76.0': + resolution: {integrity: sha512-3KeFDx8Bu4HPAXbuHZOr/oHvN+QT+JQhMw/NYPz7Z071xLSsG27Jfh9PIQVEY7hk1I+jr43ExqRIeJ6VKk2yLw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@oxlint/linux-arm64-musl@1.15.0': - resolution: {integrity: sha512-/+hTqh1J29+2GitKrWUHIYjQBM1szWSJ1U7OzQlgL+Uvf8jxg4sn1nV79LcPMXhC2t8lZy5EOXOgwIh92DsdhQ==} + '@oxlint/binding-linux-arm64-musl@1.76.0': + resolution: {integrity: sha512-oPFkkKTgl0K/EIg9fQ8oA3IGcI05/Mq1en04iFa41mmNPT+6KEiByVazTOZZJiHMBBrbsns1YJ2e1Scqwzesjw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@oxlint/linux-x64-gnu@1.15.0': - resolution: {integrity: sha512-GzeY3AhUd49yV+/76Gw0pjpwUJwxCkwYAJTNe7fFTdWjEQ6M6g8ZzJg5FKtUvgA5sMgmfzHhvSXxvT57YhcXnA==} + '@oxlint/binding-linux-ppc64-gnu@1.76.0': + resolution: {integrity: sha512-gN7yZ0eqflA5Fhf1wvHxGUltIV3FsvmB1zhNMDEK9vSHhc7E6qg9CuPeBgPZab66Tjzq6w6kHAtNEvnTHf4cyw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.76.0': + resolution: {integrity: sha512-S/HqMbn22mQrjtErUxEoS/a55u8kIeXvreIxiJu5G7Le3UecEd6SQZxrDIpuhtgaFnsY/nVra3ytP+pRljDilA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.76.0': + resolution: {integrity: sha512-ZIga3097VJZolGZk6SrIAUokIGfRkxRlhiHDUznZptGBfwrhD7pNfD1rzEzsCwvk/1DX0A1bLz+liuNh5QKIVQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.76.0': + resolution: {integrity: sha512-ZGiiA7pFzMJSyMWYZTVlPgbTsx+Vl8ihLGMIujPwaslUF7kIPPWAbVmAlTc+9lWDV+DCiB8Ikixu+lSHeOIIWQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.76.0': + resolution: {integrity: sha512-JLiy5WuvEBFTT6ErIFV35SLzi0R7Iri6MKU6dZbTxfIx8pndbbPs3Mj780nMipBFcPkti+okAPOJ9POKkHFEgg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@oxlint/linux-x64-musl@1.15.0': - resolution: {integrity: sha512-p/7+juizUOCpGYreFmdfmIOSSSE3+JfsgnXnOHuP8mqlZfiOeXyevyajuXpPNRM60+k0reGvlV7ezp1iFitF7w==} + '@oxlint/binding-linux-x64-musl@1.76.0': + resolution: {integrity: sha512-z7lgKQtbo/I1NIe8G5NHLesxJDv0tRSUWTpXKb9Pm3E9nKFKfO4IOSDtFroKgXtOYb0jQbcdH+0wzTyMXVes+A==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@oxlint/win32-arm64@1.15.0': - resolution: {integrity: sha512-2LaDLOtCMq+lzIQ63Eir3UJV/hQNlw01xtsij2L8sSxt4gA+zWvubOQJQIOPGMDxEKFcWT1lo/6YEXX/sNnZDA==} + '@oxlint/binding-openharmony-arm64@1.76.0': + resolution: {integrity: sha512-JOjKymIpb9QcYfEhZsN6h4V9Ivd474W38cNIBRv6bg2TbIvogbMTH0Mg6YWW9TiRDqfcX+/Hyfsbo5vcSE5guQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.76.0': + resolution: {integrity: sha512-pqDWZiwcmByWUEm1NFUBNiT6aentCcaoMWJv0HbXEmuYermJ4sg8ppVrshubYP2MZ6SHccJJcpr6x469PuDFIw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@1.15.0': - resolution: {integrity: sha512-+jgRPpZrFIcrNxCVsDIy6HVCRpKVDN0DHD8VJodjrsDv6heqhq/qCTa2IXY3R4glWe1nWQ5JgdFKLn3Bl+aLNg==} + '@oxlint/binding-win32-ia32-msvc@1.76.0': + resolution: {integrity: sha512-Ba0O659kgMv6pwO3z9PdO+K3aMxQRaw9HnG+e6AtOfgwcKFvYilciQYBoUBmxfQvOCKZe1SwjMkuB542NkuDMQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.76.0': + resolution: {integrity: sha512-5qcirPHO8nKfkoowEVWtpAoVTcYDy6g0UT0NGic450Qv8J2NrOqg4uQ8QppRP4MDTC7Xx47lbZnmadTH03CGGA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -397,6 +475,9 @@ packages: cpu: [x64] os: [win32] + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -502,8 +583,8 @@ packages: '@types/geojson@7946.0.16': resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==} - '@types/node@20.19.43': - resolution: {integrity: sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==} + '@types/node@26.1.2': + resolution: {integrity: sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==} '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} @@ -511,54 +592,43 @@ packages: '@upsetjs/venn.js@2.0.0': resolution: {integrity: sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==} - '@vitest/expect@3.2.6': - resolution: {integrity: sha512-1+7q9BtaKzEmO+fmNT3kYvoNn5Y71XWAx2Q5HRim4tTVRQVRv4uJFAQ5FbK0OPUeNP/WmVCpxYxoJdvuHVjzBQ==} + '@vitest/expect@4.1.10': + resolution: {integrity: sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==} - '@vitest/mocker@3.2.6': - resolution: {integrity: sha512-EZOrpDbkKotFAP7wPAQV1UIyoGOk4oX7ynWhBhLB7v+meMHbQhU16oPpIYGTTe4oFlhpryGpgpcZP/sin3hYuw==} + '@vitest/mocker@4.1.10': + resolution: {integrity: sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@3.2.6': - resolution: {integrity: sha512-lb7XXXzmm2h2ASzFnRvQpDo6onT1NmMJA3tkGTWiBFtRJ9lxGY3d3mm/Apt36gej2bkkOVLL/yTOtufDaFa/jA==} + '@vitest/pretty-format@4.1.10': + resolution: {integrity: sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==} - '@vitest/pretty-format@3.2.7': - resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==} + '@vitest/runner@4.1.10': + resolution: {integrity: sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==} - '@vitest/runner@3.2.6': - resolution: {integrity: sha512-HYcoSj1w5tcgUnzoF0HcyaAQjpA1gj9ftUJ7iSJSuipc02jW9gKkigwZbjFldAfYHA1fa8UZVRftdMY5msWM9Q==} + '@vitest/snapshot@4.1.10': + resolution: {integrity: sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==} - '@vitest/snapshot@3.2.6': - resolution: {integrity: sha512-H+ZjNTWGpObenh0YnlBctAPnJSI20P81PL8BPzWpx54YXLLTm8hEsWawtcYLMrwvpK48hGxLLbCS+1KRXhsKhw==} + '@vitest/spy@4.1.10': + resolution: {integrity: sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==} - '@vitest/spy@3.2.6': - resolution: {integrity: sha512-oq6BbH68WzcWmwtBrU9nqLeaXTR4XwJF7FSLkKEZo4i6eoXcrxjcwSuTvWBIRUTC6VC72nXYunzqgZA+IKdtxg==} - - '@vitest/utils@3.2.6': - resolution: {integrity: sha512-lI23nIs4bnT3T8NIoh+vFaz5s2/DdP0Jgt2jxwgWljvwn82cLJtyi/If+fjFyoLMGIOz0U/fKvWE0d4jsNQEfg==} + '@vitest/utils@4.1.10': + resolution: {integrity: sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==} assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - - chai@5.3.3: - resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} - check-error@2.1.3: - resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} - engines: {node: '>= 16'} - commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} @@ -567,6 +637,9 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cose-base@1.0.3: resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} @@ -732,27 +805,14 @@ packages: dayjs@1.11.21: resolution: {integrity: sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==} - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - deep-eql@5.0.2: - resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} - engines: {node: '>=6'} - delaunator@5.1.0: resolution: {integrity: sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==} dompurify@3.4.12: resolution: {integrity: sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==} - es-module-lexer@1.7.0: - resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-module-lexer@2.3.1: + resolution: {integrity: sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==} es-toolkit@1.50.0: resolution: {integrity: sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==} @@ -805,9 +865,6 @@ packages: resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==} engines: {node: '>=12'} - js-tokens@9.0.1: - resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - katex@0.16.47: resolution: {integrity: sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==} hasBin: true @@ -824,9 +881,6 @@ packages: lodash-es@4.18.1: resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==} - loupe@3.2.1: - resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -835,26 +889,30 @@ packages: engines: {node: '>= 20'} hasBin: true - mermaid@11.15.0: - resolution: {integrity: sha512-pTMbcf3rWdtLiYGpmoTjHEpeY8seiy6sR+9nD7LOs8KfUbHE4lOUAprTRqRAcWSQ6MQpdX+YEsxShtGsINtPtw==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + mermaid@11.16.0: + resolution: {integrity: sha512-Zvm3kbstgdpvIJPPItlL7fppIZ3kibvc1oZIGxdvk9t6UFz6flv+Jw7FtRGKwfcI8OckmH04LqG6LlS6X4B1pA==} nanoid@3.3.16: resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - oxlint@1.15.0: - resolution: {integrity: sha512-GZngkdF2FabM0pp0/l5OOhIQg+9L6LmOrmS8V8Vg+Swv9/VLJd/oc/LtAkv4HO45BNWL3EVaXzswI0CmGokVzw==} - engines: {node: '>=8.*'} + obug@2.1.4: + resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} + engines: {node: '>=12.20.0'} + + oxlint@1.76.0: + resolution: {integrity: sha512-6QoFioEU4fNdiUx/2Eo6TRd6NG7H7njnRCz8rhB66cZmMHDTqcm1Rjvl8Wry+ZTQMBAmyb4Mlf62Mk5X+eHSOw==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.2.0' + oxlint-tsgolint: '>=7.0.2001' + vite-plus: '*' peerDependenciesMeta: oxlint-tsgolint: optional: true + vite-plus: + optional: true package-manager-detector@1.8.0: resolution: {integrity: sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==} @@ -865,10 +923,6 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.1: - resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} - engines: {node: '>= 14.16'} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -876,14 +930,14 @@ packages: resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} - playwright-core@1.61.1: - resolution: {integrity: sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==} - engines: {node: '>=18'} + playwright-core@1.62.1: + resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==} + engines: {node: '>=20'} hasBin: true - playwright@1.61.1: - resolution: {integrity: sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==} - engines: {node: '>=18'} + playwright@1.62.1: + resolution: {integrity: sha512-0M+L3LAD8/nm554LOla9Ayx0j0tmFZ0FBcoQ7F1VuVHpM/XpiC8RcDzBQB8W5+hA8L22THxELzeF+2WcUzvcLg==} + engines: {node: '>=20'} hasBin: true points-on-curve@0.2.0: @@ -923,11 +977,8 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - std-env@3.10.0: - resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} - - strip-literal@3.1.0: - resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + std-env@4.2.0: + resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} stylis@4.4.0: resolution: {integrity: sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==} @@ -935,9 +986,6 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyexec@1.2.4: resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} engines: {node: '>=18'} @@ -946,16 +994,8 @@ packages: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} - tinypool@1.1.1: - resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} - engines: {node: ^18.0.0 || >=20.0.0} - - tinyrainbow@2.0.0: - resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} - engines: {node: '>=14.0.0'} - - tinyspy@4.0.4: - resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} + tinyrainbow@3.1.1: + resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==} engines: {node: '>=14.0.0'} ts-dedent@2.3.0: @@ -967,18 +1007,13 @@ packages: engines: {node: '>=14.17'} hasBin: true - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + undici-types@8.3.0: + resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} uuid@14.0.1: resolution: {integrity: sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==} hasBin: true - vite-node@3.2.4: - resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - vite@6.4.3: resolution: {integrity: sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -1019,26 +1054,39 @@ packages: yaml: optional: true - vitest@3.2.6: - resolution: {integrity: sha512-xejya+bT/j/+R/AGa1XOfRxLmNUlLtlwjRsFUILF+xHfzElmGcmFydy2gqqIrd62ptIEfwVMofd19uNWD9L7Nw==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + vitest@4.1.10: + resolution: {integrity: sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/debug': ^4.1.12 - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.2.6 - '@vitest/ui': 3.2.6 + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.10 + '@vitest/browser-preview': 4.1.10 + '@vitest/browser-webdriverio': 4.1.10 + '@vitest/coverage-istanbul': 4.1.10 + '@vitest/coverage-v8': 4.1.10 + '@vitest/ui': 4.1.10 happy-dom: '*' jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: '@edge-runtime/vm': optional: true - '@types/debug': + '@opentelemetry/api': optional: true '@types/node': optional: true - '@vitest/browser': + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': optional: true '@vitest/ui': optional: true @@ -1155,28 +1203,61 @@ snapshots: dependencies: '@chevrotain/types': 11.1.2 - '@oxlint/darwin-arm64@1.15.0': + '@oxlint/binding-android-arm-eabi@1.76.0': + optional: true + + '@oxlint/binding-android-arm64@1.76.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.76.0': + optional: true + + '@oxlint/binding-darwin-x64@1.76.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.76.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.76.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.76.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.76.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.76.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.76.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.76.0': optional: true - '@oxlint/darwin-x64@1.15.0': + '@oxlint/binding-linux-riscv64-musl@1.76.0': optional: true - '@oxlint/linux-arm64-gnu@1.15.0': + '@oxlint/binding-linux-s390x-gnu@1.76.0': optional: true - '@oxlint/linux-arm64-musl@1.15.0': + '@oxlint/binding-linux-x64-gnu@1.76.0': optional: true - '@oxlint/linux-x64-gnu@1.15.0': + '@oxlint/binding-linux-x64-musl@1.76.0': optional: true - '@oxlint/linux-x64-musl@1.15.0': + '@oxlint/binding-openharmony-arm64@1.76.0': optional: true - '@oxlint/win32-arm64@1.15.0': + '@oxlint/binding-win32-arm64-msvc@1.76.0': optional: true - '@oxlint/win32-x64@1.15.0': + '@oxlint/binding-win32-ia32-msvc@1.76.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.76.0': optional: true '@rollup/rollup-android-arm-eabi@4.62.3': @@ -1254,6 +1335,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.62.3': optional: true + '@standard-schema/spec@1.1.0': {} + '@types/chai@5.2.3': dependencies: '@types/deep-eql': 4.0.2 @@ -1382,9 +1465,9 @@ snapshots: '@types/geojson@7946.0.16': {} - '@types/node@20.19.43': + '@types/node@26.1.2': dependencies: - undici-types: 6.21.0 + undici-types: 8.3.0 '@types/trusted-types@2.0.7': optional: true @@ -1394,70 +1477,57 @@ snapshots: d3-selection: 3.0.0 d3-transition: 3.0.1(d3-selection@3.0.0) - '@vitest/expect@3.2.6': + '@vitest/expect@4.1.10': dependencies: + '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 3.2.6 - '@vitest/utils': 3.2.6 - chai: 5.3.3 - tinyrainbow: 2.0.0 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + chai: 6.2.2 + tinyrainbow: 3.1.1 - '@vitest/mocker@3.2.6(vite@6.4.3(@types/node@20.19.43))': + '@vitest/mocker@4.1.10(vite@6.4.3(@types/node@26.1.2))': dependencies: - '@vitest/spy': 3.2.6 + '@vitest/spy': 4.1.10 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 6.4.3(@types/node@20.19.43) - - '@vitest/pretty-format@3.2.6': - dependencies: - tinyrainbow: 2.0.0 + vite: 6.4.3(@types/node@26.1.2) - '@vitest/pretty-format@3.2.7': + '@vitest/pretty-format@4.1.10': dependencies: - tinyrainbow: 2.0.0 + tinyrainbow: 3.1.1 - '@vitest/runner@3.2.6': + '@vitest/runner@4.1.10': dependencies: - '@vitest/utils': 3.2.6 + '@vitest/utils': 4.1.10 pathe: 2.0.3 - strip-literal: 3.1.0 - '@vitest/snapshot@3.2.6': + '@vitest/snapshot@4.1.10': dependencies: - '@vitest/pretty-format': 3.2.6 + '@vitest/pretty-format': 4.1.10 + '@vitest/utils': 4.1.10 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@3.2.6': - dependencies: - tinyspy: 4.0.4 + '@vitest/spy@4.1.10': {} - '@vitest/utils@3.2.6': + '@vitest/utils@4.1.10': dependencies: - '@vitest/pretty-format': 3.2.6 - loupe: 3.2.1 - tinyrainbow: 2.0.0 + '@vitest/pretty-format': 4.1.10 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.1 assertion-error@2.0.1: {} - cac@6.7.14: {} - - chai@5.3.3: - dependencies: - assertion-error: 2.0.1 - check-error: 2.1.3 - deep-eql: 5.0.2 - loupe: 3.2.1 - pathval: 2.0.1 - - check-error@2.1.3: {} + chai@6.2.2: {} commander@7.2.0: {} commander@8.3.0: {} + convert-source-map@2.0.0: {} + cose-base@1.0.3: dependencies: layout-base: 1.0.2 @@ -1652,12 +1722,6 @@ snapshots: dayjs@1.11.21: {} - debug@4.4.3: - dependencies: - ms: 2.1.3 - - deep-eql@5.0.2: {} - delaunator@5.1.0: dependencies: robust-predicates: 3.0.3 @@ -1666,7 +1730,7 @@ snapshots: optionalDependencies: '@types/trusted-types': 2.0.7 - es-module-lexer@1.7.0: {} + es-module-lexer@2.3.1: {} es-toolkit@1.50.0: {} @@ -1727,8 +1791,6 @@ snapshots: internmap@2.0.3: {} - js-tokens@9.0.1: {} - katex@0.16.47: dependencies: commander: 8.3.0 @@ -1741,15 +1803,13 @@ snapshots: lodash-es@4.18.1: {} - loupe@3.2.1: {} - magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 marked@16.4.2: {} - mermaid@11.15.0: + mermaid@11.16.0: dependencies: '@braintree/sanitize-url': 7.1.2 '@iconify/utils': 3.1.4 @@ -1773,20 +1833,31 @@ snapshots: ts-dedent: 2.3.0 uuid: 14.0.1 - ms@2.1.3: {} - nanoid@3.3.16: {} - oxlint@1.15.0: + obug@2.1.4: {} + + oxlint@1.76.0: optionalDependencies: - '@oxlint/darwin-arm64': 1.15.0 - '@oxlint/darwin-x64': 1.15.0 - '@oxlint/linux-arm64-gnu': 1.15.0 - '@oxlint/linux-arm64-musl': 1.15.0 - '@oxlint/linux-x64-gnu': 1.15.0 - '@oxlint/linux-x64-musl': 1.15.0 - '@oxlint/win32-arm64': 1.15.0 - '@oxlint/win32-x64': 1.15.0 + '@oxlint/binding-android-arm-eabi': 1.76.0 + '@oxlint/binding-android-arm64': 1.76.0 + '@oxlint/binding-darwin-arm64': 1.76.0 + '@oxlint/binding-darwin-x64': 1.76.0 + '@oxlint/binding-freebsd-x64': 1.76.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.76.0 + '@oxlint/binding-linux-arm-musleabihf': 1.76.0 + '@oxlint/binding-linux-arm64-gnu': 1.76.0 + '@oxlint/binding-linux-arm64-musl': 1.76.0 + '@oxlint/binding-linux-ppc64-gnu': 1.76.0 + '@oxlint/binding-linux-riscv64-gnu': 1.76.0 + '@oxlint/binding-linux-riscv64-musl': 1.76.0 + '@oxlint/binding-linux-s390x-gnu': 1.76.0 + '@oxlint/binding-linux-x64-gnu': 1.76.0 + '@oxlint/binding-linux-x64-musl': 1.76.0 + '@oxlint/binding-openharmony-arm64': 1.76.0 + '@oxlint/binding-win32-arm64-msvc': 1.76.0 + '@oxlint/binding-win32-ia32-msvc': 1.76.0 + '@oxlint/binding-win32-x64-msvc': 1.76.0 package-manager-detector@1.8.0: {} @@ -1794,17 +1865,15 @@ snapshots: pathe@2.0.3: {} - pathval@2.0.1: {} - picocolors@1.1.1: {} picomatch@4.0.5: {} - playwright-core@1.61.1: {} + playwright-core@1.62.1: {} - playwright@1.61.1: + playwright@1.62.1: dependencies: - playwright-core: 1.61.1 + playwright-core: 1.62.1 optionalDependencies: fsevents: 2.3.2 @@ -1871,18 +1940,12 @@ snapshots: stackback@0.0.2: {} - std-env@3.10.0: {} - - strip-literal@3.1.0: - dependencies: - js-tokens: 9.0.1 + std-env@4.2.0: {} stylis@4.4.0: {} tinybench@2.9.0: {} - tinyexec@0.3.2: {} - tinyexec@1.2.4: {} tinyglobby@0.2.17: @@ -1890,42 +1953,17 @@ snapshots: fdir: 6.5.0(picomatch@4.0.5) picomatch: 4.0.5 - tinypool@1.1.1: {} - - tinyrainbow@2.0.0: {} - - tinyspy@4.0.4: {} + tinyrainbow@3.1.1: {} ts-dedent@2.3.0: {} typescript@5.9.3: {} - undici-types@6.21.0: {} + undici-types@8.3.0: {} uuid@14.0.1: {} - vite-node@3.2.4(@types/node@20.19.43): - dependencies: - cac: 6.7.14 - debug: 4.4.3 - es-module-lexer: 1.7.0 - pathe: 2.0.3 - vite: 6.4.3(@types/node@20.19.43) - transitivePeerDependencies: - - '@types/node' - - jiti - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - - vite@6.4.3(@types/node@20.19.43): + vite@6.4.3(@types/node@26.1.2): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.5) @@ -1934,49 +1972,35 @@ snapshots: rollup: 4.62.3 tinyglobby: 0.2.17 optionalDependencies: - '@types/node': 20.19.43 + '@types/node': 26.1.2 fsevents: 2.3.3 - vitest@3.2.6(@types/node@20.19.43): + vitest@4.1.10(@types/node@26.1.2)(vite@6.4.3(@types/node@26.1.2)): dependencies: - '@types/chai': 5.2.3 - '@vitest/expect': 3.2.6 - '@vitest/mocker': 3.2.6(vite@6.4.3(@types/node@20.19.43)) - '@vitest/pretty-format': 3.2.7 - '@vitest/runner': 3.2.6 - '@vitest/snapshot': 3.2.6 - '@vitest/spy': 3.2.6 - '@vitest/utils': 3.2.6 - chai: 5.3.3 - debug: 4.4.3 + '@vitest/expect': 4.1.10 + '@vitest/mocker': 4.1.10(vite@6.4.3(@types/node@26.1.2)) + '@vitest/pretty-format': 4.1.10 + '@vitest/runner': 4.1.10 + '@vitest/snapshot': 4.1.10 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + es-module-lexer: 2.3.1 expect-type: 1.4.0 magic-string: 0.30.21 + obug: 2.1.4 pathe: 2.0.3 picomatch: 4.0.5 - std-env: 3.10.0 + std-env: 4.2.0 tinybench: 2.9.0 - tinyexec: 0.3.2 + tinyexec: 1.2.4 tinyglobby: 0.2.17 - tinypool: 1.1.1 - tinyrainbow: 2.0.0 - vite: 6.4.3(@types/node@20.19.43) - vite-node: 3.2.4(@types/node@20.19.43) + tinyrainbow: 3.1.1 + vite: 6.4.3(@types/node@26.1.2) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.19.43 + '@types/node': 26.1.2 transitivePeerDependencies: - - jiti - - less - - lightningcss - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml why-is-node-running@2.3.0: dependencies: