From 783e969dbf1863cba4b4ebbf2cb5d68e776c305e Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Tue, 29 Oct 2024 11:31:11 +0800 Subject: [PATCH 1/2] chore: make cli/frontend into git --- .github/workflows/publish.yml | 10 --- .github/workflows/release.yml | 2 - .gitignore | 1 - cli/frontend/build/asset-manifest.json | 15 ++++ cli/frontend/build/index.html | 1 + cli/frontend/build/logo.svg | 16 ++++ .../build/static/css/main.c6b44981.css | 3 + cli/frontend/build/static/js/main.f49e2d33.js | 2 + .../static/js/main.f49e2d33.js.LICENSE.txt | 86 +++++++++++++++++++ ...nload.1a2f96254a617a2765b0fca418a3e5bf.svg | 1 + ...creen.972c352cc40ca74a17222b04ad2b1316.svg | 1 + ...om-in.b8e914df4e9fbb889ceec372b13f62d1.svg | 1 + ...m-out.9600557781b9acd42f24eddad00f6f36.svg | 1 + 13 files changed, 127 insertions(+), 13 deletions(-) create mode 100644 cli/frontend/build/asset-manifest.json create mode 100644 cli/frontend/build/index.html create mode 100644 cli/frontend/build/logo.svg create mode 100644 cli/frontend/build/static/css/main.c6b44981.css create mode 100644 cli/frontend/build/static/js/main.f49e2d33.js create mode 100644 cli/frontend/build/static/js/main.f49e2d33.js.LICENSE.txt create mode 100644 cli/frontend/build/static/media/download.1a2f96254a617a2765b0fca418a3e5bf.svg create mode 100644 cli/frontend/build/static/media/full-screen.972c352cc40ca74a17222b04ad2b1316.svg create mode 100644 cli/frontend/build/static/media/zoom-in.b8e914df4e9fbb889ceec372b13f62d1.svg create mode 100644 cli/frontend/build/static/media/zoom-out.9600557781b9acd42f24eddad00f6f36.svg diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 32e8a497..aa134902 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,20 +31,10 @@ jobs: - name: Dry run release if: github.event_name == 'pull_request' run: | - make build-frontend - cargo package || echo "package done" - sql_dir=`ls target/package | grep bendsql` - mkdir -p target/package/${sql_dir}/frontend/ - cp -r frontend/build target/package/bendsql-*/frontend/ cargo workspaces publish --all --dry-run --publish-as-is - name: Release to crates.io if: github.event_name == 'push' env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} run: | - make build-frontend - cargo package || echo "package done" - sql_dir=`ls target/package | grep bendsql` - mkdir -p target/package/${sql_dir}/frontend/ - cp -r frontend/build target/package/bendsql-*/frontend/ cargo workspaces publish --all --publish-as-is --yes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e75a9f75..b07302a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,6 @@ jobs: - name: Build shell: bash run: | - make build-frontend cross build --release --target=${{ matrix.target }} --bin=bendsql - name: Publish Binary uses: ./.github/actions/publish_binary @@ -71,7 +70,6 @@ jobs: - name: Build shell: bash run: | - make build-frontend cargo build --release --target=${{ matrix.target }} --bin=bendsql - name: Publish Binary uses: ./.github/actions/publish_binary diff --git a/.gitignore b/.gitignore index ac53f9f1..3b2b9fab 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,4 @@ venv/ *.output /dist -cli/frontend diff --git a/cli/frontend/build/asset-manifest.json b/cli/frontend/build/asset-manifest.json new file mode 100644 index 00000000..fdeca69f --- /dev/null +++ b/cli/frontend/build/asset-manifest.json @@ -0,0 +1,15 @@ +{ + "files": { + "main.css": "/static/css/main.c6b44981.css", + "main.js": "/static/js/main.f49e2d33.js", + "static/media/download.svg": "/static/media/download.1a2f96254a617a2765b0fca418a3e5bf.svg", + "static/media/zoom-in.svg": "/static/media/zoom-in.b8e914df4e9fbb889ceec372b13f62d1.svg", + "static/media/full-screen.svg": "/static/media/full-screen.972c352cc40ca74a17222b04ad2b1316.svg", + "index.html": "/index.html", + "static/media/zoom-out.svg": "/static/media/zoom-out.9600557781b9acd42f24eddad00f6f36.svg" + }, + "entrypoints": [ + "static/css/main.c6b44981.css", + "static/js/main.f49e2d33.js" + ] +} \ No newline at end of file diff --git a/cli/frontend/build/index.html b/cli/frontend/build/index.html new file mode 100644 index 00000000..79fc33e7 --- /dev/null +++ b/cli/frontend/build/index.html @@ -0,0 +1 @@ +Databend
\ No newline at end of file diff --git a/cli/frontend/build/logo.svg b/cli/frontend/build/logo.svg new file mode 100644 index 00000000..ab3b9749 --- /dev/null +++ b/cli/frontend/build/logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/cli/frontend/build/static/css/main.c6b44981.css b/cli/frontend/build/static/css/main.c6b44981.css new file mode 100644 index 00000000..d9c0b537 --- /dev/null +++ b/cli/frontend/build/static/css/main.c6b44981.css @@ -0,0 +1,3 @@ +/* +! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com +*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.absolute{position:absolute}.left-0{left:0}.top-0{top:0}.mb-2{margin-bottom:.5rem}.mt-5{margin-top:1.25rem}.box-border{box-sizing:border-box}.flex{display:flex}.h-full{height:100%}.h-screen{height:100vh}.w-\[100px\]{width:100px}.w-full{width:100%}.flex-1{flex:1 1}.cursor-pointer{cursor:pointer}.resize{resize:both}.items-center{align-items:center}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-6{padding:1.5rem}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.drop-shadow{--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f)}.drop-shadow,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.expensive-nodes-card{background-color:#fff;border:1px solid #010e2914;border-radius:8px;box-shadow:0 3px 6px #010e291f;box-sizing:border-box;margin-top:20px;padding:24px;width:308px}.expensive-nodes-card-header{margin-bottom:8px}.expensive-nodes-card-header h2{color:#2c3e50;font-size:14px;margin:0}.expensive-nodes-card-header span{color:#bdc3c7;font-weight:400}.expensive-nodes-node{align-items:center;border-bottom:1px solid #ecf0f1;display:flex;font-size:12px;justify-content:space-between;padding:8px 6px}.expensive-nodes-node.selected{border:2px solid #0175f6!important;border-radius:8px}.expensive-nodes-node-name{color:#0c162b99;font-size:12px;font-weight:600}.block{display:block}.expensive-nodes-node-percentage{color:#0c162bcc;font-size:12px;font-weight:700}.expensive-nodes-progress{align-items:center;display:flex;margin-bottom:16px}.expensive-nodes-progress .ant-progress-line{flex:1 1}.expensive-nodes-percentage{color:#2c3e50;font-size:14px;font-weight:700;margin-left:8px}.expensive-nodes-node-attributes{display:block}.expensive-nodes-node-title{color:#0c162bcc;font-size:12px;font-weight:600;padding:8px 6px}.custom-statistic{align-items:center;display:flex;margin-bottom:8px}.custom-dot{border-radius:50%;display:inline-block;height:8px;margin-right:8px;width:8px}.statistic-title{color:#595959;font-size:14px} \ No newline at end of file diff --git a/cli/frontend/build/static/js/main.f49e2d33.js b/cli/frontend/build/static/js/main.f49e2d33.js new file mode 100644 index 00000000..56db5709 --- /dev/null +++ b/cli/frontend/build/static/js/main.f49e2d33.js @@ -0,0 +1,2 @@ +/*! For license information please see main.f49e2d33.js.LICENSE.txt */ +(()=>{var t={8710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(t,e){var n=t.nodes,r=t.edges,o=[],i={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){i[t.id]=e;o.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=i[n],s=i[r];!a&&0!==a||!s&&0!==s||(o[a][s]=1,e||(o[s][a]=1))})),o};e.default=n},928:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return r.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return r.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return r.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return r.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return r.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return r.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return r.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return r.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return r.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return r.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return r.pageRankAsync}});var r=n(6898),o=r.detectCycleAsync;e.detectDirectedCycleAsync=o;var i={getAdjMatrixAsync:r.getAdjMatrixAsync,connectedComponentAsync:r.connectedComponentAsync,getDegreeAsync:r.getDegreeAsync,getInDegreeAsync:r.getInDegreeAsync,getOutDegreeAsync:r.getOutDegreeAsync,detectCycleAsync:r.detectCycleAsync,detectDirectedCycleAsync:o,detectAllCyclesAsync:r.detectAllCyclesAsync,detectAllDirectedCycleAsync:r.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:r.detectAllUndirectedCycleAsync,dijkstraAsync:r.dijkstraAsync,findAllPathAsync:r.findAllPathAsync,findShortestPathAsync:r.findShortestPathAsync,floydWarshallAsync:r.floydWarshallAsync,labelPropagationAsync:r.labelPropagationAsync,louvainAsync:r.louvainAsync,minimumSpanningTreeAsync:r.minimumSpanningTreeAsync,pageRankAsync:r.pageRankAsync,getNeighborsAsync:r.getNeighborsAsync,GADDIAsync:r.GADDIAsync};e.default=i},9307:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(9168))&&r.__esModule?r:{default:r},i=n(8972);var a=function(t,e,n,r){void 0===r&&(r=!0);var a=function(t){void 0===t&&(t={});var e=t,n=function(){},r=function(){var t={};return function(e){var n=e.next;return!t[n]&&(t[n]=!0,!0)}}();return e.allowTraversal=t.allowTraversal||r,e.enter=t.enter||n,e.leave=t.leave||n,e}(n),s=new o.default,u=t.edges,c=void 0===u?[]:u;s.enqueue(e);for(var l="",d=function(){var t=s.dequeue();a.enter({current:t,previous:l}),(0,i.getNeighbors)(t,c,r?"target":void 0).forEach((function(e){a.allowTraversal({previous:l,current:t,next:e})&&s.enqueue(e)})),a.leave({current:t,previous:l}),l=t};!s.isEmpty();)d()};e.default=a},851:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?i(t):o(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var r=n(8972),o=function(t){for(var e=t.nodes,n=void 0===e?[]:e,o=t.edges,i=void 0===o?[]:o,a=[],s={},u=[],c=function t(e){u.push(e),s[e.id]=!0;for(var o=(0,r.getNeighbors)(e.id,i),a=function(e){var r=o[e];if(!s[r]){var i=n.filter((function(t){return t.id===r}));i.length>0&&t(i[0])}},c=0;c0;)f.push(u.pop());a.push(f)}}return a};e.detectConnectedComponents=o;var i=function(t){for(var e=t.nodes,n=void 0===e?[]:e,o=t.edges,i=void 0===o?[]:o,a=[],s={},u={},c={},l=[],d=0,f=function t(e){u[e.id]=d,c[e.id]=d,d+=1,a.push(e),s[e.id]=!0;for(var o=(0,r.getNeighbors)(e.id,i,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(r){var i=o[r];if(u[i]||0===u[i])s[i]&&(c[e.id]=Math.min(c[e.id],u[i]));else{var a=n.filter((function(t){return t.id===i}));a.length>0&&t(a[0]),c[e.id]=Math.min(c[e.id],c[i])}},h=0;h0;){var g=a.pop();if(s[g.id]=!1,p.push(g),g===e)break}p.length>0&&l.push(p)}},h=0,p=n;h{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.secondReg=e.dateReg=void 0;e.secondReg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;e.dateReg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/},9268:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOutDegree=e.getInDegree=e.default=void 0;var n=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,o=t.edges,i=void 0===o?[]:o;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),i.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},r=n;e.default=r;e.getInDegree=function(t,e){return n(t)[e]?n(t)[e].inDegree:0};e.getOutDegree=function(t,e){return n(t)[e]?n(t)[e].outDegree:0}},952:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.detectAllUndirectedCycle=e.detectAllDirectedCycle=e.detectAllCycles=e.default=void 0;var o,i=(o=n(849))&&o.__esModule?o:{default:o},a=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var n=u(e);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=i?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=t[a]}o.default=t,n&&n.set(t,o);return o}(n(851)),s=n(8972);function u(t){if("function"!==typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(u=function(t){return t?n:e})(t)}var c=function(t,e,n){var r,o;void 0===n&&(n=!0);for(var i=[],u=0,c=(0,a.default)(t,!1);u0;)for(var v=h.pop(),m=v.id,y=(0,s.getNeighbors)(m,t.edges),b=function(r){var o,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===m)i.push(((o={})[a]=v,o));else if(a in g){if(!g[m].has(s)){for(var u=!0,c=[s,v],l=p[m];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var d={},f=1;f-1)return d;r.push(a),o.add(a);for(var f=l[a.id],h=0;h0;){var n=e.pop();o.has(n)&&(o.delete(n),i[n.id].forEach((function(t){e.push(t)})),i[n.id].clear())}}(a);else for(h=0;h-1}));m-1?g[v.id].push(l[b]):u.push(((o={})[v.id]=v,o))}}return{component:p,adjList:g,minIdx:a}},b=0;b=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var E=y(w),S=E.minIdx,M=E.adjList,k=E.component;if(!(k.length>1))break;k.forEach((function(t){i[t.id]=new Set}));var _=c[S];if(e&&n&&-1===e.indexOf(_.id))return u;d(_,_,M),b=S+1}return u};e.detectAllDirectedCycle=l;e.detectAllCycles=function(t,e,n,r){return void 0===r&&(r=!0),e?l(t,n,r):c(t,n,r)};var d=function(t){var e=null,n=t.nodes,r={},o={},a={},s={};(void 0===n?[]:n).forEach((function(t){o[t.id]=t}));for(var u={enter:function(t){var n=t.current,i=t.previous;if(a[n]){e={};for(var s=n,u=i;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else a[n]=n,delete o[n],r[n]=i},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var n=t.next;return!e&&!s[n]}};Object.keys(o).length;){var c=Object.keys(o)[0];(0,i.default)(t,c,u)}return e};e.default=d},849:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r){void 0===r&&(r=!0);o(t,e,"",function(t){void 0===t&&(t={});var e=t,n=function(){},r=function(){var t={};return function(e){var n=e.next;return!t[n]&&(t[n]=!0,!0)}}();return e.allowTraversal=t.allowTraversal||r,e.enter=t.enter||n,e.leave=t.leave||n,e}(n),r)};var r=n(8972);function o(t,e,n,i,a){void 0===a&&(a=!0),i.enter({current:e,previous:n});var s=t.edges,u=void 0===s?[]:s;(0,r.getNeighbors)(e,u,a?"target":void 0).forEach((function(r){i.allowTraversal({previous:n,current:e,next:r})&&o(t,r,e,i,a)})),i.leave({current:e,previous:n})}},4490:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(7827),o=n(5527),i=n(8972),a=function(t,e,n,r){var o=t.nodes,a=void 0===o?[]:o,u=t.edges,c=void 0===u?[]:u,l=[],d={},f={},h={};a.forEach((function(t,n){var r=t.id;l.push(r),f[r]=1/0,r===e&&(f[r]=0)}));for(var p=a.length,g=function(t){var e=function(t,e,n){for(var r,o=1/0,i=0;if[e.id]+s?(f[a]=f[e.id]+s,h[a]=[e.id]):f[a]===f[e.id]+s&&h[a].push(e.id)}))},v=0;v{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findShortestPath=e.findAllPath=void 0;var r,o=(r=n(4490))&&r.__esModule?r:{default:r},i=n(8972);e.findShortestPath=function(t,e,n,r,i){var a=(0,o.default)(t,e,r,i),s=a.length,u=a.path,c=a.allPath;return{length:s[n],path:u[n],allPath:c[n]}};e.findAllPath=function(t,e,n,r){var o;if(e===n)return[[e]];var a=t.edges,s=void 0===a?[]:a,u=[e],c=((o={})[e]=!0,o),l=[],d=[],f=r?(0,i.getNeighbors)(e,s,"target"):(0,i.getNeighbors)(e,s);for(l.push(f);u.length>0&&l.length>0;){var h=l[l.length-1];if(h.length){var p=h.shift();if(p&&(u.push(p),c[p]=!0,f=r?(0,i.getNeighbors)(p,s,"target"):(0,i.getNeighbors)(p,s),l.push(f.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));d.push(g);v=u.pop();c[v]=!1,l.pop()}}else{var v=u.pop();c[v]=!1,l.pop()}}return d}},72:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(8710))&&r.__esModule?r:{default:r};var i=function(t,e){for(var n=(0,o.default)(t,e),r=[],i=n.length,a=0;ar[a][u]+r[u][s]&&(r[a][s]=r[a][u]+r[u][s]);return r};e.default=i},8597:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(5527),o=n(3595),i=function(){function t(t,e,n,r,i){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||o.VACANT_NODE_LABEL,edgeLabel:r||o.VACANT_EDGE_LABEL,nodeLabel2:i||o.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,o=n.toNode;rd||r.hasNode(i[l.to])||(e.labelm;b--){if("break"===y(b))break}if(g){var x=t.findMinLabel(p);c.dfsEdgeList.push(new i(h,v,o.VACANT_NODE_LABEL,x.edgeLabel,o.VACANT_NODE_LABEL));var w=c.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===c.dfsEdgeList[w]&&a(p[x.edgeLabel].projected)}var E={};g=!1;var S=0;l.forEach((function(e){var n=new s(e),o=t.findForwardPureEdges(r,n.edges[d[0]],f,n);o.length>0&&(g=!0,S=h,o.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);E[n]||(E[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),E[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var M=d.length,k=function(e){if(g)return"break";var n=d[e];l.forEach((function(e){var o=new s(e),i=t.findForwardRmpathEdges(r,o.edges[n],f,o);i.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,i.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);E[n]||(E[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),E[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(b=0;b=0;f--){var h=e.findBackwardEdge(o,d.edges[r[f]],d.edges[r[0]],d);if(h){var p="".concat(e.dfsCode.dfsEdgeList[r[f]].fromNode,"-").concat(h.label);l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:h.label}),l[p].projected.push({graphId:t.graphId,edge:h,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(o,d.edges[r[0]],u,d).forEach((function(e){var n="".concat(a,"-").concat(e.label,"-").concat(i[e.to].label);c[n]||(c[n]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:i[e.to].label}),c[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var g=function(n){e.findForwardRmpathEdges(o,d.edges[r[n]],u,d).forEach((function(o){var a="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(o.label,"-").concat(i[o.to].label);c[a]||(c[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:o.label,nodeLabel2:i[o.to].label}),c[a].projected.push({graphId:t.graphId,edge:o,preNode:t})}))};for(f=0;fo){var a=o;o=r,r=a}var l=t.label,d="".concat(n,"-").concat(r,"-").concat(l,"-").concat(o),f="".concat(r,"-").concat(l,"-").concat(o);if(!i[f]){var h=i[f]||0;h++,i[f]=h}s[d]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:o}}))}))})),Object.keys(o).forEach((function(t){if(!(o[t]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VACANT_NODE_LABEL=e.VACANT_NODE_ID=e.VACANT_GRAPH_ID=e.VACANT_EDGE_LABEL=e.VACANT_EDGE_ID=e.Node=e.Graph=e.Edge=e.AUTO_EDGE_ID=void 0;e.VACANT_EDGE_ID=-1;e.VACANT_NODE_ID=-1;e.VACANT_EDGE_LABEL="-1";e.VACANT_NODE_LABEL="-1";e.VACANT_GRAPH_ID=-1;e.AUTO_EDGE_ID="-1";var n=function(t,e,n,r){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===r&&(r="-1"),this.id=t,this.from=e,this.to=n,this.label=r};e.Edge=n;var r=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e="-1"),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}();e.Node=r;var o=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new r(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,r,o){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[t])){var i=new n(t,e,r,o);if(this.edges.push(i),this.edgeMap[t]=i,this.nodeMap[e].addEdge(i),this.edgeLabelMap[o]||(this.edgeLabelMap[o]=[]),this.edgeLabelMap[o].push(i),!this.directed){var a=new n(t,r,e,o);this.nodeMap[r].addEdge(a),this.edgeLabelMap[o].push(a)}}},t}();e.Graph=o},733:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(7827),o=u(n(72)),i=u(n(8597)),a=u(n(4490)),s=n(8972);function u(t){return t&&t.__esModule?t:{default:t}}var c=function(t,e,n,r){void 0===n&&(n="cluster"),void 0===r&&(r=2);var o=[],i=t.nodes;return e.forEach((function(t,e){o.push(l(i,t,e,n,r))})),o},l=function(t,e,n,r,o){var i=[n],a=[],s={};return e.forEach((function(e,u){if(e<=o&&n!==u){i.push(u),a.push(t[u]);var c=t[u][r];s[c]?(s[c].count++,s[c].dists.push(e)):s[c]={count:1,dists:[e]}}})),Object.keys(s).forEach((function(t){s[t].dists=s[t].dists.sort((function(t,e){return t-e}))})),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:i,neighbors:a,neighborNum:i.length-1,nodeLabelCountMap:s}},d=function(t,e,n,r){var o=n.nodes;return r||(r={}),Object.keys(t).forEach((function(i){var a,s;if(!r||!r[i]){r[i]={nodes:[],edges:[]};var u=t[i],c=null===(a=e[u.start])||void 0===a?void 0:a.nodeIdxs,l=null===(s=e[u.end])||void 0===s?void 0:s.nodeIdxs;if(c&&l){var d=new Set(l),f=c.filter((function(t){return d.has(t)}));if(f&&f.length){for(var h={},p=f.length,g=0;ge&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var o=n[t.id].outDegree;c>o&&(c=o)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},y=function(t,e,n,s,u,y,b){var x;if(void 0===n&&(n=!1),void 0===y&&(y="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var w=t.nodes.length;if(w){var E=(0,o.default)(t,n),S=(0,o.default)(e,n),M=g(t.nodes,E,n),k=g(e.nodes,S,n),_=h(t.nodes,y),A=_.nodeMap,C=_.nodeLabelMap,O=h(e.nodes,y),I=O.nodeMap,T=O.nodeLabelMap;p(t.edges,b,A);var N=p(e.edges,b,I).edgeLabelMap,P=[];null===S||void 0===S||S.forEach((function(t){P=P.concat(t)})),u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],P,!1),[2],!1))),s||(s=u);var L=c(t,E,y,s),D=c(e,S,y,s),j=function(t,e,n,r,o){var i=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,d=t.neighborNum-1;u2*e)););if(h<2*e&&(a["".concat(r,"-").concat(f)]={start:r,end:f,distance:o[r][f]},u++,++s>=n))return a;if(++c>2*e)break}uq&&(q=n.length,X=n,H=e,V=t)}));var Z={},K={},$={},Q={},J={},tt={};Object.keys(T).forEach((function(r,o){J[r]=[],n&&(tt[r]=[]);var i=-1/0,a=T[r],s={};a.forEach((function(t){var e=k["".concat(V.id,"-").concat(t.id)];if(e&&J[r].push(e),iJ[r][c]){s=!0;break}if(s)return X.splice(e,1),"continue";var l={};o.neighbors.forEach((function(t){var e=M["".concat(n.id,"-").concat(t.id)];l["".concat(n.id,"-").concat(t.id)]={start:A[n.id].idx,end:A[t.id].idx,distance:e}})),R=d(l,L,t,R);var h=[];Object.keys(l).forEach((function(t){if(Y[t])h.push(Y[t]);else{var e=R[t];Y[t]=f(e,W,y,b),h.push(Y[t])}})),h=h.sort((function(t,e){return e-t}));var p=!1;for(c=0;c=0;l--)c(l)}));var et=[];null===X||void 0===X||X.forEach((function(r){for(var o=A[r.id].idx,i=l(t.nodes,E[o],o,y,u).neighbors,a=!1,s=i.length-1;s>=0;s--){if(i.length+1J[d][p])i.splice(s,1);else{if(n){var g="".concat(c.id,"-").concat(r.id),x=M[g];if(p=tt[d].length-1,x>tt[d][p]){i.splice(s,1);continue}}var w=Y[f]?Y[f]:v(t,r,c,A,h,L,W,y,b,Y,R),S="".concat(V.id,"-").concat(d);if(w=0;h--){if("break"===x(h))break}if(v)return et.splice(r,1),"continue";o.edges=c;var w=(0,a.default)(o,o.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach((function(t){if(t!==o.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[y];if(s[e]--,s[e]rt[r][rt[r].length-1]){e=u[t].node[y];if(s[e]--,s[e]=0;M--){var k=o.nodes[M],_=u[k.id].degree,C=u[k.id].inDegree,O=u[k.id].outDegree,P=k[y],L=m(Z,P,I,T),D=L.minPatternNodeLabelDegree,j=L.minPatternNodeLabelInDegree,R=L.minPatternNodeLabelOutDegree;if(n?_=0;F--){var B=c[F];if(!u[B.source]||!u[B.target]){c.splice(F,1);var z=B[b];if(l[z]--,u[B.source]&&(u[B.source].degree--,u[B.source].outDegree--),u[B.target]&&(u[B.target].degree--,u[B.target].inDegree--),N[z]&&l[z]=0;it--){if("break"===ot(it))break}var at=et.length,st=function(t){var e=et[t],n={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=et[t],r={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1}));var o=!0;Object.keys(r).length!==Object.keys(n).length?o=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(o=!1)})),o&&et.splice(t,1)},o=at-1;o>t;o--)r(o);at=et.length};for(it=0;it<=at-1;it++)st(it);return et}}};e.default=y},2591:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(8710))&&r.__esModule?r:{default:r},i=n(8972);var a=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={},d={};s.forEach((function(t,e){var n=(0,i.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},d[t.id]={node:t,idx:e}}));var f=(0,o.default)(t,e),h=[],p={};f.forEach((function(t,e){var n=0,r=s[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var o=s[e].id;p[r][o]=t}})),h.push(n)}));for(var g=0,v=function(){var t=!1;if(s.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],o=d[t].node.clusterId;n[o]||(n[o]=0),n[o]+=r}));var r=-1/0,o=[];if(Object.keys(n).forEach((function(t){r=0&&o.splice(i,1),o&&o.length){t=!0;var a=l[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*o.length),c=l[o[u]];c.nodes.push(e),e.clusterId=c.id}}})),!t)return"break";g++};g{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(5527),o=u(n(8710)),i=u(n(9601)),a=n(5442),s=n(6193);function u(t){return t&&t.__esModule?t:{default:t}}var c=function(t,e,n,r){for(var o=e.length,i=2*r,a=0,s=0;s0&&O>I&&O-II&&(N=v.map((function(t){return{node:t,clusterId:t.clusterId}})),P=(0,r.clone)(S),I=O),L||T>100)break;T++,Object.keys(S).forEach((function(t){var e=0;y.forEach((function(r){var o=r.source,i=r.target,a=M[o].node.clusterId,s=M[i].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),S[t].sumTot=e})),v.forEach((function(t,e){var r,o=S[t.clusterId],i=0,a=_[e]/(2*C),s=0,c=o.nodes;c.forEach((function(t){var n=M[t.id].idx;s+=k[e][n]||0}));var d=s-o.sumTot*a,f=c.filter((function(e){return e.id!==t.id})),h=[];f.forEach((function(t,e){h[e]=b[t.originIndex]}));var g=l(f,b)*p,v=A[t.id];if(Object.keys(v).forEach((function(n){var o=M[n].node.clusterId;if(o!==t.clusterId){var s=S[o],c=s.nodes;if(c&&c.length){var f=0;c.forEach((function(t){var n=M[t.id].idx;f+=k[e][n]||0}));var h=f-s.sumTot*a,v=c.concat([t]),m=[];v.forEach((function(t,e){m[e]=b[t.originIndex]}));var y=l(v,b)*p,x=h-d;u&&(x=h+y-(d+g)),x>i&&(i=x,r=s)}}})),i>0){r.nodes.push(t);var m=t.clusterId;t.clusterId=r.id;var x=o.nodes.indexOf(t);o.nodes.splice(x,1);var w=0,E=0;y.forEach((function(t){var e=t.source,o=t.target,i=M[e].node.clusterId,a=M[o].node.clusterId;(i===r.id&&a!==r.id||a===r.id&&i!==r.id)&&(w+=t[n]||1),(i===m&&a!==m||a===m&&i!==m)&&(E+=t[n]||1)})),r.sumTot=w,o.sumTot=E}}))}var D={},j=0;Object.keys(P).forEach((function(t){var e=P[t];if(e.nodes&&e.nodes.length){var n=String(j+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),P[n]=e,D[t]=n,delete P[t],j++)}else delete P[t]})),N.forEach((function(t){var e=t.node,n=t.clusterId;e&&(e.clusterId=n,e.clusterId&&D[e.clusterId]&&(e.clusterId=D[e.clusterId]))}));var R=[],F={};y.forEach((function(t){var e=t.source,r=t.target,o=t[n]||1,i=M[e].node.clusterId,a=M[r].node.clusterId;if(i&&a){var s="".concat(i,"---").concat(a);if(F[s])F[s].weight+=o,F[s].count++;else{var u={source:i,target:a,weight:o,count:1};F[s]=u,R.push(u)}}}));var B=[];return Object.keys(P).forEach((function(t){B.push(P[t])})),{clusters:B,clusterEdges:R}};e.default=d},1496:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(4598)),o=a(n(9821)),i=n(8972);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var n=[],r=t.nodes,a=void 0===r?[]:r,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return n;var c=a[0],l=new Set;l.add(c);var d=new o.default((function(t,n){return e?t.weight-n.weight:0}));for((0,i.getEdgesByNodeId)(c.id,u).forEach((function(t){d.insert(t)}));!d.isEmpty();){var f=d.delMin(),h=f.source,p=f.target;l.has(h)&&l.has(p)||(n.push(f),l.has(h)||(l.add(h),(0,i.getEdgesByNodeId)(h,u).forEach((function(t){d.insert(t)}))),l.has(p)||(l.add(p),(0,i.getEdgesByNodeId)(p,u).forEach((function(t){d.insert(t)}))))}return n},u=function(t,e){var n=[],o=t.nodes,i=void 0===o?[]:o,a=t.edges,s=void 0===a?[]:a;if(0===i.length)return n;var u=s.map((function(t){return t}));e&&u.sort((function(t,e){return t.weight-e.weight}));for(var c=new r.default(i.map((function(t){return t.id})));u.length>0;){var l=u.shift(),d=l.source,f=l.target;c.connected(d,f)||(n.push(l),c.union(d,f))}return n},c=function(t,e,n){return n?{prim:s,kruskal:u}[n](t,e):u(t,e)};e.default=c},4409:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(9268))&&r.__esModule?r:{default:r},i=n(8972);var a=function(t,e,n){"number"!==typeof e&&(e=1e-6),"number"!==typeof n&&(n=.85);for(var r,a=1,s=0,u=1e3,c=t.nodes,l=void 0===c?[]:c,d=t.edges,f=void 0===d?[]:d,h=l.length,p={},g={},v=0;v0&&a>e;){s=0;for(v=0;v0&&(r+=g[w]/E)}p[y]=n*r,s+=p[y]}}s=(1-s)/h,a=0;for(v=0;v{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(t,e){return t-e},r=function(){function t(t){void 0===t&&(t=n),this.compareFn=t,this.list=[]}return t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),o=this.getRight(t),i=this.list.length;null!==r&&r0?n=r:null!==o&&o0&&(n=o),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}();e.default=r},5687:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var n=function(t,e){return t===e},r=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=r;var o=function(){function t(t){void 0===t&&(t=n),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new r(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new r(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,o=void 0===r?void 0:r;if(!this.head)return null;for(var i=this.head;i;){if(o&&o(i.value))return i;if(void 0!==n&&this.compare(i.value,n))return i;i=i.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}();e.default=o},9168:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(5687))&&r.__esModule?r:{default:r};var i=function(){function t(){this.linkedList=new o.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=i},4598:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DistanceType=void 0,e.DistanceType=n,function(t){t.EuclideanDistance="euclideanDistance"}(n||(e.DistanceType=n={}))},8972:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=e.getOutEdgesNodeId=e.getNeighbors=e.getEdgesByNodeId=void 0;e.getNeighbors=function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))};e.getOutEdgesNodeId=function(t,e){return e.filter((function(e){return e.source===t}))};e.getEdgesByNodeId=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))};e.uniqueId=function(t){void 0===t&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)}},6193:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.oneHot=e.getDistance=e.getAllKeyValueMap=e.default=void 0;var r,o=n(5527),i=n(7103),a=(r=n(9601))&&r.__esModule?r:{default:r};var s=function(t,e,n){var r=[];(null===e||void 0===e?void 0:e.length)?r=e:(t.forEach((function(t){r=r.concat(Object.keys(t))})),r=(0,o.uniq)(r));var i={};return r.forEach((function(e){var r=[];t.forEach((function(t){void 0!==t[e]&&""!==t[e]&&r.push(t[e])})),r.length&&!(null===n||void 0===n?void 0:n.includes(e))&&(i[e]=(0,o.uniq)(r))})),i};e.getAllKeyValueMap=s;var u=function(t,e,n){var r=s(t,e,n),o=[];if(!Object.keys(r).length)return o;var i=Object.values(r).every((function(t){return t.every((function(t){return"number"===typeof t}))}));return t.forEach((function(t,e){var n=[];Object.keys(r).forEach((function(e){var o=t[e],a=r[e],s=a.findIndex((function(t){return o===t})),u=[];if(i)u.push(o);else for(var c=0;c{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPropertyWeight=e.getAllSortProperties=e.getAllProperties=e.default=void 0;var r=n(3495),o=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=100);var n={};t.forEach((function(t){t.properties&&Object.keys(t.properties).forEach((function(e){"id"===e||!"".concat(t.properties[e]).match(r.secondReg)&&!"".concat(t.properties[e]).match(r.dateReg)&&isNaN(Number(t.properties[e]))?n.hasOwnProperty(e)&&delete n[e]:n.hasOwnProperty(e)?n[e]+=1:n[e]=1}))}));var o=Object.keys(n).sort((function(t,e){return n[e]-n[t]}));return o.length{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(5527),o=function(){function t(t){this.arr=t}return t.prototype.getArr=function(){return this.arr||[]},t.prototype.add=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null===r||void 0===r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var o=[];for(var i in this.arr)o[i]=this.arr[i]+r[i];return new t(o)}},t.prototype.subtract=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null===r||void 0===r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var o=[];for(var i in this.arr)o[i]=this.arr[i]-r[i];return new t(o)}},t.prototype.avg=function(e){var n=[];if(0!==e)for(var r in this.arr)n[r]=this.arr[r]/e;return new t(n)},t.prototype.negate=function(){var e=[];for(var n in this.arr)e[n]=-this.arr[n];return new t(e)},t.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null===n||void 0===n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var o in this.arr)r+=Math.pow(this.arr[o]-t.arr[o],2);return r}},t.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null===n||void 0===n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var o in this.arr)r+=Math.pow(this.arr[o]-t.arr[o],2);return Math.sqrt(r)}console.error("The two vectors are unequal in length.")},t.prototype.normalize=function(){var e=[],n=(0,r.clone)(this.arr);n.sort((function(t,e){return t-e}));var o=n[n.length-1],i=n[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(o-i);return new t(e)},t.prototype.norm2=function(){var t;if(!(null===(t=this.arr)||void 0===t?void 0:t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},t.prototype.dot=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null===n||void 0===n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var o in this.arr)r+=this.arr[o]*t.arr[o];return r}console.error("The two vectors are unequal in length.")},t.prototype.equal=function(t){var e,n=t.arr;if((null===(e=this.arr)||void 0===e?void 0:e.length)!==(null===n||void 0===n?void 0:n.length))return!1;for(var r in this.arr)if(this.arr[r]!==n[r])return!1;return!0},t}();e.default=o},6495:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDI",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"breadthFirstSearch",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"connectedComponent",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"depthFirstSearch",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"detectCycle",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"dijkstra",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"findAllPath",{enumerable:!0,get:function(){return d.findAllPath}}),Object.defineProperty(e,"findShortestPath",{enumerable:!0,get:function(){return d.findShortestPath}}),Object.defineProperty(e,"floydWarshall",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"getAdjMatrix",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"getDegree",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"getInDegree",{enumerable:!0,get:function(){return s.getInDegree}}),Object.defineProperty(e,"getNeighbors",{enumerable:!0,get:function(){return y.getNeighbors}}),Object.defineProperty(e,"getOutDegree",{enumerable:!0,get:function(){return s.getOutDegree}}),Object.defineProperty(e,"labelPropagation",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"louvain",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"minimumSpanningTree",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"pageRank",{enumerable:!0,get:function(){return v.default}});var o=x(n(8710)),i=x(n(9307)),a=x(n(851)),s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var n=b(e);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=i?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=t[a]}o.default=t,n&&n.set(t,o);return o}(n(9268)),u=x(n(952)),c=x(n(849)),l=x(n(4490)),d=n(7951),f=x(n(72)),h=x(n(2591)),p=x(n(4112)),g=x(n(1496)),v=x(n(4409)),m=x(n(733)),y=n(8972);function b(t){if("function"!==typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(b=function(t){return t?n:e})(t)}function x(t){return t&&t.__esModule?t:{default:t}}},9468:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MESSAGE=e.ALGORITHM=void 0;e.ALGORITHM={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};e.MESSAGE={SUCCESS:"SUCCESS",FAILURE:"FAILURE"}},2930:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=n(9468),i=(r=n(2604))&&r.__esModule?r:{default:r};var a=function(t){return function(){for(var e=[],n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pageRankAsync=e.minimumSpanningTreeAsync=e.louvainAsync=e.labelPropagationAsync=e.getOutDegreeAsync=e.getNeighborsAsync=e.getInDegreeAsync=e.getDegreeAsync=e.getAdjMatrixAsync=e.floydWarshallAsync=e.findShortestPathAsync=e.findAllPathAsync=e.dijkstraAsync=e.detectCycleAsync=e.detectAllUndirectedCycleAsync=e.detectAllDirectedCycleAsync=e.detectAllCyclesAsync=e.connectedComponentAsync=e.GADDIAsync=void 0;var r,o=(r=n(2930))&&r.__esModule?r:{default:r},i=n(9468);e.getAdjMatrixAsync=function(t,e){return(0,o.default)(i.ALGORITHM.getAdjMatrix).apply(void 0,[t,e])};e.connectedComponentAsync=function(t,e){return(0,o.default)(i.ALGORITHM.connectedComponent).apply(void 0,[t,e])};e.getDegreeAsync=function(t){return(0,o.default)(i.ALGORITHM.getDegree)(t)};e.getInDegreeAsync=function(t,e){return(0,o.default)(i.ALGORITHM.getInDegree)(t,e)};e.getOutDegreeAsync=function(t,e){return(0,o.default)(i.ALGORITHM.getOutDegree)(t,e)};e.detectCycleAsync=function(t){return(0,o.default)(i.ALGORITHM.detectCycle)(t)};e.detectAllCyclesAsync=function(t){return(0,o.default)(i.ALGORITHM.detectAllCycles)(t)};e.detectAllDirectedCycleAsync=function(t){return(0,o.default)(i.ALGORITHM.detectAllDirectedCycle)(t)};e.detectAllUndirectedCycleAsync=function(t){return(0,o.default)(i.ALGORITHM.detectAllUndirectedCycle)(t)};e.dijkstraAsync=function(t,e,n,r){return(0,o.default)(i.ALGORITHM.dijkstra).apply(void 0,[t,e,n,r])};e.findAllPathAsync=function(t,e,n,r){return(0,o.default)(i.ALGORITHM.findAllPath).apply(void 0,[t,e,n,r])};e.findShortestPathAsync=function(t,e,n,r,a){return(0,o.default)(i.ALGORITHM.findShortestPath).apply(void 0,[t,e,n,r,a])};e.floydWarshallAsync=function(t,e){return(0,o.default)(i.ALGORITHM.floydWarshall).apply(void 0,[t,e])};e.labelPropagationAsync=function(t,e,n,r){return void 0===r&&(r=1e3),(0,o.default)(i.ALGORITHM.labelPropagation)(t,e,n,r)};e.louvainAsync=function(t,e,n,r){return(0,o.default)(i.ALGORITHM.louvain)(t,e,n,r)};e.minimumSpanningTreeAsync=function(t,e,n){return(0,o.default)(i.ALGORITHM.minimumSpanningTree).apply(void 0,[t,e,n])};e.pageRankAsync=function(t,e,n){return(0,o.default)(i.ALGORITHM.pageRank).apply(void 0,[t,e,n])};e.getNeighborsAsync=function(t,e,n){return(0,o.default)(i.ALGORITHM.getNeighbors).apply(void 0,[t,e,n])};e.GADDIAsync=function(t,e,n,r,a,s,u){return void 0===n&&(n=!1),void 0===s&&(s="cluster"),void 0===u&&(u="cluster"),(0,o.default)(i.ALGORITHM.GADDI).apply(void 0,[t,e,n,r,a,s,u])}},2604:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!==typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var u=i?Object.getOwnPropertyDescriptor(t,s):null;u&&(u.get||u.set)?Object.defineProperty(o,s,u):o[s]=t[s]}o.default=t,n&&n.set(t,o);return o}(n(6495)),i=n(9468);function a(t){if("function"!==typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}var s="undefined"!==typeof self?self:{};s.onmessage=function(t){var e=t.data,n=e._algorithmType,r=e.data;if(n)if("function"!==typeof o[n])s.postMessage({_algorithmType:i.MESSAGE.FAILURE});else{var a=o[n].apply(o,r);s.postMessage({_algorithmType:i.MESSAGE.SUCCESS,data:a})}};e.default=null},4601:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Kernel:()=>z,World:()=>Et});var r=n(467),o=n(4467),i=n(3029),a=n(2901),s=n(1641),u=n.n(s),c=n(9853),l=n.n(c),d=n(2279),f=n.n(d),h=n(4756),p=n.n(h),g=1;function v(){return g++}var m;!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(m||(m={}));var y,b,x,w,E=function(){function t(){(0,i.A)(this,t),this.config=void 0}return(0,a.A)(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}();"undefined"!==typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);!function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2",t.Vector3Float="vec3",t.Vector4Float="vec4",t.Vector2Boolean="vec2",t.Vector3Boolean="vec3",t.Vector4Boolean="vec4",t.Vector2Uint="vec2",t.Vector3Uint="vec3",t.Vector4Uint="vec4",t.Vector2Int="vec2",t.Vector3Int="vec3",t.Vector4Int="vec4",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3",t.Matrix4x4Float="mat4x4",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4[]"}(y||(y={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(b||(b={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(x||(x={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(w||(w={}));function S(){if("undefined"!==typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e0&&void 0!==o[0]?o[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n16)throw new Error("invalid data type ".concat(n));o[e]=function(){return t.data}}}));var a=this.getOuputDataTexture(),s=a.textureWidth,c=a.texelCount;o.u_OutputTextureSize=[s,s],o.u_OutputTexelCount=c,this.context.output.textureSize=[s,s];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:o,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return(0,a.A)(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:function(){var t=(0,r.A)(p().mark((function t(){var e,n,r,o,i,a,s,u,c=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,o=n.elementsPerTexel,i=n.typedArrayConstructor,a=void 0===i?Float32Array:i,s=[],4!==o)for(u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=new t;return n.setConfig(e),n.setEngine(new wt),n}}]),t}()},6226:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var i=n(6036);Object.defineProperty(e,"registerLayout",{enumerable:!0,get:function(){return i.registerLayout}}),Object.defineProperty(e,"unRegisterLayout",{enumerable:!0,get:function(){return i.unRegisterLayout}}),Object.defineProperty(e,"getLayoutByName",{enumerable:!0,get:function(){return i.getLayoutByName}}),o(n(1569),e)},5716:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var n=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}();e.Base=n},2852:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CircularLayout=void 0;var o=n(5716),i=n(5027);function a(t,e){var n=t.degree,r=e.degree;return nr?1:0}var s=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,o=n.length;if(0!==o){e.width||"undefined"===typeof window||(e.width=window.innerWidth),e.height||"undefined"===typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var a=e.center;if(1===o)return n[0].x=a[0],n[0].y=a[1],void(e.onLayoutEnd&&e.onLayoutEnd());var s=e.radius,u=e.startRadius,c=e.endRadius,l=e.divisions,d=e.startAngle,f=e.endAngle,h=e.angleRatio,p=e.ordering,g=e.clockwise,v=e.nodeSpacing,m=e.nodeSize,y=(f-d)/o,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var x=(0,i.getDegree)(n.length,b,r);if(e.degrees=x,v){var w=(0,i.getFuncByUnknownType)(10,v),E=(0,i.getFuncByUnknownType)(10,m),S=-1/0;n.forEach((function(t){var e=E(t);Se.width?e.width/2:e.height/2;var k=y*h,_=[];_="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var A=Math.ceil(o/l),C=0;C=0;M--)S(M);return{nodes:n,edges:r,combos:a,comboEdges:c}},e.prototype.getInnerGraphs=function(t){var e=this,n=e.comboTrees,r=e.nodeSize,i=e.edges,a=e.comboPadding,c=e.spacing,l={},d=this.innerLayout||new u.ConcentricLayout({type:"concentric",sortBy:"id"});return d.center=[0,0],d.preventOverlap=!0,d.nodeSpacing=c,(n||[]).forEach((function(e){(0,s.traverseTreeUp)(e,(function(e){var n,u=(null===a||void 0===a?void 0:a(e))||10;if((0,s.isArray)(u)&&(u=Math.max.apply(Math,u)),null===(n=e.children)||void 0===n?void 0:n.length){var c=e.children.map((function(e){if("combo"===e.itemType)return l[e.id];var n=t[e.id]||{};return o(o({},n),e)})),f=c.map((function(t){return t.id})),h={nodes:c,edges:i.filter((function(t){return f.includes(t.source)&&f.includes(t.target)}))},p=1/0;c.forEach((function(t){var e;t.size||(t.size=(null===(e=l[t.id])||void 0===e?void 0:e.size)||(null===r||void 0===r?void 0:r(t))||[30,30]),(0,s.isNumber)(t.size)&&(t.size=[t.size,t.size]),p>t.size[0]&&(p=t.size[0]),p>t.size[1]&&(p=t.size[1])})),d.layout(h);var g=(0,s.getLayoutBBox)(c),v=g.minX,m=g.minY,y=g.maxX,b=g.maxY,x={x:(y+v)/2,y:(b+m)/2};h.nodes.forEach((function(t){t.x-=x.x,t.y-=x.y}));var w=Math.max(y-v,p)+2*u,E=Math.max(b-m,p)+2*u;l[e.id]={id:e.id,nodes:c,size:[w,E]}}else if("combo"===e.itemType){var S=u?[2*u,2*u]:[30,30];l[e.id]={id:e.id,nodes:[],size:S}}return!0}))})),l},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,o=n.spacing;if(e=(0,s.isNumber)(o)?function(){return o}:(0,s.isFunction)(o)?o:function(){return 0},this.spacing=e,r)if((0,s.isFunction)(r))t=function(t){var n=r(t),o=e(t);return(0,s.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+o)/2:((n||10)+o)/2};else if((0,s.isArray)(r)){var i=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return i+e(t)/2}}else{var a=r/2;t=function(t){return a+e(t)/2}}else t=function(t){var n=e(t);return t.size?(0,s.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:(0,s.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var u,c=n.comboPadding;u=(0,s.isNumber)(c)?function(){return c}:(0,s.isArray)(c)?function(){return Math.max.apply(null,c)}:(0,s.isFunction)(c)?c:function(){return 0},this.comboPadding=u},e.prototype.getType=function(){return"comboCombined"},e}(a.Base);e.ComboCombinedLayout=c},1420:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=n(5716),i=n(5027),a=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"===typeof window||(t.width=window.innerWidth),t.height||"undefined"===typeof window||(t.height=window.innerHeight);var r=t.center,o=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var s=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){(0,i.isNumber)(t.x)&&(0,i.isNumber)(t.y)&&(t.x+=r[e].x*o,t.y+=r[e].y*o)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;um[1]?m[0]:m[1])/2;g=function(t){return b}}else{var x=m/2;g=function(t){return x}}else g=function(t){return t.size?(0,i.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,i.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=g;var w,E=t.comboSpacing;w=(0,i.isNumber)(E)?function(){return E}:(0,i.isFunction)(E)?E:function(){return 0},this.comboSpacing=w;var S,M=t.comboPadding;S=(0,i.isNumber)(M)?function(){return M}:(0,i.isArray)(M)?function(){return Math.max.apply(null,M)}:(0,i.isFunction)(M)?M:function(){return 0},this.comboPadding=S;var k,_=this.linkDistance;_||(_=10),k=(0,i.isNumber)(_)?function(t){return _}:_,this.linkDistance=k;var A,C=this.edgeStrength;C||(C=1),A=(0,i.isNumber)(C)?function(t){return C}:C,this.edgeStrength=A;var O,I=this.nodeStrength;I||(I=30),O=(0,i.isNumber)(I)?function(t){return I}:I,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,o=t[r];r&&o?(e.x=o.cx+100/(n+1),e.y=o.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,o={};return(n||[]).forEach((function(n){var a=[];(0,i.traverseTreeUp)(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===o[n.id]){var s={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};o[n.id]=s}var u=n.children;u&&u.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;a.push(t)}));var c=o[n.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var l=r[n.id];c.cx=l.x,c.cy=l.y}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=o[t.id];return(0,i.isNumber)(n.cx)&&(c.cx+=n.cx),void((0,i.isNumber)(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&((0,i.isNumber)(r.x)&&(c.cx+=r.x),(0,i.isNumber)(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=a,!0}))})),o},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,o=this.alpha,a=e.comboTrees,s=e.indexMap,u=e.nodeMap,c=e.comboMap;(a||[]).forEach((function(e){(0,i.traverseTreeUp)(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],a=(n.depth+1)/10*.5,l=n.cx,d=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var f=c[e.id];return f&&(0,i.isNumber)(f.cx)&&(n.cx+=f.cx),void(f&&(0,i.isNumber)(f.cy)&&(n.cy+=f.cy))}var h=u[e.id],p=h.x-l||.005,g=h.y-d||.005,v=Math.sqrt(p*p+g*g),m=s[h.id],y=r*o/v*a;t[m].x-=p*y,t[m].y-=g*y,(0,i.isNumber)(h.x)&&(n.cx+=h.x),(0,i.isNumber)(h.y)&&(n.cy+=h.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,o={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(ei&&(c.minX=i),c.minY>a&&(c.minY=a),c.maxX1&&r.forEach((function(n,i){if("node"===n.itemType)return!1;var u=e[n.id];u&&r.forEach((function(r,c){if(i<=c)return!1;if("node"===r.itemType)return!1;var l=e[r.id];if(!l)return!1;var d=u.cx-l.cx||.005,f=u.cy-l.cy||.005,h=d*d+f*f,p=u.r||1,g=l.r||1,v=p+g,m=g*g,y=p*p;if(ho)){var m=e["".concat(h.id,"-").concat(n.id)],y=m.vx,b=m.vy,x=Math.log(Math.abs(n.depth-h.depth)/10)+1||1;x=x<1?1:x,n.comboId!==h.comboId&&(x+=1);var w=x?Math.pow(d,x):1,E=i(n)*a/g*w;if(t[p].x+=y*E,t[p].y+=b*E,p0){var e=Math.abs(m[0][n.sortBy]-t[n.sortBy]);n.maxLevelDiff&&e>=n.maxLevelDiff&&(m=[],v.push(m))}m.push(t)}));var y=u+(f||n.minNodeSpacing);if(!n.preventOverlap){var b=v.length>0&&v[0].length>1,x=(Math.min(n.width,n.height)/2-y)/(v.length+(b?1:0));y=Math.min(y,x)}var w=0;if(v.forEach((function(t){var e=n.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var r=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&n.preventOverlap){var o=Math.cos(r)-Math.cos(0),i=Math.sin(r)-Math.sin(0),a=Math.sqrt(y*y/(o*o+i*i));w=Math.max(a,w)}t.r=w,w+=y})),n.equidistant){for(var E=0,S=0,M=0;M{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FORCE_LAYOUT_TYPE_MAP=e.LAYOUT_MESSAGE=void 0,e.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"},e.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0}},6452:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DagreLayout=void 0;var i=o(n(6251)),a=n(5027),s=n(5716),u=n(3235),c=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},e.prototype.execute=function(){var t,e,n,r,o=this,s=this,c=s.nodes,d=s.nodeSize,f=s.rankdir,h=s.combos,p=s.begin,g=s.radial,v=s.comboEdges,m=void 0===v?[]:v,y=s.vedges,b=void 0===y?[]:y;if(c){var x=s.edges||[],w=new u.Graph({multigraph:!0,compound:!0});s.nodeMap={};var E={};c.forEach((function(t){s.nodeMap[t.id]=t,t.comboId&&(E[t.comboId]=E[t.comboId]||[],E[t.comboId].push(t.id))}));var S,M=[],k={};(null===(t=s.nodeOrder)||void 0===t?void 0:t.length)?(s.nodeOrder.forEach((function(t){k[t]=!0,M.push(s.nodeMap[t])})),c.forEach((function(t){k[t.id]||M.push(t)}))):M=c,S=d?(0,a.isArray)(d)?function(){return d}:function(){return[d,d]}:function(t){return t.size?(0,a.isArray)(t.size)?t.size:(0,a.isObject)(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var _=(0,a.getFunc)(s.ranksep,50,s.ranksepFunc),A=(0,a.getFunc)(s.nodesep,50,s.nodesepFunc),C=A,O=_;"LR"!==f&&"RL"!==f||(C=_,O=A),w.setDefaultEdgeLabel((function(){return{}})),w.setGraph(s);var I={};this.sortByCombo&&h&&h.forEach((function(t){if(I[t.id]=t,t.collapsed){var e=S(t),n=O(t),r=C(t),o=e[0]+2*r,i=e[1]+2*n;w.setNode(t.id,{width:o,height:i})}t.parentId&&(I[t.parentId]||w.setNode(t.parentId,{}),w.setParent(t.id,t.parentId))})),M.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=S(t),n=O(t),r=C(t),i=e[0]+2*r,s=e[1]+2*n,u=t.layer;(0,a.isNumber)(u)?w.setNode(t.id,{width:i,height:s,layer:u}):w.setNode(t.id,{width:i,height:s}),o.sortByCombo&&t.comboId&&(I[t.comboId]||(I[t.comboId]={id:t.comboId},w.setNode(t.comboId,{})),w.setParent(t.id,t.comboId))})),x.forEach((function(t){var e=(0,a.getEdgeTerminal)(t,"source"),n=(0,a.getEdgeTerminal)(t,"target");o.layoutNode(e)&&o.layoutNode(n)&&w.setEdge(e,n,{weight:t.weight||1})})),null===(e=null===m||void 0===m?void 0:m.concat(b||[]))||void 0===e||e.forEach((function(t){var e,n,r=t.source,o=t.target,i=(null===(e=I[r])||void 0===e?void 0:e.collapsed)?[r]:E[r]||[r],a=(null===(n=I[o])||void 0===n?void 0:n.collapsed)?[o]:E[o]||[o];i.forEach((function(e){a.forEach((function(n){w.setEdge(e,n,{weight:t.weight||1})}))}))}));var T=void 0;(null===(n=s.preset)||void 0===n?void 0:n.nodes)&&(T=new u.Graph({multigraph:!0,compound:!0}),s.preset.nodes.forEach((function(t){null===T||void 0===T||T.setNode(t.id,t)}))),i.default.layout(w,{prevGraph:T,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:Boolean(!!s.nodeOrder),nodeOrder:s.nodeOrder});var N=[0,0];if(p){var P=1/0,L=1/0;w.nodes().forEach((function(t){var e=w.node(t);P>e.x&&(P=e.x),L>e.y&&(L=e.y)})),w.edges().forEach((function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach((function(t){P>t.x&&(P=t.x),L>t.y&&(L=t.y)}))})),N[0]=p[0]-P,N[1]=p[1]-L}var D="LR"===f||"RL"===f;if(g){var j=this,R=j.focusNode,F=j.ranksep,B=j.getRadialPos,z=(0,a.isString)(R)?R:null===R||void 0===R?void 0:R.id,G=z?null===(r=w.node(z))||void 0===r?void 0:r._rank:0,U=[],W=D?"y":"x",Y=D?"height":"width",V=1/0,X=-1/0;w.nodes().forEach((function(t){var e=w.node(t);if(s.nodeMap[t]){var n=A(s.nodeMap[t]);if(0===G)U[e._rank]||(U[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),U[e._rank].nodes.push(t),U[e._rank].totalWidth+=2*n+e[Y],U[e._rank].maxSizeX&&(X=a)}}));var H=F||50,q={},Z=(X-V)/.9,K=[.5*(V+X-Z),.5*(V+X+Z)],$=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var o=n;return t.forEach((function(t){var n=w.node(t);q[t]=e;var i=B(n[W],K,Z,e,r),a=i.x,u=i.y;if(s.nodeMap[t]){s.nodeMap[t].x=a+N[0],s.nodeMap[t].y=u+N[1],s.nodeMap[t]._order=n._order;var c=_(s.nodeMap[t]);o=o}))}:function(t,e,n){var r=Math.max(e.x,n.x),o=Math.min(e.x,n.x);return t.filter((function(t){return t.x<=r&&t.x>=o}))};w.edges().forEach((function(t){var e,n=w.edge(t),r=x.findIndex((function(e){var n=(0,a.getEdgeTerminal)(e,"source"),r=(0,a.getEdgeTerminal)(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&s.edgeLabelSpace&&s.controlPoints&&"loop"!==x[r].type){null===(e=null===n||void 0===n?void 0:n.points)||void 0===e||e.forEach((function(t){t.x+=N[0],t.y+=N[1]}));var o=s.nodeMap[t.v],i=s.nodeMap[t.w];x[r].controlPoints=l(null===n||void 0===n?void 0:n.points,o,i,et,D,nt,rt)}}))}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:c,edges:x}}},e.prototype.getRadialPos=function(t,e,n,r,o){void 0===o&&(o=[0,1]);var i=(t-e[0])/n,a=2*(i=i*(o[1]-o[0])+o[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},e.prototype.getType=function(){return"dagre"},e}(s.Base);e.DagreLayout=c;var l=function(t,e,n,r,o,i,a){var s=(null===t||void 0===t?void 0:t.slice(1,t.length-1))||[];if(e&&n){var u=e.x,c=e.y,l=n.x,d=n.y;if(o&&(u=e.y,c=e.x,l=n.y,d=n.x),d!==c&&u!==l){var f=r.indexOf(c),h=r[f+1];if(h){var p=s[0],g=o?{x:(c+h)/2,y:(null===p||void 0===p?void 0:p.y)||l}:{x:(null===p||void 0===p?void 0:p.x)||l,y:(c+h)/2};p&&!i(p,g)||s.unshift(g)}var v=r.indexOf(d),m=Math.abs(v-f);if(1===m)(s=a(s,e,n)).length||s.push(o?{x:(c+d)/2,y:u}:{x:u,y:(c+d)/2});else if(m>1){var y=r[v-1];if(y){var b=s[s.length-1],x=o?{x:(d+y)/2,y:(null===b||void 0===b?void 0:b.y)||l}:{x:(null===b||void 0===b?void 0:b.x)||u,y:(d+y)/2};b&&!i(b,x)||s.push(x)}}}}return s}},3235:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(n(5285).Graph);e.Graph=o},6251:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(3866)),i=n(7252);e.default={layout:o.default,util:{time:i.time,notime:i.notime}}},4838:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(8687)),i=function(t){var e=[],n={},r={},o=function(i){var a;r[i]||(r[i]=!0,n[i]=!0,null===(a=t.outEdges(i))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):o(t.w)})),delete n[i])};return t.nodes().forEach(o),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,o.default)(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):i(t);null===e||void 0===e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))},undo:function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},295:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7252),o=function(t,e,n,o,i,a){var s={rank:a,borderType:e,width:0,height:0},u=i[e][a-1],c=(0,r.addDummyNode)(t,"border",s,n);i[e][a]=c,t.setParent(c,o),u&&t.setEdge(u,c,{weight:1})};e.default=function(t){var e,n=function(e){var r=t.children(e),i=t.node(e);if((null===r||void 0===r?void 0:r.length)&&r.forEach((function(t){return n(t)})),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){t.nodes().forEach((function(e){r(t.node(e))})),t.edges().forEach((function(e){r(t.edge(e))}))},r=function(t){var e=t.width;t.width=t.height,t.height=e},o=function(t){t.nodes().forEach((function(e){i(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return i(t)})),r.hasOwnProperty("y")&&i(r)}))},i=function(t){(null===t||void 0===t?void 0:t.y)&&(t.y=-t.y)},a=function(t){t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return s(t)})),r.hasOwnProperty("x")&&s(r)}))},s=function(t){var e=t.x;t.x=t.y,t.y=e};e.default={adjust:function(t){var e,r=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==r&&"rl"!==r||n(t)},undo:function(t){var e,r=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==r&&"rl"!==r||o(t),"lr"!==r&&"rl"!==r||(a(t),n(t))}}},3907:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if("next"!==t&&"prev"!==t)return e},r=function(t){t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev},o=function(){function t(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return t.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return r(e),e},t.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&r(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},t.prototype.toString=function(){for(var t=[],e=this.shortcut,r=e.prev;r!==e;)t.push(JSON.stringify(r,n)),r=null===r||void 0===r?void 0:r.prev;return"[".concat(t.join(", "),"]")},t}();e.default=o},8687:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(n(3907)),a=n(5285),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.default),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(a.Graph),c=function(){return 1},l=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)d(t,e,n,r);for(;r=i.dequeue();)d(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){o=o.concat(d(t,e,n,r,!0));break}}return o},d=function(t,e,n,r,o){var i,a,s=[];return null===(i=t.inEdges(r.v))||void 0===i||i.forEach((function(r){var i=t.edge(r),a=t.node(r.v);o&&s.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=i,h(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var o=t.edge(r),i=r.w,a=t.node(i);void 0===a.in&&(a.in=0),a.in-=o,h(e,n,a)})),t.removeNode(r.v),o?s:void 0},f=function(t,e){var n=new u,r=0,o=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var i=n.edge(t)||0,a=(null===e||void 0===e?void 0:e(t))||1,s=i+a;n.setEdge(t.v,t.w,s),o=Math.max(o,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var i=[],a=o+r+3,c=0;c{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7252),o=function(t,e,n,i,a,s,u){var c=t.children(u);if(null===c||void 0===c?void 0:c.length){var l=(0,r.addBorderNode)(t,"_bt"),d=(0,r.addBorderNode)(t,"_bb"),f=t.node(u);t.setParent(l,u),f.borderTop=l,t.setParent(d,u),f.borderBottom=d,null===c||void 0===c||c.forEach((function(r){o(t,e,n,i,a,s,r);var c=t.node(r),f=c.borderTop?c.borderTop:r,h=c.borderBottom?c.borderBottom:r,p=c.borderTop?i:2*i,g=f!==h?1:a-s[u]+1;t.setEdge(l,f,{minlen:g,weight:p,nestingEdge:!0}),t.setEdge(h,d,{minlen:g,weight:p,nestingEdge:!0})})),t.parent(u)||t.setEdge(e,l,{weight:0,minlen:a+s[u]})}else u!==e&&t.setEdge(e,u,{weight:0,minlen:n})},i=function(t){var e,n={},r=function(e,o){var i=t.children(e);null===i||void 0===i||i.forEach((function(t){return r(t,o+1)})),n[e]=o};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n},a=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e};e.default={run:function(t){var e,n=(0,r.addDummyNode)(t,"root",{},"_root"),s=i(t),u=Math.max.apply(Math,Object.values(s));Math.abs(u)===1/0&&(u=1);var c=u-1,l=2*c+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=l}));var d=a(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){o(t,n,l,d,c,s,e)})),t.graph().nodeRankFactor=l},cleanup:function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdgeObj(e)}))}}},2257:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7252),o=function(t,e){var n=e.v,o=t.node(n).rank,i=e.w,a=t.node(i).rank,s=e.name,u=t.edge(e),c=u.labelRank;if(a!==o+1){t.removeEdgeObj(e);var l,d,f,h=t.graph();for(f=0,++o;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,n){var r,o={};null===n||void 0===n||n.forEach((function(n){for(var i,a,s=t.parent(n);s;){if((i=t.parent(s))?(a=o[i],o[i]=s):(a=r,r=s),a&&a!==s)return void e.setEdge(a,s);s=i}}))}},1780:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null===n||void 0===n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null===n||void 0===n||n.forEach((function(e){var n=t.edge(e),o=t.node(e.v);r.sum+=n.weight*o.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}},1460:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3235),o=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e};e.default=function(t,e,n){var i=o(t),a=new r.Graph({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(r){var o,s=t.node(r),u=t.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(r),a.setParent(r,u||i),null===(o=t[n](r))||void 0===o||o.forEach((function(e){var n=e.v===r?e.w:e.v,o=a.edgeFromArgs(n,r),i=void 0!==o?o.weight:0;a.setEdge(n,r,{weight:t.edge(e).weight+i})})),s.hasOwnProperty("minRank")&&a.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},9039:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7252),o=function(t,e,n){for(var o=(0,r.zipObject)(n,n.map((function(t,e){return e}))),i=e.map((function(e){var n,r=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:o[e.w]||0,weight:t.edge(e).weight}}));return null===r||void 0===r?void 0:r.sort((function(t,e){return t.pos-e.pos}))})).flat().filter((function(t){return void 0!==t})),a=1;a0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}})),c};e.default=function(t,e){for(var n=0,r=1;r<(null===e||void 0===e?void 0:e.length);r+=1)n+=o(t,e[r-1],e[r]);return n}},3114:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(6838)),i=r(n(9039)),a=r(n(1460)),s=r(n(3392)),u=r(n(1032)),c=n(5027),l=n(3235),d=n(7252),f=function(t,e,n){return e.map((function(e){return(0,a.default)(t,e,n)}))},h=function(t,e,n,r){var o=new l.Graph;null===t||void 0===t||t.forEach((function(t){for(var i,a=t.graph().root,c=(0,u.default)(t,a,o,e,n,r),l=0;l<(null===(i=c.vs)||void 0===i?void 0:i.length);l++){var d=t.node(c.vs[l]);d&&(d.order=l)}(0,s.default)(t,o,c.vs)}))},p=function(t,e){null===e||void 0===e||e.forEach((function(e){null===e||void 0===e||e.forEach((function(e,n){t.node(e).order=n}))}))};e.default=function(t,e){for(var n=(0,d.maxRank)(t),r=[],a=[],s=1;s-1;s--)a.push(s);var u=f(t,r,"inEdges"),l=f(t,a,"outEdges"),g=(0,o.default)(t);p(t,g);for(var v,m=Number.POSITIVE_INFINITY,y=(s=0,0);y<4;++s,++y){h(s%2?u:l,s%4>=2,!1,e),g=(0,d.buildLayerMatrix)(t),(b=(0,i.default)(t,g))=2,!0,e),g=(0,d.buildLayerMatrix)(t),(b=(0,i.default)(t,g)){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})).map((function(e){return t.node(e).rank})),r=Math.max.apply(Math,n),o=[],i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3905);e.default=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),o=n.map((function(e){return t.node(e).rank})),i=(0,r.max)(o),a=[],s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){for(var e,n,o=[],i=function(){var i=t.pop();o.push(i),null===(e=i.in.reverse())||void 0===e||e.forEach((function(t){return(e=i,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&r(e,t)})(t);var e})),null===(n=i.out)||void 0===n||n.forEach((function(e){return(n=i,function(e){e.in.push(n),0===--e.indegree&&t.push(e)})(e);var n}))};null===t||void 0===t?void 0:t.length;)i();var a=o.filter((function(t){return!t.merged})),s=["vs","i","barycenter","weight"];return a.map((function(t){var e={};return null===s||void 0===s||s.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))},r=function(t,e){var n,r=0,o=0;t.weight&&(r+=t.barycenter*t.weight,o+=t.weight),e.weight&&(r+=e.barycenter*e.weight,o+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/o,t.weight=o,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var r,o,i,a={};null===t||void 0===t||t.forEach((function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=a[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(r=e.edges())||void 0===r||r.forEach((function(t){var e=a[t.v],n=a[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(a[t.w]))}));var s=null===(i=(o=Object.values(a)).filter)||void 0===i?void 0:i.call(o,(function(t){return!t.indegree}));return n(s)}},1032:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(1780)),i=r(n(8559)),a=r(n(1825)),s=function(t,e,n,r,l,d){var f,h,p,g,v=t.children(e),m=t.node(e),y=m?m.borderLeft:void 0,b=m?m.borderRight:void 0,x={};y&&(v=null===v||void 0===v?void 0:v.filter((function(t){return t!==y&&t!==b})));var w=(0,o.default)(t,v||[]);null===w||void 0===w||w.forEach((function(e){var o;if(null===(o=t.children(e.v))||void 0===o?void 0:o.length){var i=s(t,e.v,n,r,d);x[e.v]=i,i.hasOwnProperty("barycenter")&&c(e,i)}}));var E=(0,i.default)(w,n);u(E,x),null===(f=E.filter((function(t){return t.vs.length>0})))||void 0===f||f.forEach((function(e){var n=t.node(e.vs[0]);n&&(e.fixorder=n.fixorder,e.order=n.order)}));var S=(0,a.default)(E,r,l,d);if(y&&(S.vs=[y,S.vs,b].flat(),null===(h=t.predecessors(y))||void 0===h?void 0:h.length)){var M=t.node((null===(p=t.predecessors(y))||void 0===p?void 0:p[0])||""),k=t.node((null===(g=t.predecessors(b))||void 0===g?void 0:g[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+M.order+k.order)/(S.weight+2),S.weight+=2}return S},u=function(t,e){null===t||void 0===t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))},c=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=s},1825:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7252),o=function(t,e,n){for(var r,o=n;e.length&&(r=e[e.length-1]).i<=o;)e.pop(),null===t||void 0===t||t.push(r.vs),o++;return o},i=function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenterr.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.orderr.order)return 1}return t?r.i-n.i:n.i-r.i}};e.default=function(t,e,n,a){var s=(0,r.partition)(t,(function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")})),u=s.lhs,c=s.rhs.sort((function(t,e){return-t.i- -e.i})),l=[],d=0,f=0,h=0;null===u||void 0===u||u.sort(i(!!e,!!n)),h=o(l,c,h),null===u||void 0===u||u.forEach((function(t){var e;h+=null===(e=t.vs)||void 0===e?void 0:e.length,l.push(t.vs),d+=t.barycenter*t.weight,f+=t.weight,h=o(l,c,h)}));var p={vs:l.flat()};return f&&(p.barycenter=d/f,p.weight=f),p}},9460:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,n=function(t){var e,n={},r=0,o=function(e){var i,a=r;null===(i=t.children(e))||void 0===i||i.forEach(o),n[e]={low:a,lim:r++}};return null===(e=t.children())||void 0===e||e.forEach(o),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,o,i=e,a=t.node(i),s=a.edgeObj;if(s)for(var u=function(t,e,n,r){var o,i,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>u||c>e[o].lim));for(i=o,o=r;o&&o!==i;)s.push(o),o=t.parent(o);return{lca:i,path:a.concat(s.reverse())}}(t,n,s.v,s.w),c=u.path,l=u.lca,d=0,f=c[d],h=!0;i!==s.w;){if(a=t.node(i),h){for(;f!==l&&(null===(r=t.node(f))||void 0===r?void 0:r.maxRank)s)&&(0,e.addConflict)(r,n,l)})))}function i(t,e){var n=function(t){return JSON.stringify(t.slice(1))}(t);e.get(n)||(o.apply(void 0,t),e.set(n,!0))}return(null===n||void 0===n?void 0:n.length)&&n.reduce((function(e,n){var r,o=-1,a=0,s=new Map;return null===n||void 0===n||n.forEach((function(u,c){var l;if("border"===(null===(l=t.node(u))||void 0===l?void 0:l.dummy)){var d=t.predecessors(u)||[];d.length&&(r=t.node(d[0]).order,i([n,a,c,o,r],s),a=c,o=r)}i([n,a,n.length,r,e.length],s)})),n})),r};e.findOtherInnerSegmentNode=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))};e.addConflict=function(t,e,n){var r=e,o=n;if(r>o){var i=r;r=o,o=i}var a=t[r];a||(t[r]=a={}),a[o]=!0};e.hasConflict=function(t,e,n){var r=e;r>n&&(r=n);return!!t[r]};e.verticalAlignment=function(t,n,r,o){var i={},a={},s={};return null===n||void 0===n||n.forEach((function(t){null===t||void 0===t||t.forEach((function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),null===n||void 0===n||n.forEach((function(t){var n=-1;null===t||void 0===t||t.forEach((function(t){var u=o(t);if(u.length)for(var c=((u=u.sort((function(t,e){return s[t]-s[e]}))).length-1)/2,l=Math.floor(c),d=Math.ceil(c);l<=d;++l){var f=u[l];a[t]===t&&n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.feasibleTreeWithLayer=e.feasibleTree=void 0;var r=n(2121),o=n(7252),i=n(3235),a=function(t){var e,n,o=new i.Graph({directed:!1}),a=t.nodes()[0],u=t.nodeCount();for(o.setNode(a,{});s(o,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.exchangeEdges=e.enterEdge=e.leaveEdge=e.initLowLimValues=e.calcCutValue=e.initCutValues=void 0;var r=n(4945),o=n(2121),i=n(7252),a=n(5285),s=a.algorithm.preorder,u=a.algorithm.postorder;e.initCutValues=function(t,e){var n=u(t,t.nodes());null===(n=null===n||void 0===n?void 0:n.slice(0,(null===n||void 0===n?void 0:n.length)-1))||void 0===n||n.forEach((function(n){c(t,e,n)}))};var c=function(t,n,r){var o=t.node(r).parent;t.edgeFromArgs(r,o).cutvalue=(0,e.calcCutValue)(t,n,r)};e.calcCutValue=function(t,e,n){var r,o=t.node(n).parent,i=!0,a=e.edgeFromArgs(n,o),s=0;return a||(i=!1,a=e.edgeFromArgs(o,n)),s=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,u=a?r.w:r.v;if(u!==o){var c=a===i,l=e.edge(r).weight;if(s+=c?l:-l,f(t,n,u)){var d=t.edgeFromArgs(n,u).cutvalue;s+=c?-d:d}}})),s};e.initLowLimValues=function(t,e){void 0===e&&(e=t.nodes()[0]),l(t,{},1,e)};var l=function(t,e,n,r,o){var i,a=n,s=n,u=t.node(r);return e[r]=!0,null===(i=t.neighbors(r))||void 0===i||i.forEach((function(n){e[n]||(s=l(t,e,s,n,r))})),u.low=a,u.lim=s++,o?u.parent=o:delete u.parent,s};e.leaveEdge=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))};e.enterEdge=function(t,e,n){var r=n.v,a=n.w;e.hasEdge(r,a)||(r=n.w,a=n.v);var s=t.node(r),u=t.node(a),c=s,l=!1;s.lim>u.lim&&(c=u,l=!0);var d=e.edges().filter((function(e){return l===h(t,t.node(e.v),c)&&l!==h(t,t.node(e.w),c)}));return(0,i.minBy)(d,(function(t){return(0,o.slack)(e,t)}))};e.exchangeEdges=function(t,n,r,o){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(o.v,o.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,n),d(t,n)};var d=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=s(t,n);null===(r=null===r||void 0===r?void 0:r.slice(1))||void 0===r||r.forEach((function(n){var r=t.node(n).parent,o=e.edgeFromArgs(n,r),i=!1;o||(o=e.edgeFromArgs(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))},f=function(t,e,n){return t.hasEdge(e,n)},h=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};e.default=function(t){var n=(0,i.simplify)(t);(0,o.longestPath)(n);var a,s,u=(0,r.feasibleTree)(n);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,n);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,n,a),(0,e.exchangeEdges)(u,n,a,s)}},2121:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var n=function(t){var e,n={},r=function(e){var o,i,a=t.node(e);return a?n[e]?a.rank:(n[e]=!0,null===(o=t.outEdges(e))||void 0===o||o.forEach((function(e){var n=r(e.w)-t.edge(e).minlen;n&&(void 0===i||n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.minBy=e.notime=e.time=e.partition=e.maxRank=e.addBorderNode=e.removeEmptyRanks=e.normalizeRanks=e.buildLayerMatrix=e.intersectRect=e.predecessorWeights=e.successorWeights=e.zipObject=e.asNonCompoundGraph=e.simplify=e.addDummyNode=void 0;var r=n(5027),o=n(3235);e.addDummyNode=function(t,e,n,r){var o;do{o="".concat(r).concat(Math.random())}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o};e.simplify=function(t){var e=(new o.Graph).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e};e.asNonCompoundGraph=function(t){var e=new o.Graph({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){e.setEdgeObj(n,t.edge(n))})),e};e.zipObject=function(t,e){return null===t||void 0===t?void 0:t.reduce((function(t,n,r){return t[n]=e[r],t}),{})};e.successorWeights=function(t){var e={};return t.nodes().forEach((function(n){var r,o={};null===(r=t.outEdges(n))||void 0===r||r.forEach((function(e){var n;o[e.w]=(o[e.w]||0)+((null===(n=t.edge(e))||void 0===n?void 0:n.weight)||0)})),e[n]=o})),e};e.predecessorWeights=function(t){var n=t.nodes(),r=n.map((function(e){var n,r={};return null===(n=t.inEdges(e))||void 0===n||n.forEach((function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight})),r}));return(0,e.zipObject)(n,r)};e.intersectRect=function(t,e){var n,r,o=Number(t.x),i=Number(t.y),a=Number(e.x)-o,s=Number(e.y)-i,u=Number(t.width)/2,c=Number(t.height)/2;return a||s?(Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var n=[],r=(0,e.maxRank)(t)+1,o=0;oe)&&(e=o)})),e||(e=0),e};e.partition=function(t,e){var n={lhs:[],rhs:[]};return null===t||void 0===t||t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n};e.time=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))}},6833:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;nt.x&&(o=t.x),i>t.y&&(i=t.y)})),e.forEach((function(t){t.points.forEach((function(t){o>t.x&&(o=t.x),i>t.y&&(i=t.y)}))})),r[0]=n[0]-o,r[1]=n[1]-i}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,o=n.nodes,i=n.edges,a=n.anchorPoint,u=n.graphSettings,c=this.getBegin(t,e);t.forEach((function(t){var n,l=t.x,d=t.y,f=t.id,h=t.type,p=t.coreBox;if(h===s.HierarchyNodeType.META&&f!==s.ROOT_NAME){var g=r.findIndex((function(t){return t.id===f})),v=null===(n=null===u||void 0===u?void 0:u.subScene)||void 0===n?void 0:n.meta;r[g].offsetX=l+c[0],r[g].offsetY=d+c[1],r[g].fixSize=[p.width,p.height],r[g].fixCollapseSize=[p.width,p.height],t.expanded?r[g].padding=[null===v||void 0===v?void 0:v.paddingTop,null===v||void 0===v?void 0:v.paddingRight,null===v||void 0===v?void 0:v.paddingBottom,null===v||void 0===v?void 0:v.paddingLeft]:r[g].padding=[0,0,0,0]}else if(h===s.HierarchyNodeType.OP){g=o.findIndex((function(t){return t.id===f}));if(o[g].x=l+c[0],o[g].y=d+c[1],a){var m=[],y=e.filter((function(t){return t.v===f})),b=e.filter((function(t){return t.w===f}));y.length>0&&y.forEach((function(e){var n=e.points[0],r=(n.x-l)/t.width+.5,o=(n.y-d)/t.height+.5;m.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=m.length-1)}))})),b.length>0&&b.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-l)/t.width+.5,o=(n.y-d)/t.height+.5;m.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=m.length-1)}))})),o[g].anchorPoints=m.length>0?m:o[g].anchorPoints||[]}}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,a=n.edges,u=n.controlPoints,c=this.getBegin(t,e);u&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),a.forEach((function(e){var a,u,l,d,f=t.find((function(t){return t.id===e.source})),h=t.find((function(t){return t.id===e.target})),p=[],g=[];if(f&&h)g=(0,s.getEdges)(null===f||void 0===f?void 0:f.id,null===h||void 0===h?void 0:h.id,t);else if(!f||!h){var v=n.getNodePath(e.source),m=n.getNodePath(e.target),y=v.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),b=m.reverse().slice(h?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));f=t.find((function(t){return t.id===y})),h=t.find((function(t){return t.id===b})),g=(0,s.getEdges)(null===f||void 0===f?void 0:f.id,null===h||void 0===h?void 0:h.id,t,{v:e.source,w:e.target})}if(p=(p=g.reduce((function(t,e){return i(i([],t,!0),e.points.map((function(t){return o(o({},t),{x:t.x+c[0],y:t.y+c[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=p,(null===h||void 0===h?void 0:h.type)===s.NodeType.META){var x=r.findIndex((function(t){return t.id===(null===h||void 0===h?void 0:h.id)}));if(!r[x]||(null===(a=r[x].inEdges)||void 0===a?void 0:a.some((function(t){return t.source===f.id&&t.target===h.id}))))return;null===(u=r[x].inEdges)||void 0===u||u.push({source:f.id,target:h.id,controlPoints:p})}if((null===f||void 0===f?void 0:f.type)===s.NodeType.META){x=r.findIndex((function(t){return t.id===(null===f||void 0===f?void 0:f.id)}));if(!r[x]||(null===(l=r[x].outEdges)||void 0===l?void 0:l.some((function(t){return t.source===f.id&&t.target===h.id}))))return;null===(d=r[x].outEdges)||void 0===d||d.push({source:f.id,target:h.id,controlPoints:p})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(a.Base);e.DagreCompoundLayout=c},4194:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1){var e=r({},t);delete e.size,s.push(e)}}));var f=[];o.forEach((function(t){var e=s.find((function(e){return e.id===t.source})),n=s.find((function(e){return e.id===t.target}));e&&n&&f.push(t)}));var h=new d.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:f}).nodes;n.forEach((function(t){var e=(h||[]).find((function(e){return e.id===t.id}));t.x=(null===e||void 0===e?void 0:e.x)||i/2,t.y=(null===e||void 0===e?void 0:e.y)||a/2}));var p=JSON.parse(JSON.stringify(n)),g=JSON.parse(JSON.stringify(o)),v=u.forceSimulation().nodes(p).force("link",u.forceLink(g).id((function(t){return t.id})).distance((function(t){return f.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",u.forceManyBody()).force("center",u.forceCenter(i/2,a/2)).force("x",u.forceX(i/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise((function(t){v.on("end",(function(){n.forEach((function(t){var e=p.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var r=Math.min.apply(Math,n.map((function(t){return t.x}))),s=Math.max.apply(Math,n.map((function(t){return t.x}))),u=Math.min.apply(Math,n.map((function(t){return t.y}))),d=Math.max.apply(Math,n.map((function(t){return t.y}))),f=i/(s-r),h=a/(d-u);n.forEach((function(t){void 0!==t.x&&f<1&&(t.x=(t.x-r)*f),void 0!==t.y&&h<1&&(t.y=(t.y-u)*h)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),(0,l.default)(n,o),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),(0,c.default)({nodes:n,edges:o},e),t()}))}))}},6946:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(2329));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,i=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;a=Math.min(e,a),s=Math.min(n,s)}));var u=new o.default;u.init(n,r,{CELL_H:s,CELL_W:a}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var c=0;ca){for(var p=v=Math.ceil((l.size[0]+i)/a)-1,g=0;g-1)||u.cells[f+g+1][h].node)break;p--}u.insertColumn(f,p)}if(l.size[1]+i>s){var v;for(p=v=Math.ceil((l.size[1]+i)/s)-1,g=0;g-1)||u.cells[f][h+g+1].node)break;p--}u.insertRow(h,p)}}for(c=0;ct;r--)for(o=0;o=t&&(this.additionColumn[o]+=e);for(r=0;rt;r--)this.cells[o][r+e]=n(n({},this.cells[o][r]),{dx:o,dy:r+e,x:o*this.CELL_W,y:(r+e)*this.CELL_H}),this.cells[o][r]={dx:o,dy:r,x:o*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(r=0;r=t&&(this.additionRow[r]+=e);for(o=0;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=1200,r=800,o=1e7,i=10,a=3.141592653589793,s=1.5707963267948966,u=.375*a,c=.625*a,l=new Map,d=10,f=10,h=.8,p=.1,g=.5;function v(t,e){var n=(l.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],a=e.size[0]*e.size[1],d=r>a?e:t,f=r>a?t:e,h=d.x-d.size[0]/2,p=d.y-d.size[1]/2,g=d.x+d.size[0]/2,v=d.y+d.size[1]/2,m=f.x-f.size[0]/2,y=f.y-f.size[1]/2,b=f.x+f.size[0]/2,x=f.y+f.size[1]/2,w=d.x,E=d.y,S=f.x,M=f.y,k=0,_=0;if(g>=m&&b>=h&&v>=y&&x>=p){0===(_=Math.sqrt(Math.pow(S-w,2)+Math.pow(M-E,2)))&&(_=1e-7),k=1*i/_*100+((gm?h:m))*((vy?p:y)),k*=o}else{var A=!1,C=function(t,e,n){var r=t.x-t.size[0]/2,o=t.y-t.size[1]/2,i=t.x+t.size[0]/2,a=t.y+t.size[1]/2,l=e.x-e.size[0]/2,d=e.y-e.size[1]/2,f=e.x+e.size[0]/2,h=e.y+e.size[1]/2,p=t.x,g=t.y,v=e.x,m=e.y,y=v-p,b=Math.atan2(y,m-g),x=0,w=0,E=0,S=0;b>s?(w=o-h,x=l-i,E=parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)),S=parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2))):E=S=0(x=l-i)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):b<-s?(w=o-h)>(x=-(f-r))?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):(w=d-a)>(x=Math.abs(y)>(i-r)/2?r-f:y)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x&&0!==b?(x/Math.sin(b)).toFixed(2):w.toFixed(2));var M=parseFloat(b.toFixed(2)),k=n;return n&&(k=un||i.y>r)&&(e+=1e12);for(var a=o+1;a70&&l<110,h=d>70&&d<110;if((l<30||l>150)&&!(d<30||d>150)||l*d<0){s=!1;break}if(f&&!h||l*d<0){s=!1;break}if((c.x-t.x)*(c.x-e.x)<0){s=!1;break}if((c.y-t.y)*(c.y-e.y)<0){s=!1;break}}return s}function b(t,e){for(var n=!1,r=1*d,o=1*f,i=[r,-r,0,0],a=[0,0,o,-o],s=0;sp?(c=v,n=!0):(u.x-=i[l],u.y-=a[l])}}return h>p&&(h*=g),n?m(t):0}function x(t,e){var o=0;(t.x<0||t.y<0||t.x+t.size[0]+20>n||t.y+t.size[1]+20>r)&&(o+=1e12);for(var i=0;i0&&!(++a>=50);){var s=b(t,e);0!==s&&(i=s),o=i-n,n=i,0===o?--r:r=20}return t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2})),{nodes:t,edges:e}}},5806:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(2605)),s=n(5027);e.default=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),o=t(-1),i=t(100),u=t(.1),c=[0,0],l=[],d={},f=[],h=100,p=100,g={none:{x:0,y:0}},v=[],m="force",y=!0,b=.1;function x(t){if(!y)return x;e.tick(),E();for(var r=0,o=l.length,i=void 0,a=t*b;r-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var o=e.forceSimulation,i=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(o){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),o.nodes(n),r&&e.edgeForce)e.edgeForce.links(r);else if(r&&!e.edgeForce){h=u.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,o.force("link",h)}e.preventOverlap&&e.overlapProcess(o),o.alpha(s).restart(),this.ticking=!0}else try{var l=u.forceManyBody();if(e.nodeStrength&&l.strength(e.nodeStrength),o=u.forceSimulation().nodes(n),e.clustering){var d=(0,c.default)();d.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&d.links(r),n&&d.nodes(n),d.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=d,o.force("group",d)}if(o.force("center",u.forceCenter(e.center[0],e.center[1])).force("charge",l).alpha(s).alphaDecay(a).alphaMin(i),e.preventOverlap&&e.overlapProcess(o),r){var h=u.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,o.force("link",h)}if(e.workerEnabled&&!p()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){o.stop();for(var g=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),o=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay()),i=Math.ceil(o);return i}(o),v=1;v<=g;v++)o.tick(),postMessage({nodes:n,currentTick:v,totalTicks:g,type:f.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else o.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=o,e.ticking=!0}catch(m){e.ticking=!1,console.warn(m)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,o=r.nodeSize,i=r.nodeSpacing,a=r.collideStrength;if(n=(0,l.isNumber)(i)?function(){return i}:(0,l.isFunction)(i)?i:function(){return 0},o)if((0,l.isFunction)(o))e=function(t){return o(t)+n(t)};else if((0,l.isArray)(o)){var s=(o[0]>o[1]?o[0]:o[1])/2;e=function(t){return s+n(t)}}else if((0,l.isNumber)(o)){var c=o/2;e=function(t){return c+n(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,l.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):(0,l.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",u.forceCollide(e).strength(a))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(d.Base);function p(){return"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=h},497:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(8850),e)},4998:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var r=n(6059);function o(t){var e=0,n=0,r=0;if(t.length){for(var o=0;o<4;o++){(i=t[o])&&i.weight&&(e+=i.weight,n+=i.x*i.weight,r+=i.y*i.weight)}t.x=n/e,t.y=r/e,t.weight=e}else{var i=t;t.x=i.data.x,t.y=i.data.y,t.weight=i.data.weight}}e.forceNBody=function(t,e,n,a,s){var u=n/a,c=t.map((function(t,n){var r=e[t.id],o=r.data,i=r.x,a=r.y,s=r.size,c=o.layout.force.nodeStrength;return{x:i,y:a,size:s,index:n,vx:0,vy:0,weight:u*c}})),l=(0,r.quadtree)(c,(function(t){return t.x}),(function(t){return t.y})).visitAfter(o);return c.forEach((function(t){!function(t,e){e.visit((function(e,n,r,o,a){return i(e,n,r,o,a,t)}))}(t,l)})),c.map((function(n,r){var o=e[t[r].id].data.layout.force.mass,i=void 0===o?1:o;s[2*r]=n.vx/i,s[2*r+1]=n.vy/i})),s};var i=function(t,e,n,r,o,i){var a=i.x-t.x||.1,s=i.y-t.y||.1,u=r-e,c=a*a+s*s,l=Math.sqrt(c)*c;if(u*u*.811&&(i=(0,a.getAvgNodePosition)(c))}else i=void 0;return{x:null===i||void 0===i?void 0:i.x,y:null===i||void 0===i?void 0:i.y}}}}if(r){t||(t=this.getSameTypeLeafMap());var h=Array.from(new Set(s.map((function(t,e){return t[i]})))).filter((function(t){return void 0!==t})),p={};h.forEach((function(t){var e=s.filter((function(e){return e[i]===t})).map((function(t){return u[t.id]}));p[t]=(0,a.getAvgNodePosition)(e)})),d={single:function(t){return l(t)},leaf:function(t){return l(t)},others:function(t){return l(t)},center:function(t,e,n){var r=p[t[i]];return{x:null===r||void 0===r?void 0:r.x,y:null===r||void 0===r?void 0:r.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),d);var g=this.centripetalOptions,v=g.leaf,m=g.single,y=g.others;v&&"function"!==typeof v&&(this.centripetalOptions.leaf=function(){return v}),m&&"function"!==typeof m&&(this.centripetalOptions.single=function(){return m}),y&&"function"!==typeof y&&(this.centripetalOptions.others=function(){return y})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,n=t.edges,r=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"===typeof window||(t.width=window.innerWidth),t.height||"undefined"===typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,a.getDegreeMap)(e,n),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var n=1;(0,a.isNumber)(e.mass)&&(n=e.mass);var r=t.degreesMap[e.id].all;return!r||r<5?n:5*r*n};var s,c=t.nodeSize;if(t.preventOverlap){var l,d=t.nodeSpacing;l=(0,a.isNumber)(d)?function(){return d}:(0,a.isFunction)(d)?d:function(){return 0},s=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+l(t)}:function(t){return c+l(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+l(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+l(t):t.size+l(t):10+l(t)}}t.nodeSize=s,t.linkDistance=u(t.linkDistance,1),t.nodeStrength=u(t.nodeStrength,1),t.edgeStrength=u(t.edgeStrength,1);var f={},h={};e.forEach((function(e,r){(0,a.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,a.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];f[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,n)}}})}),h[e.id]=r})),t.nodeMap=f,t.nodeIdxMap=h,t.edgeInfos=[],null===n||void 0===n||n.forEach((function(e){var n=f[e.source],i=f[e.target];n&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:r?r(o(o({},e),{source:n,target:i}),n,i):t.linkDistance(e,n,i)||1+(c(n)+c(n)||0)/2}):elf.edgeInfos.push({})})),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,n=t.nodes,r=t.edges,o=t.workerEnabled,i=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,n){var c=[];if(n.forEach((function(t,e){c[2*e]=0,c[2*e+1]=0})),this.defSideCoe&&"function"===typeof this.defSideCoe){var l={};r.forEach((function(t){var e=t.source,n=t.target;l[e]=l[e]||[],l[e].push(t),l[n]=l[n]||[],l[n].push(t)})),this.relatedEdges=l}var d=e;if(o||!a){for(var f=0;(t.judgingDistance>i||f<1)&&f=d||t.judgingDistancea){var l=a/c;s*=l,u*=l}e[2*o]=s,e[2*o+1]=u}))},e.prototype.updatePosition=function(t,e){var n=this,r=n.nodes,o=n.distanceThresholdMode,i=n.nodeMap;if(null===r||void 0===r?void 0:r.length){var s=0;"max"===o?n.judgingDistance=-1/0:"min"===o&&(n.judgingDistance=1/0);var u=1/0,c=-1/0;r.forEach((function(r,l){var d=i[r.id];if((0,a.isNumber)(r.fx)&&(0,a.isNumber)(r.fy))return r.x=r.fx,r.y=r.fy,d.x=r.x,void(d.y=r.y);var f=t[2*l]*e,h=t[2*l+1]*e;r.x+=f,r.y+=h,d.x=r.x,d.y=r.y,r.yc&&(c=r.y);var p=Math.sqrt(f*f+h*h);switch(o){case"max":n.judgingDistancep&&(n.judgingDistance=p);break;default:s+=p}})),this.currentMinY=u,this.currentMaxY=c,o&&"mean"!==o||(n.judgingDistance=s/r.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!==typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,n=t.nodes,r=t.edges,o=t.nodeMap,i=t.degreesMap;if(null===n||void 0===n?void 0:n.length){var s={};return n.forEach((function(t,n){1===i[t.id].all&&(s[t.id]=(0,a.getCoreNodeAndRelativeLeafNodes)("leaf",t,r,e,i,o))})),s}},e}(i.Base);e.Force2Layout=c},3744:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var o=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=o*e/r,this.fy+=o*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();e.default=n},3218:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var i=n(5716),a=n(5027),s=o(n(3744)),u=o(n(2395)),c=o(n(787)),l=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,o=t.maxIteration;t.width||"undefined"===typeof window||(t.width=window.innerWidth),t.height||"undefined"===typeof window||(t.height=window.innerHeight);for(var i=[],s=e.length,u=0;u250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(o=100,s<=200&&s>100?o=500:s>200&&(o=950),this.maxIteration=o):(o=250,s<=200&&s>100?o=1e3:s>200&&(o=1200),this.maxIteration=o),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(i),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,o=e.nodes,i=n.filter((function(t){return(0,a.getEdgeTerminal)(t,"source")!==(0,a.getEdgeTerminal)(t,"target")})),s=o.length,u=i.length,c=[],l={},d={},f=[],h=0;h0;){for(y=0;y50||!l)?this.getOptRepGraForces(g,m,o):this.getRepGraForces(p,50,g,100,i,o);var x=this.updatePos(g,v,h,o);u=x.nodes,h=x.sg,p--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,o,i,a,s){for(var u=this,c=u.nodes,l=u.preventOverlap,d=u.dissuadeHubs,f=u.mode,h=u.prune,p=0;p0&&(w=x,E=x),s[2*r[g.id]]+=w*b[0],s[2*r[m.id]]-=E*b[0],s[2*r[g.id]+1]+=w*b[1],s[2*r[m.id]+1]-=E*b[1]}}return s},e.prototype.getRepGraForces=function(t,e,n,r,o,i){for(var a=this,s=a.nodes,u=a.preventOverlap,c=a.kr,l=a.kg,d=a.center,f=a.prune,h=s.length,p=0;p0&&(y=c*(i[p]+1)*(i[g]+1)/m),n[2*p]-=y*v[0],n[2*g]+=y*v[0],n[2*p+1]-=y*v[1],n[2*g+1]+=y*v[1]}var b=[s[p].x-d[0],s[p].y-d[1]],x=Math.hypot(b[0],b[1]);b[0]=b[0]/x,b[1]=b[1]/x;var w=l*(i[p]+1);n[2*p]-=w*b[0],n[2*p+1]-=w*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,o=r.nodes,i=r.kg,a=r.center,s=r.prune,l=o.length,d=9e10,f=-9e10,h=9e10,p=-9e10,g=0;g=f&&(f=o[g].x),o[g].x<=d&&(d=o[g].x),o[g].y>=p&&(p=o[g].y),o[g].y<=h&&(h=o[g].y));var v={xmid:(f+d)/2,ymid:(p+h)/2,length:Math.max(f-d,p-h),massCenter:a,mass:l},m=new u.default(v),y=new c.default(m);for(g=0;g1.5*w?1.5*w:n);for(v=0;vM?M:E)*t[2*v],_=E*t[2*v+1];i[v].x+=k,i[v].y+=_}return{nodes:i,sg:n}},e}(i.Base);e.ForceAtlas2Layout=l},2395:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=n},787:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)=o&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var o=n.edges,a=n.center,s=n.gravity,u=n.speed,c=n.clustering,l=n.height*n.width,d=Math.sqrt(l)/10,f=l/(r.length+1),h=Math.sqrt(f),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,o,p,h,f),c){for(var g in t)t[g].cx=0,t[g].cy=0,t[g].count=0;for(var g in r.forEach((function(e){var n=t[e.cluster];(0,i.isNumber)(e.x)&&(n.cx+=e.x),(0,i.isNumber)(e.y)&&(n.cy+=e.y),n.count++})),t)t[g].cx/=t[g].count,t[g].cy/=t[g].count;var v=n.clusterGravity||s;r.forEach((function(e,n){if((0,i.isNumber)(e.x)&&(0,i.isNumber)(e.y)){var r=t[e.cluster],o=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),a=h*v;p[n].x-=a*(e.x-r.cx)/o,p[n].y-=a*(e.y-r.cy)/o}}))}r.forEach((function(t,e){if((0,i.isNumber)(t.x)&&(0,i.isNumber)(t.y)){var n=.01*h*s;p[e].x-=n*(t.x-a[0]),p[e].y-=n*(t.y-a[1])}})),r.forEach((function(t,e){if((0,i.isNumber)(t.fx)&&(0,i.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,i.isNumber)(t.x)&&(0,i.isNumber)(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(d*(u/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,o){this.calRepulsive(t,n,o),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,o){e[o]={x:0,y:0},t.forEach((function(t,a){if(o!==a&&(0,i.isNumber)(r.x)&&(0,i.isNumber)(t.x)&&(0,i.isNumber)(r.y)&&(0,i.isNumber)(t.y)){var s=r.x-t.x,u=r.y-t.y,c=s*s+u*u;if(0===c){c=1;var l=o>a?1:-1;s=.01*l,u=.01*l}var d=n/c;e[o].x+=s*d,e[o].y+=u*d}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var o=(0,i.getEdgeTerminal)(t,"source"),a=(0,i.getEdgeTerminal)(t,"target");if(o&&a){var s=r.nodeIdxMap[o],u=r.nodeIdxMap[a];if(s!==u){var c=r.nodeMap[o],l=r.nodeMap[a];if((0,i.isNumber)(l.x)&&(0,i.isNumber)(c.x)&&(0,i.isNumber)(l.y)&&(0,i.isNumber)(c.y)){var d=l.x-c.x,f=l.y-c.y,h=Math.sqrt(d*d+f*f),p=h*h/n;e[u].x-=d/h*p,e[u].y-=f/h*p,e[s].x+=d/h*p,e[s].y+=f/h*p}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!==typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=a},8765:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=n(5716),i=n(5027),a=function(t,e){return t?(0,i.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},s=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!==typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"===typeof window||(n.width=window.innerWidth),n.height||"undefined"===typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var o=n.center;if(1===r.length)return r[0].x=o[0],r[0].y=o[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var s={},u={};r.forEach((function(t,e){(0,i.isNumber)(t.x)||(t.x=Math.random()*n.width),(0,i.isNumber)(t.y)||(t.y=Math.random()*n.height),s[t.id]=t,u[t.id]=e})),n.nodeMap=s,n.nodeIdxMap=u,n.linkDistance=a(n.linkDistance,1),n.nodeStrength=a(n.nodeStrength,1),n.edgeStrength=a(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var d,f=n.nodeSpacing;d=(0,i.isNumber)(f)?function(){return f}:(0,i.isFunction)(f)?f:function(){return 0},c=l?(0,i.isArray)(l)?function(t){return Math.max(l[0],l[1])+d(t)}:function(t){return l+d(t)}:function(t){return t.size?(0,i.isArray)(t.size)?Math.max(t.size[0],t.size[1])+d(t):(0,i.isObject)(t.size)?Math.max(t.size.width,t.size.height)+d(t):t.size+d(t):10+d(t)}}n.nodeSize=c;var h=n.edges;n.degrees=(0,i.getDegree)(r.length,n.nodeIdxMap,h),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]].all||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,o=e.workerEnabled,i=e.minMovement,a=e.animate;if(r)if(o||!a){for(var s=0;s=n&&(null===(o=e.onLayoutEnd)||void 0===o||o.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var o=t.x-e[n].x,i=t.y-e[n].y;r+=Math.sqrt(o*o+i*i)})),(r/=t.length)=f)){var h=n.x-e.x,p=n.y-e.y;0===h&&0===p&&(h=.01*Math.random(),p=.01*Math.random());var g=h*h+p*p,v=Math.sqrt(g),m=(v+.1)*i,y=h/v,b=p/v,x=.5*(c(n)+c(e))*o/(m*m),w=r?r(e):1;if(t[2*s]+=y*x,t[2*s+1]+=b*x,t[2*f]-=y*x,t[2*f+1]-=b*x,a&&(l(n)+l(e))/2>v){var E=u*(c(n)+c(e))*.5/g;t[2*s]+=y*E/d,t[2*s+1]+=b*E/d,t[2*f]-=y*E/w,t[2*f+1]-=b*E/w}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,o=n.nodeIdxMap,a=n.linkDistance,s=n.edgeStrength,u=n.nodeSize,c=n.getMass;e.forEach((function(e,n){var l=(0,i.getEdgeTerminal)(e,"source"),d=(0,i.getEdgeTerminal)(e,"target"),f=r[l],h=r[d],p=h.x-f.x,g=h.y-f.y;0===p&&0===g&&(p=.01*Math.random(),g=.01*Math.random());var v=Math.sqrt(p*p+g*g),m=p/v,y=g/v,b=((a(e,f,h)||1+(u(f)+u(h)||0)/2)-v)*s(e),x=o[l],w=o[d],E=c?c(f):1,S=c?c(h):1;t[2*x]-=m*b/E,t[2*x+1]-=y*b/E,t[2*w]+=m*b/S,t[2*w+1]+=y*b/S}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,o=n.gravity,a=n.degrees,s=e.length,u=0;uo.maxSpeed){var c=o.maxSpeed/u;a*=c,s*=c}e[2*r]=a,e[2*r+1]=s}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if((0,i.isNumber)(n.fx)&&(0,i.isNumber)(n.fy))return n.x=n.fx,void(n.y=n.fy);var o=t[2*r]*e,a=t[2*r+1]*e;n.x+=o,n.y+=a}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!==typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=s},7649:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function s(t){try{u(r.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clusterBundle=e.clusterCode=e.fruchtermanBundle=e.fruchtermanCode=void 0,e.fruchtermanCode="\nimport { globalInvocationID } from 'g-webgpu';\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass Fruchterman {\n @in @out\n u_Data: vec4[];\n @in\n u_K: float;\n @in\n u_K2: float;\n \n @in\n u_Center: vec2;\n @in\n u_Gravity: float;\n @in\n u_ClusterGravity: float;\n @in\n u_Speed: float;\n @in\n u_MaxDisplace: float;\n @in\n u_Clustering: float;\n @in\n u_AttributeArray: vec4[];\n @in\n u_ClusterCenters: vec4[];\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = (xDist * xDist + yDist * yDist) + 0.01;\n let param = this.u_K2 / dist;\n \n if (dist > 0.0) {\n dx += param * xDist;\n dy += param * yDist;\n if (xDist == 0 && yDist == 0) {\n const sign = i < j ? 1 : -1;\n dx += param * sign;\n dy += param * sign;\n }\n }\n }\n }\n return [dx, dy];\n }\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \n let dx = 0, dy = 0;\n const vx = currentNode[0] - this.u_Center[0];\n const vy = currentNode[1] - this.u_Center[1];\n const gf = 0.01 * this.u_K * this.u_Gravity;\n dx = gf * vx;\n dy = gf * vy;\n if (this.u_Clustering == 1) {\n const clusterIdx = int(nodeAttributes[0]);\n const center = this.u_ClusterCenters[clusterIdx];\n const cvx = currentNode[0] - center[0];\n const cvy = currentNode[1] - center[1];\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\n const parma = this.u_K * this.u_ClusterGravity / dist;\n dx += parma * cvx;\n dy += parma * cvy;\n }\n return [dx, dy];\n }\n calcAttractive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n const arr_offset = int(floor(currentNode[2] + 0.5));\n const length = int(floor(currentNode[3] + 0.5));\n const node_buffer: vec4;\n for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {\n if (p >= length) break;\n const arr_idx = arr_offset + p;\n // when arr_idx % 4 == 0 update currentNodedx_buffer\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)];\n }\n const float_j = buf_offset == 0 ? node_buffer[0] :\n buf_offset == 1 ? node_buffer[1] :\n buf_offset == 2 ? node_buffer[2] :\n node_buffer[3];\n const nextNode = this.u_Data[int(float_j)];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;\n let attractiveF = dist / this.u_K;\n \n if (dist > 0.0) {\n dx -= xDist * attractiveF;\n dy -= yDist * attractiveF;\n if (xDist == 0 && yDist == 0) {\n const sign = i < int(float_j) ? 1 : -1;\n dx -= sign * attractiveF;\n dy -= sign * attractiveF;\n }\n }\n }\n return [dx, dy];\n }\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n let dx = 0, dy = 0;\n if (i >= VERTEX_COUNT) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // [gravity, fx, fy, 0]\n const nodeAttributes = this.u_AttributeArray[i];\n\n if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {\n // the node is fixed\n this.u_Data[i] = [\n nodeAttributes[1],\n nodeAttributes[2],\n currentNode[2],\n currentNode[3]\n ];\n return;\n }\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n dx += repulsive[0];\n dy += repulsive[1];\n // attractive\n const attractive = this.calcAttractive(i, currentNode);\n dx += attractive[0];\n dy += attractive[1];\n // gravity\n const gravity = this.calcGravity(currentNode, nodeAttributes);\n dx -= gravity[0];\n dy -= gravity[1];\n // speed\n dx *= this.u_Speed;\n dy *= this.u_Speed;\n\n // move\n const distLength = sqrt(dx * dx + dy * dy);\n if (distLength > 0.0) {\n const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);\n this.u_Data[i] = [\n currentNode[0] + dx / distLength * limitedDist,\n currentNode[1] + dy / distLength * limitedDist,\n currentNode[2],\n currentNode[3]\n ];\n }\n }\n}\n",e.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',e.clusterCode="\nimport { globalInvocationID } from 'g-webgpu';\nconst VERTEX_COUNT;\nconst CLUSTER_COUNT;\n@numthreads(1, 1, 1)\nclass CalcCenter {\n @in\n u_Data: vec4[];\n @in\n u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]\n @in @out\n u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]\n @main\n compute() {\n const i = globalInvocationID.x;\n const center = this.u_ClusterCenters[i];\n let sumx = 0;\n let sumy = 0;\n let count = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n const attributes = this.u_NodeAttributes[j];\n const clusterIdx = int(attributes[0]);\n const vertex = this.u_Data[j];\n if (clusterIdx == i) {\n sumx += vertex.x;\n sumy += vertex.y;\n count += 1;\n }\n }\n this.u_ClusterCenters[i] = [\n sumx / count,\n sumy / count,\n count,\n i\n ];\n }\n}\n",e.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},4518:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function s(t){try{u(r.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aveMovementBundle=e.aveMovementCode=e.gForceBundle=e.gForceCode=void 0,e.gForceCode="\nimport { globalInvocationID } from 'g-webgpu';\n\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\nconst SHIFT_20 = 1048576;\n\n@numthreads(1, 1, 1)\nclass GGForce {\n @in @out\n u_Data: vec4[];\n\n @in\n u_damping: float;\n \n @in\n u_maxSpeed: float;\n\n @in\n u_minMovement: float;\n\n @in\n u_AveMovement: vec4[];\n\n @in\n u_coulombDisScale: float;\n\n @in\n u_factor: float;\n\n @in\n u_NodeAttributeArray1: vec4[];\n\n @in\n u_NodeAttributeArray2: vec4[];\n\n @in\n u_interval: float;\n\n unpack_float(packedValue: float): ivec2 {\n const packedIntValue = int(packedValue);\n const v0 = packedIntValue / SHIFT_20;\n return [v0, packedIntValue - v0 * SHIFT_20];\n }\n\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let ax = 0, ay = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const vx = currentNode[0] - nextNode[0];\n const vy = currentNode[1] - nextNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const n_dist = (dist + 0.1) * this.u_coulombDisScale;\n const direx = vx / dist;\n const direy = vy / dist;\n const attributesi = this.u_NodeAttributeArray1[i];\n const attributesj = this.u_NodeAttributeArray1[j];\n const massi = attributesi[0];\n const nodeStrengthi = attributesi[2];\n const nodeStrengthj = attributesj[2];\n const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;\n // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);\n const param = nodeStrength * this.u_factor / (n_dist * n_dist);\n ax += direx * param;\n ay += direy * param;\n }\n }\n return [ax, ay];\n }\n\n calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {\n // note: attributes2 = [centerX, centerY, gravity, 0]\n\n const vx = currentNode[0] - attributes2[0];\n const vy = currentNode[1] - attributes2[1];\n \n const ax = vx * attributes2[2];\n const ay = vy * attributes2[2];\n \n return [ax, ay];\n }\n\n calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {\n // note: attributes1 = [mass, degree, nodeSterngth, 0]\n\n const mass = attributes1[0];\n let ax = 0, ay = 0;\n // const arr_offset = int(floor(currentNode[2] + 0.5));\n // const length = int(floor(currentNode[3] + 0.5));\n\n const compressed = this.unpack_float(currentNode[2]);\n const length = compressed[0];\n const arr_offset = compressed[1];\n\n const node_buffer: vec4;\n for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {\n if (p >= length) break;\n const arr_idx = arr_offset + 4 * p; // i \u8282\u70b9\u7684\u7b2c p \u6761\u8fb9\u5f00\u59cb\u7684\u5c0f\u683c\u5b50\u4f4d\u7f6e\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683c\u5b50\uff0c\u5927\u683c\u5b50\u4f4d\u7f6e=\u5c0f\u4e2a\u5b50\u4f4d\u7f6e / 4\uff0c\n }\n\n let float_j: float = node_buffer[0];\n\n const nextNode = this.u_Data[int(float_j)];\n const vx = nextNode[0] - currentNode[0];\n const vy = nextNode[1] - currentNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const direx = vx / dist;\n const direy = vy / dist;\n const edgeLength = node_buffer[1];\n const edgeStrength = node_buffer[2];\n const diff: float = edgeLength - dist;//edgeLength\n // const param = diff * this.u_stiffness / mass; //\n const param = diff * edgeStrength / mass; // \n ax -= direx * param;\n ay -= direy * param;\n }\n return [ax, ay];\n }\n\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n const movement = u_AveMovement[0];\n let ax = 0, ay = 0;\n\n if (i >= VERTEX_COUNT || movement.x < u_minMovement) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // \u6bcf\u4e2a\u8282\u70b9\u5c5e\u6027\u5360\u4e24\u4e2a\u6570\u7ec4\u4e2d\u5404\u4e00\u683c\n // [mass, degree, nodeStrength, fx]\n const nodeAttributes1 = this.u_NodeAttributeArray1[i];\n // [centerX, centerY, centerGravity, fy]\n const nodeAttributes2 = this.u_NodeAttributeArray2[i];\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n ax += repulsive[0];\n ay += repulsive[1];\n\n // attractive\n const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);\n ax += attractive[0];\n ay += attractive[1];\n\n // gravity\n const gravity = this.calcGravity(i, currentNode, nodeAttributes2);\n ax -= gravity[0];\n ay -= gravity[1];\n\n // speed\n const param = this.u_interval * this.u_damping;\n let vx = ax * param;\n let vy = ay * param;\n const vlength = sqrt(vx * vx + vy * vy) + 0.0001;\n if (vlength > this.u_maxSpeed) {\n const param2 = this.u_maxSpeed / vlength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n\n // move\n if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {\n this.u_Data[i] = [\n nodeAttributes1[3],\n nodeAttributes2[3],\n currentNode[2],\n 0\n ];\n } else {\n const distx = vx * this.u_interval;\n const disty = vy * this.u_interval;\n const distLength = sqrt(distx * distx + disty * disty);\n this.u_Data[i] = [\n currentNode[0] + distx,\n currentNode[1] + disty,\n currentNode[2],\n distLength\n ];\n }\n \n // the avarage move distance\n // need to share memory\n \n }\n}\n",e.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',e.aveMovementCode="\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass CalcAveMovement {\n @in\n u_Data: vec4[];\n @in\n u_iter: float;\n @in @out\n u_AveMovement: vec4[];\n @main\n compute() {\n let movement = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n const vertex = this.u_Data[j];\n movement += vertex[3];\n }\n movement = movement / float(VERTEX_COUNT);\n this.u_AveMovement[0] = [movement, 0, 0, 0];\n }\n}\n",e.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},989:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayout=void 0;var o=n(5027),i=function(t){function e(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=t.begin,i=e.length;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};if(1===i)return e[0].x=r[0],e[0].y=r[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};var a=t.sortBy,s=t.width,u=t.height,c=t.condense,l=t.preventOverlapPadding,d=t.preventOverlap,f=t.nodeSpacing,h=t.nodeSize,p=[];e.forEach((function(t){p.push(t)}));var g={};if(p.forEach((function(t,e){g[t.id]=e})),("degree"===a||!(0,o.isString)(a)||void 0===p[0][a])&&(a="degree",(0,o.isNaN)(e[0].degree))){var v=(0,o.getDegree)(p.length,g,n);p.forEach((function(t,e){t.degree=v[e].all}))}p.sort((function(t,e){return e[a]-t[a]})),s||"undefined"===typeof window||(s=window.innerWidth),u||"undefined"===typeof window||(u=window.innerHeight);var m=t.rows,y=null!=t.cols?t.cols:t.columns;if(t.cells=i,null!=m&&null!=y?(t.rows=m,t.cols=y):null!=m&&null==y?(t.rows=m,t.cols=Math.ceil(t.cells/t.rows)):null==m&&null!=y?(t.cols=y,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,c&&(t.cellWidth=0,t.cellHeight=0),d||f){var w=(0,o.getFuncByUnknownType)(10,f),E=(0,o.getFuncByUnknownType)(30,h,!1);p.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n,r,i=E(e)||30;(0,o.isArray)(i)?(n=i[0],r=i[1]):(n=i,r=i);var a=void 0!==w?w(e):l,s=n+a,u=r+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S=e&&(t.col=0,t.row++)},e.prototype.getPos=function(t){var e,n,r=this,o=r.begin,i=r.cellWidth,a=r.cellHeight,s=r.id2manPos[t.id];if(s)e=s.col*i+i/2+o[0],n=s.row*a+a/2+o[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*i+i/2+o[0],n=r.row*a+a/2+o[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},e.prototype.getType=function(){return"grid"},e}(n(5716).Base);e.GridLayout=i},1569:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var i=n(989);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return i.GridLayout}});var a=n(6254);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=n(8765);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=n(6593);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var c=n(497);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return c.ForceLayout}});var l=n(2852);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return l.CircularLayout}});var d=n(6452);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return d.DagreLayout}});var f=n(6833);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return f.DagreCompoundLayout}});var h=n(2689);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return h.RadialLayout}});var p=n(1881);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return p.ConcentricLayout}});var g=n(1887);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return g.MDSLayout}});var v=n(9136);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return v.FruchtermanLayout}});var m=n(7649);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return m.FruchtermanGPULayout}});var y=n(4518);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return y.GForceGPULayout}});var b=n(1420);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=n(1928);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=n(3218);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var E=n(1213);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return E.ERLayout}});var S=n(5571);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),o(n(9696),e)},5571:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var r=n(6036),o=n(989),i=n(6254),a=n(6593),s=n(8765),u=n(497),c=n(2852),l=n(6452),d=n(2689),f=n(1881),h=n(1887),p=n(9136),g=n(7649),v=n(4518),m=n(1420),y=n(1928),b=n(3218),x=n(1213),w=n(6833),E=n(5027),S=function(){function t(t){var e=(0,r.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null===t||void 0===t?void 0:t.length){var e=1/0,n=[];if(t.forEach((function(t){(0,E.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(n.push(t),t.layer{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8041),o=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,o=t.linkDistance;try{var i=r.Matrix.mul(r.Matrix.pow(n,2),-.5),a=i.mean("row"),s=i.mean("column"),u=i.mean();i.add(u).subRowVector(a).subColumnVector(s);var c=new r.SingularValueDecomposition(i),l=r.Matrix.sqrt(c.diagonalMatrix).diagonal();return c.leftSingularVectors.toJSON().map((function(t){return r.Matrix.mul([t],[l]).toJSON()[0].splice(0,e)}))}catch(g){for(var d=[],f=0;fr[0]?r[0]:v-r[0],b=m-r[1]>r[1]?r[1]:m-r[1];0===y&&(y=v/2),0===b&&(b=m/2);var x=b>y?y:b,w=Math.max.apply(Math,g),E=[];g.forEach((function(e,n){t.unitRadius||(t.unitRadius=x/w),E[n]=e*t.unitRadius})),t.radii=E;var S=t.eIdealDisMatrix();t.eIdealDistances=S;var M=function(t){for(var e=t.length,n=t[0].length,r=[],o=0;oC[1]?C[0]:C[1])+I(t)}:function(t){return C+I(t)}:function(t){return t.size?(0,i.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+I(t):(0,i.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+I(t):t.size+I(t):10+I(t)};var N={nodes:e,nodeSizeFunc:_,adjMatrix:f,positions:k,radii:E,height:m,width:v,strictRadial:O,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:k.length/4.5},P=new u.default(N);k=P.layout()}return k.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],o=t.eIdealDistances||[],i=t.radii||[],a=0;a<=e;a++){var s=a/e;t.oneIteration(s,n,i,o,r)}},e.prototype.oneIteration=function(t,e,n,r,o){var i=1-t,a=this.focusIndex;e.forEach((function(s,u){var l=c(s,[0,0]),d=0===l?0:1/l;if(u!==a){var f=0,h=0,p=0;e.forEach((function(t,e){if(u!==e){var n=c(s,t),i=0===n?0:1/n,a=r[e][u];p+=o[u][e],f+=o[u][e]*(t[0]+a*(s[0]-t[0])*i),h+=o[u][e]*(t[1]+a*(s[1]-t[1])*i)}}));var g=0===n[u]?0:1/n[u];p*=i,p+=t*g*g,f*=i,f+=t*g*s[0]*d,s[0]=f/p,h*=i,h+=t*g*s[1]*d,s[1]=h/p}}))},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,r=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,s=[];return n&&n.forEach((function(n,u){var c=[];n.forEach((function(n,s){if(u===s)c.push(0);else if(o[u]===o[s])if("data"===t.sortBy)c.push(n*(Math.abs(u-s)*t.sortStrength)/(o[u]/a));else if(t.sortBy){var l=e[u][t.sortBy]||0,d=e[s][t.sortBy]||0;(0,i.isString)(l)&&(l=l.charCodeAt(0)),(0,i.isString)(d)&&(d=d.charCodeAt(0)),c.push(n*(Math.abs(l-d)*t.sortStrength)/(o[u]/a))}else c.push(n*r/(o[u]/a));else{var f=(r+a)/2;c.push(n*f)}})),s.push(c)})),s},e.prototype.handleInfinity=function(t,e,n){for(var r=t.length,o=0;on?t[e][r]:n);return n},e.prototype.getType=function(){return"radial"},e}(a.Base);e.RadialLayout=l},1625:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,o=t.width/10;t.maxDisplace=o,t.disp=n;for(var i=0;iu?1:-1;c=.01*f,l=.01*f}if(dMath.PI/2&&(l-=Math.PI/2,s*=-1,u*=-1);var d=Math.cos(l)*c;t.x=s*d,t.y=u*d}));var s=t.radii;e.forEach((function(t,u){if(u!==i){var c=Math.sqrt(n[u].x*n[u].x+n[u].y*n[u].y);if(c>0&&u!==i){var l=Math.min(a*(r/800),c);if(t[0]+=n[u].x/c*l,t[1]+=n[u].y/c*l,o){var d=t[0]-e[i][0],f=t[1]-e[i][1],h=Math.sqrt(d*d+f*f);d=d/h*s[u],f=f/h*s[u],t[0]=e[i][0]+d,t[1]=e[i][1]+f}}}}))},t}();e.default=n},6254:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return r(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"===typeof window||(t.width=window.innerWidth),t.height||"undefined"===typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(n(5716).Base);e.RandomLayout=o},9696:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6036:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=n(5716),i=n(5027),a=new Map;e.registerLayout=function(t,e){if(a.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,i.isObject)(e)){var n=function(t){function n(n){var r,o,i=r=t.call(this)||this,a={},s=Object.assign({},i.getDefaultCfg(),(null===(o=e.getDefaultCfg)||void 0===o?void 0:o.call(e))||{});return Object.assign(a,s,e,n),Object.keys(a).forEach((function(t){var e=a[t];i[t]=e})),r}return r(n,t),n}(o.Base);a.set(t,n)}else a.set(t,e);return a.get(t)};e.unRegisterLayout=function(t){a.has(t)&&a.delete(t)};e.getLayoutByName=function(t){return a.has(t)?a.get(t):null}},1510:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},2375:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var r=n(5027),o=n(6442);e.isFunction=function(t){return"function"===typeof t};e.getFunc=function(t,e,n){return n||((0,o.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,n,i){return void 0===i&&(i=!0),n||0===n?(0,e.isFunction)(n)?n:(0,o.isNumber)(n)?function(){return n}:(0,r.isArray)(n)?function(){if(i){var e=Math.max.apply(Math,n);return isNaN(e)?t:e}return n}:(0,r.isObject)(n)?function(){if(i){var e=Math.max(n.width,n.height);return isNaN(e)?t:e}return[n.width,n.height]}:function(){return t}:function(e){return e.size?(0,r.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,r.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},7313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var r=n(5027),o=n(2137);e.proccessToFunc=function(t,e){return t?(0,r.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var n=[],r=[],i={},a=0;for(a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCoreNodeAndRelativeLeafNodes=e.getAvgNodePosition=e.getLayoutBBox=e.traverseTreeUp=e.scaleMatrix=e.getAdjMatrix=e.floydWarshall=e.getDegreeMap=e.getDegree=e.getEdgeTerminal=void 0;var r=n(1510),o=n(6442),i=n(7852);e.getEdgeTerminal=function(t,e){var n=t[e];return(0,i.isObject)(n)?n.cell:n};e.getDegree=function(t,n,r){for(var o=[],i=0;ie[r][i]+e[i][o]&&(e[r][o]=e[r][i]+e[i][o]);return e};e.getAdjMatrix=function(t,n){var r=t.nodes,o=t.edges,i=[],a={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach((function(t,e){a[t.id]=e;i.push([])})),null===o||void 0===o||o.forEach((function(t){var r=(0,e.getEdgeTerminal)(t,"source"),o=(0,e.getEdgeTerminal)(t,"target"),s=a[r],u=a[o];void 0!==s&&void 0!==u&&(i[s][u]=1,n||(i[u][s]=1))})),i};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};var a=function(t,e){if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!a(t.children[n],e))return;return!!e(t)};e.traverseTreeUp=function(t,e){"function"===typeof e&&a(t,e)};e.getLayoutBBox=function(t){var e=1/0,n=1/0,i=-1/0,a=-1/0;return t.forEach((function(t){var s=t.size;(0,r.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,o.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],c=t.x-u[0],l=t.x+u[0],d=t.y-u[1],f=t.y+u[1];e>c&&(e=c),n>d&&(n=d),i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNumber=e.isNaN=e.isNumber=void 0;e.isNumber=function(t){return"number"===typeof t};e.isNaN=function(t){return Number.isNaN(Number(t))};e.toNumber=function(t){var n=parseFloat(t);return(0,e.isNaN)(n)?t:n}},7852:function(t,e){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelize=e.isString=void 0;e.isString=function(t){return"string"===typeof t};var n=/-(\w)/g;e.camelize=function(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}((function(t){return t.replace(n,(function(t,e){return e?e.toUpperCase():""}))}))},3905:(t,e,n)=>{"use strict";function r(t){return[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16)]}function o(t){var e=Math.round(t).toString(16);return 1===e.length?"0".concat(e):e}function i(t){return"#".concat(o(t[0])).concat(o(t[1])).concat(o(t[2]))}n.r(e),n.d(e,{Cache:()=>Wn,angleTo:()=>S,arcToCubic:()=>H,assign:()=>hn,augment:()=>pn,clamp:()=>xe,clearAnimationFrame:()=>dn,clone:()=>vn,clonePath:()=>J,contains:()=>St,createDOM:()=>Jn,debounce:()=>mn,deepMix:()=>xn,difference:()=>kt,direction:()=>E,distanceSquareRoot:()=>et,each:()=>It,endsWith:()=>ue,equalizeSegments:()=>wt,every:()=>ce,extend:()=>wn,filter:()=>Mt,find:()=>Rt,findIndex:()=>Ft,firstValue:()=>Bt,fixedBase:()=>we,flatten:()=>zt,flattenDeep:()=>Ut,forIn:()=>Be,get:()=>Tn,getDrawDirection:()=>vt,getPathArea:()=>gt,getPathBBox:()=>dt,getPathBBoxTotalLength:()=>ht,getPointAtLength:()=>mt,getRange:()=>Vt,getRotatedCurve:()=>pt,getTotalLength:()=>ft,getType:()=>$e,getWrapBehavior:()=>ge,gradient:()=>d,group:()=>pe,groupBy:()=>fe,groupToMap:()=>he,has:()=>ze,hasKey:()=>Ge,hasValue:()=>We,head:()=>ie,identity:()=>Gn,includes:()=>St,indexOf:()=>En,isArguments:()=>Qe,isArray:()=>Ct,isArrayLike:()=>Et,isBoolean:()=>Je,isDate:()=>tn,isDecimal:()=>Se,isElement:()=>cn,isEmpty:()=>Mn,isEqual:()=>_n,isEqualWith:()=>An,isError:()=>en,isEven:()=>Me,isFinite:()=>nn,isFunction:()=>_t,isInteger:()=>ke,isMatch:()=>Nt,isNegative:()=>_e,isNil:()=>At,isNull:()=>rn,isNumber:()=>Ee,isNumberEqual:()=>Ce,isObject:()=>Ot,isObjectLike:()=>Pt,isOdd:()=>Oe,isPlainObject:()=>jt,isPointInPolygon:()=>Hn,isPointInStroke:()=>bt,isPolygonsIntersect:()=>Qn,isPositive:()=>Ie,isPrototype:()=>an,isRegExp:()=>sn,isString:()=>te,isType:()=>Dt,isUndefined:()=>un,keys:()=>Tt,last:()=>ae,lowerCase:()=>Ve,lowerFirst:()=>Xe,map:()=>Cn,mapValues:()=>In,max:()=>Wt,maxBy:()=>Te,memoize:()=>s,min:()=>Yt,minBy:()=>Ne,mix:()=>hn,mod:()=>Pe,modifyCSS:()=>tr,noop:()=>zn,normalizePath:()=>V,number2color:()=>ye,omit:()=>Dn,parseRadius:()=>be,path2Absolute:()=>W,path2Array:()=>Q,path2Curve:()=>$,path2String:()=>k,pick:()=>Ln,pull:()=>Zt,pullAt:()=>$t,reduce:()=>Qt,remove:()=>Jt,requestAnimationFrame:()=>ln,reverseCurve:()=>tt,rgb2arr:()=>r,set:()=>Nn,size:()=>Un,some:()=>le,sortBy:()=>ee,startsWith:()=>se,substitute:()=>He,throttle:()=>jn,toArray:()=>Rn,toCSSGradient:()=>g,toDegree:()=>De,toInteger:()=>je,toRGB:()=>c,toRadian:()=>Fe,toString:()=>Ye,transform:()=>x,union:()=>re,uniq:()=>ne,uniqueId:()=>Bn,upperCase:()=>qe,upperFirst:()=>Ze,values:()=>Ue,valuesOfKey:()=>oe,vertical:()=>M,wrapBehavior:()=>ve});var a=new Map;function s(t,e,n){void 0===n&&(n=128);return function(){for(var r=[],o=0;oo&&(r=n,a(1),++e),n[t]=i}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(i(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:i(t,e)}}}(n));var s=a.get(t);if(s.has(i))return s.get(i);var u=t.apply(this,r);return s.set(i,u),u}}var u=/rgba?\(([\s.,0-9]+)\)/;var c=s((function(t){if("#"===t[0]&&7===t.length)return t;var e=function(){var t=document.getElementById("antv-web-colour-picker");return t||((t=document.createElement("i")).id="antv-web-colour-picker",t.title="Web Colour Picker",t.style.display="none",document.body.appendChild(t),t)}();e.style.color=t;var n=document.defaultView.getComputedStyle(e,"").getPropertyValue("color");return n=i(u.exec(n)[1].split(/\s*,\s*/).map((function(t){return Number(t)})))}),(function(t){return t}),256);function l(t,e,n,r){return t[r]+(e[r]-t[r])*n}function d(t){var e=("string"===typeof t?t.split("-"):t).map((function(t){return r(-1===t.indexOf("#")?c(t):t)}));return function(t){return function(t,e){var n=isNaN(Number(e))||e<0?0:e>1?1:Number(e),r=t.length-1,o=Math.floor(r*n),a=r*n-o,s=t[o],u=o===r?s:t[o+1];return i([l(s,u,a,0),l(s,u,a,1),l(s,u,a,2)])}(e,t)}}var f=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,h=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,p=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function g(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,n=void 0;if("l"===t[0]){var r=+(o=f.exec(t))[1]+90;n=o[2],e="linear-gradient(".concat(r,"deg, ")}else if("r"===t[0]){var o;e="radial-gradient(",n=(o=h.exec(t))[4]}var i=n.match(p);return i.forEach((function(t,n){var r=t.split(":");e+="".concat(r[1]," ").concat(100*Number(r[0]),"%"),n!==i.length-1&&(e+=", ")})),e+=")"}return t}var v=n(5367);function m(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromTranslation(r,n),v.multiply(t,r,e)}function y(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromRotation(r,n),v.multiply(t,r,e)}function b(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromScaling(r,n),v.multiply(t,r,e)}function x(t,e){for(var n,r,o,i=t?[].concat(t):[1,0,0,0,1,0,0,0,1],a=0,s=e.length;a=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function M(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function k(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var n="number"===typeof e&&e>=1?Math.pow(10,e):1;return t.map((function(t){var r=t.slice(1).map(Number).map((function(t){return e?Math.round(t*n)/n:Math.round(t)}));return[t[0]].concat(r)}))}(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}var _=function(){return _=Object.assign||function(t){for(var e,n=1,r=arguments.length;n7){t[n].shift();for(var r=t[n],o=n;r.length;)e[n]="A",t.splice(o+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var I={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function T(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return I[e]===t.length-1&&"achlmqstvz".includes(e)}))}function N(t){return T(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function P(t){return N(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function L(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=I[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,I[n]))),I[n]););}function D(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function j(t){return t>=48&&t<=57||43===t||45===t||46===t}function R(t){return t>=48&&t<=57}function F(t){var e,n=t.max,r=t.pathValue,o=t.index,i=o,a=!1,s=!1,u=!1,c=!1;if(i>=n)t.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(i))&&45!==e||(i+=1,e=r.charCodeAt(i)),R(e)||46===e){if(46!==e){if(a=48===e,i+=1,e=r.charCodeAt(i),a&&i=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function z(t){var e=t.max,n=t.pathValue,r=t.index,o=n.charCodeAt(r),i=I[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(o))if(t.index+=1,B(t),t.data=[],i){for(;;){for(var a=i;a>0;a-=1){if(97!==(32|o)||3!==a&&4!==a?F(t):D(t),t.err.length)return;t.data.push(t.param),B(t),t.index=t.max)break;if(!j(n.charCodeAt(t.index)))break}L(t)}else L(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var G=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function U(t){if(T(t))return[].concat(t);var e=new G(t);for(B(e);e.index1&&(m*=_=Math.sqrt(_),y*=_);var A=m*m,C=y*y,O=(i===a?-1:1)*Math.sqrt(Math.abs((A*C-A*k*k-C*M*M)/(A*k*k+C*M*M)));h=O*m*k/y+(g+b)/2,p=O*-y*M/m+(v+x)/2,d=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),d=gf&&(d-=2*Math.PI),!a&&f>d&&(f-=2*Math.PI)}var I=f-d;if(Math.abs(I)>w){var T=f,N=b,P=x;f=d+w*(a&&f>d?1:-1),S=H(b=h+m*Math.cos(f),x=p+y*Math.sin(f),m,y,o,0,a,N,P,[f,T,h,p])}I=f-d;var L=Math.cos(d),D=Math.sin(d),j=Math.cos(f),R=Math.sin(f),F=Math.tan(I/4),B=4/3*m*F,z=4/3*y*F,G=[g,v],U=[g+B*D,v-z*L],W=[b+B*R,x-z*j],Y=[b,x];if(U[0]=2*G[0]-U[0],U[1]=2*G[1]-U[1],c)return U.concat(W,Y,S);for(var V=[],q=0,Z=(S=U.concat(W,Y,S)).length;q=i)a={x:n,y:r};else{var s=q([t,e],[n,r],o/i);a={x:s[0],y:s[1]}}return{length:i,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function rt(t,e){var n=t.x,r=t.y,o=e.x,i=e.y,a=n*o+r*i,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(o,2)+Math.pow(i,2)));return(n*i-r*o<0?-1:1)*Math.acos(a/s)}function ot(t,e,n,r,o,i,a,s,u,c){var l=Math.abs,d=Math.sin,f=Math.cos,h=Math.sqrt,p=Math.PI,g=l(n),v=l(r),m=(o%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===g||0===v)return nt(t,e,s,u,c).point;var y=(t-s)/2,b=(e-u)/2,x={x:f(m)*y+d(m)*b,y:-d(m)*y+f(m)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(g*=h(w),v*=h(w));var E=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),S=(i!==a?1:-1)*h(E=E<0?0:E),M=S*(g*x.y/v),k=S*(-v*x.x/g),_=f(m)*M-d(m)*k+(t+s)/2,A=d(m)*M+f(m)*k+(e+u)/2,C={x:(x.x-M)/g,y:(x.y-k)/v},O=rt({x:1,y:0},C),I=rt(C,{x:(-x.x-M)/g,y:(-x.y-k)/v});!a&&I>0?I-=2*p:a&&I<0&&(I+=2*p);var T=O+(I%=2*p)*c,N=g*f(T),P=v*d(T);return{x:f(m)*N-d(m)*P+_,y:d(m)*N+f(m)*P+A}}function it(t,e,n,r,o,i,a,s,u,c,l){var d,f=l.bbox,h=void 0===f||f,p=l.length,g=void 0===p||p,v=l.sampleSize,m=void 0===v?30:v,y="number"===typeof c,b=t,x=e,w=0,E=[b,x,w],S=[b,x],M={x:0,y:0},k=[{x:b,y:x}];y&&c<=0&&(M={x:b,y:x});for(var _=0;_<=m;_+=1){if(b=(d=ot(t,e,n,r,o,i,a,s,u,_/m)).x,x=d.y,h&&k.push({x:b,y:x}),g&&(w+=et(S,[b,x])),S=[b,x],y&&w>=c&&c>E[2]){var A=(w-c)/(w-E[2]);M={x:S[0]*(1-A)+E[0]*A,y:S[1]*(1-A)+E[1]*A}}E=[b,x,w]}return y&&c>=w&&(M={x:s,y:u}),{length:w,point:M,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function at(t,e,n,r,o,i,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*o+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*i+Math.pow(u,3)*s}}function st(t,e,n,r,o,i,a,s,u,c){var l,d=c.bbox,f=void 0===d||d,h=c.length,p=void 0===h||h,g=c.sampleSize,v=void 0===g?10:g,m="number"===typeof u,y=t,b=e,x=0,w=[y,b,x],E=[y,b],S={x:0,y:0},M=[{x:y,y:b}];m&&u<=0&&(S={x:y,y:b});for(var k=0;k<=v;k+=1){if(y=(l=at(t,e,n,r,o,i,a,s,k/v)).x,b=l.y,f&&M.push({x:y,y:b}),p&&(x+=et(E,[y,b])),E=[y,b],m&&x>=u&&u>w[2]){var _=(x-u)/(x-w[2]);S={x:E[0]*(1-_)+w[0]*_,y:E[1]*(1-_)+w[1]*_}}w=[y,b,x]}return m&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function ut(t,e,n,r,o,i,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*o,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*i}}function ct(t,e,n,r,o,i,a,s){var u,c=s.bbox,l=void 0===c||c,d=s.length,f=void 0===d||d,h=s.sampleSize,p=void 0===h?10:h,g="number"===typeof a,v=t,m=e,y=0,b=[v,m,y],x=[v,m],w={x:0,y:0},E=[{x:v,y:m}];g&&a<=0&&(w={x:v,y:m});for(var S=0;S<=p;S+=1){if(v=(u=ut(t,e,n,r,o,i,S/p)).x,m=u.y,l&&E.push({x:v,y:m}),f&&(y+=et(x,[v,m])),x=[v,m],g&&y>=a&&a>b[2]){var M=(y-a)/(y-b[2]);w={x:x[0]*(1-M)+b[0]*M,y:x[1]*(1-M)+b[1]*M}}b=[v,m,y]}return g&&a>=y&&(w={x:o,y:i}),{length:y,point:w,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function lt(t,e,n){for(var r,o,i,a,s,u,c,l,d,f=V(t),h="number"===typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],w=0,E={x:0,y:0},S=E,M=E,k=E,_=0,A=0,C=f.length;A=e&&(k=M),x.push(S),b.push(E),_+=w,g=(u="Z"!==l?d.slice(-2):[m,y])[0],v=u[1];return h&&e>=_&&(k={x:g,y:v}),{length:_,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function dt(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=lt(t,void 0,_(_({},e),{length:!1})),r=n.min,o=r.x,i=r.y,a=n.max,s=a.x,u=a.y,c=s-o,l=u-i;return{width:c,height:l,x:o,y:i,x2:s,y2:u,cx:o+c/2,cy:i+l/2,cz:Math.max(c,l)+Math.min(c,l)/2}}function ft(t,e){return lt(t,void 0,_(_({},e),{bbox:!1,length:!0})).length}function ht(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=lt(t,void 0,_(_({},e),{bbox:!0,length:!0})),r=n.length,o=n.min,i=o.x,a=o.y,s=n.max,u=s.x,c=s.y,l=u-i,d=c-a;return{length:r,width:l,height:d,x:i,y:a,x2:u,y2:c,cx:i+l/2,cy:a+d/2,cz:Math.max(l,d)+Math.min(l,d)/2}}function pt(t,e){var n=t.length-1,r=[],o=0,i=function(t){var e=t.length,n=e-1;return t.map((function(r,o){return t.map((function(r,i){var a,s=o+i;return 0===i||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return i.forEach((function(i,a){t.slice(1).forEach((function(r,i){o+=et(t[(a+i)%n].slice(-2),e[i%n].slice(-2))})),r[a]=o,o=0})),i[r.indexOf(Math.min.apply(null,r))]}function gt(t){var e=0,n=0,r=0;return $(t).map((function(t){var o;if("M"===t[0])return e=t[1],n=t[2],0;var i=t.slice(1),a=i[0],s=i[1],u=i[2],c=i[3],l=i[4],d=i[5];return r=function(t,e,n,r,o,i,a,s){return 3*((s-e)*(n+o)-(a-t)*(r+i)+r*(t-o)-n*(e-i)+s*(o+t/3)-a*(i+e/3))/20}(e,n,a,s,u,c,l,d),o=t.slice(-2),e=o[0],n=o[1],r})).reduce((function(t,e){return t+e}),0)}function vt(t){return gt(t)>=0}function mt(t,e,n){return lt(t,e,_(_({},n),{bbox:!1,length:!0})).point}function yt(t,e){for(var n,r,o,i,a=U(t),s=V(a),u=ft(a),c=function(t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},l=8,d=0,f=0,h=1/0,p=0;p<=u;p+=l)(d=c(n=mt(s,p))).5;)m=c(o=mt(s,g=f-l)),y=c(i=mt(s,v=f+l)),g>=0&&m=o)return s=o-(a=ft(r=n.slice(0,-1))),{segment:n[i],index:i,length:s,lengthAtSegment:a};for(var d=[];i>0;)u=r[i],s=o-(a=ft(r=r.slice(0,-1))),o=a,d.push({segment:u,index:i,length:s,lengthAtSegment:a}),i-=1;return d.find((function(t){return t.lengthAtSegment<=e}))}(a,f);return{closest:r,distance:Math.sqrt(h),segment:b}}function bt(t,e){var n=yt(t,e).distance;return Math.abs(n)<.001}function xt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),o=e?st(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?o?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),o=t.slice(4,6),i=t.slice(6,8),a=q(n,r,e),s=q(r,o,e),u=q(o,i,e),c=q(a,s,e),l=q(s,u,e),d=q(c,l,e);return[["C"].concat(a,c,d),["C"].concat(l,u,i)]}(r):[t,t]:[t],l:o}}))}function wt(t,e,n){var r=xt(t),o=xt(e),i=r.length,a=o.length,s=r.filter((function(t){return t.l})).length,u=o.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=o.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,d=n||Math.max(i,a),f=[c,l],h=[d-i,d-a],p=0,g=[r,o].map((function(t,e){return t.l===d?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&h[e]&&t.l>=f[e],h[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:wt(g[0],g[1],d)}const Et=function(t){return null!==t&&"function"!==typeof t&&isFinite(t.length)};const St=function(t,e){return!!Et(t)&&t.indexOf(e)>-1};const Mt=function(t,e){if(!Et(t))return t;for(var n=[],r=0;r-1;)Ht.call(t,i,1);return t};var Kt=Array.prototype.splice;const $t=function(t,e){if(!Et(t))return[];for(var n=t?e.length:0,r=n-1;n--;){var o=void 0,i=e[n];n!==r&&i===o||(o=i,Kt.call(t,i,1))}return t};const Qt=function(t,e,n){if(!Ct(t)&&!jt(t))return t;var r=n;return It(t,(function(t,n){r=e(r,t,n)})),r};const Jt=function(t,e){var n=[];if(!Et(t))return n;for(var r=-1,o=[],i=t.length;++re[o])return 1;if(t[o]n?n:t};const we=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var o=n.substr(r+1).length;return o>20&&(o=20),parseFloat(t.toFixed(o))};function Ee(t){return"number"===typeof t}function Se(t){return Ee(t)&&t%1!==0}function Me(t){return Ee(t)&&t%2===0}function ke(t){return Ee(t)&&t%1===0}function _e(t){return Ee(t)&&t<0}var Ae=1e-5;function Ce(t,e,n){return void 0===n&&(n=Ae),t===e||Math.abs(t-e)0},Te=function(t,e){if(Ct(t)){for(var n,r=-1/0,o=0;or&&(n=i,r=a)}return n}},Ne=function(t,e){if(Ct(t)){for(var n,r=1/0,o=0;oe?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=o=i=null},c},Rn=function(t){return Et(t)?Array.prototype.slice.call(t):[]};var Fn={};const Bn=function(t){return Fn[t=t||"g"]?Fn[t]+=1:Fn[t]=1,t+Fn[t]},zn=function(){},Gn=function(t){return t};function Un(t){return At(t)?0:Et(t)?t.length:Object.keys(t).length}const Wn=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();var Yn=1e-6;function Vn(t){return Math.abs(t)0!==Vn(s[1]-n)>0&&Vn(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var qn=function(t,e,n){return t>=e&&t<=n};function Zn(t){for(var e=[],n=t.length,r=0;r1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Kn(t,e){var n=!1;return t.forEach((function(t){if(function(t,e,n,r){var o=n.x-t.x,i=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,l=a*c-s*u,d=null;if(l*l>.001*(a*a+s*s)*(u*u+c*c)){var f=(o*c-i*u)/l,h=(o*s-i*a)/l;qn(f,0,1)&&qn(h,0,1)&&(d={x:t.x+f*a,y:t.y+f*s})}return d}(t.from,t.to,e.from,e.to))return n=!0,!1})),n}function $n(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}}function Qn(t,e){if(t.length<2||e.length<2)return!1;var n,r,o=$n(t),i=$n(e);if(n=o,(r=i).minX>n.maxX||r.maxXn.maxY||r.maxY{"use strict";n.r(e),n.d(e,{AbstractMatrix:()=>x,CHO:()=>$,CholeskyDecomposition:()=>$,EVD:()=>Z,EigenvalueDecomposition:()=>Z,LU:()=>j,LuDecomposition:()=>j,Matrix:()=>E,MatrixColumnSelectionView:()=>k,MatrixColumnView:()=>M,MatrixFlipColumnView:()=>_,MatrixFlipRowView:()=>A,MatrixRowSelectionView:()=>O,MatrixRowView:()=>C,MatrixSelectionView:()=>I,MatrixSubView:()=>T,MatrixTransposeView:()=>N,NIPALS:()=>Q,Nipals:()=>Q,QR:()=>F,QrDecomposition:()=>F,SVD:()=>B,SingularValueDecomposition:()=>B,WrapperMatrix1D:()=>P,WrapperMatrix2D:()=>L,correlation:()=>q,covariance:()=>H,default:()=>E,determinant:()=>U,inverse:()=>z,linearDependencies:()=>V,pseudoInverse:()=>X,solve:()=>G,wrap:()=>D});const r=Object.prototype.toString;function o(t){const e=r.call(t);return e.endsWith("Array]")&&!e.includes("Big")}function i(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!o(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,a=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!o(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,a=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;us&&(s=t[u]);return s}(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=n.min,s=void 0===a?n.autoMinMax?r:0:a,u=n.max,c=void 0===u?n.autoMinMax?i:1:u;if(s>=c)throw new RangeError("min option must be smaller than max option");for(var l=(c-s)/(i-r),d=0;d1&&void 0!==arguments[1]?arguments[1]:{};const{maxRows:n=15,maxColumns:r=10,maxNumSize:o=8}=e;return"".concat(t.constructor.name," {\n").concat(a,"[\n").concat(s).concat(function(t,e,n,r){const{rows:o,columns:i}=t,a=Math.min(o,e),u=Math.min(i,n),l=[];for(let s=0;sr)throw new RangeError("Row index out of range")}function d(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function f(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function h(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function p(t,e,n){return{row:g(t,e),column:v(t,n)}}function g(t,e){if("object"!==typeof e)throw new TypeError("unexpected type for row indices");if(e.some((e=>e<0||e>=t.rows)))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function v(t,e){if("object"!==typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function m(t,e,n,r,o){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(b("startRow",e),b("endRow",n),b("startColumn",r),b("endColumn",o),e>n||r>o||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||o<0||o>=t.columns)throw new RangeError("Submatrix indices are out of range")}function y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let o=new E(t,e);for(let i=0;i2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==typeof n)throw new TypeError("options must be an object");const{min:r=0,max:o=1e3,random:i=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(o))throw new TypeError("max must be an integer");if(r>=o)throw new RangeError("min must be smaller than max");let a=o-r,s=new E(t,e);for(let u=0;un?(o=!0,n=e):(r=!1,o=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,o=!1;for(;tn?(o=!0,n=e):(r=!1,o=!0);for(let n=e+1;nt.get(r,n)&&(r=o);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let o=t.get(e,n);for(let r=n;r=0;)if(0===t.maxRow(r))r--;else{let o=0,i=!1;for(;o0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new E(this.rows*e,this.columns*n);for(let o=0;ot&&(t=this.get(e,n));return t}maxIndex(){let t=this.get(0,0),e=[0,0];for(let n=0;nt&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){let t=this.get(0,0);for(let e=0;ee&&(e=this.get(t,n));return e}maxRowIndex(t){l(this,t);let e=this.get(t,0),n=[t,0];for(let r=1;re&&(e=this.get(t,r),n[1]=r);return n}minRow(t){l(this,t);let e=this.get(t,0);for(let n=1;ne&&(e=this.get(n,t));return e}maxColumnIndex(t){d(this,t);let e=this.get(0,t),n=[0,t];for(let r=1;re&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){d(this,t);let e=this.get(0,t);for(let n=1;n0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new E(this.rows,this.columns);for(let o=0;o0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new E(this.rows,this.columns);for(let o=0;o0&&void 0!==arguments[0]?arguments[0]:w;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:w;for(let e=0;en||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new E(t.length,n-e+1);for(let o=0;o=this.rows)throw new RangeError("Row index out of range: ".concat(t[o]));r.set(o,i-e,this.get(t[o],i))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new E(n-e+1,t.length);for(let o=0;o=this.columns)throw new RangeError("Column index out of range: ".concat(t[o]));r.set(i-e,o,this.get(i,t[o]))}return r}setSubMatrix(t,e,n){m(this,e,e+(t=E.checkMatrix(t)).rows-1,n,n+t.columns-1);for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===typeof t&&(e=t,t=void 0),"object"!==typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!==typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,o=t.columns,i=[];for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:{};if("object"===typeof t&&(e=t,t=void 0),"object"!==typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("object"===typeof t&&(e=t,t=void 0),"object"!==typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n0){if(this.data=[],!(Number.isInteger(e)&&e>0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"===typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{};const{rows:n=1}=e;if(t.length%n!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=n,this.columns=t.length/n,this.data=t}set(t,e,n){let r=this._calculateIndex(t,e);return this.data[r]=n,this}get(t,e){let n=this._calculateIndex(t,e);return this.data[n]}_calculateIndex(t,e){return t*this.columns+e}}class L extends x{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function D(t,e){if(Array.isArray(t))return t[0]&&Array.isArray(t[0])?new L(t):new P(t,e);throw new Error("the argument is not an array")}class j{constructor(t){let e,n,r,o,i,a,s,u,c,l=(t=L.checkMatrix(t)).clone(),d=l.rows,f=l.columns,h=new Float64Array(d),p=1;for(e=0;eMath.abs(u[o])&&(o=e);if(o!==n){for(r=0;r=0;o--){for(r=0;re?r.set(o,e,t.get(o,e)):o===e?r.set(o,e,1):r.set(o,e,0);return r}get upperTriangularMatrix(){let t=this.LU,e=t.rows,n=t.columns,r=new E(e,n);for(let o=0;oMath.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class F{constructor(t){let e,n,r,o,i=(t=L.checkMatrix(t)).clone(),a=t.rows,s=t.columns,u=new Float64Array(s);for(r=0;r=0;i--){for(o=0;o=0;n--){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=(t=L.checkMatrix(t)).rows,r=t.columns;const{computeLeftSingularVectors:o=!0,computeRightSingularVectors:i=!0,autoTranspose:a=!1}=e;let s,u=Boolean(o),c=Boolean(i),l=!1;if(n=0;t--)if(0!==h[t]){for(let e=t+1;e=0;E--){if(E0;){let t,e;for(t=S-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+_*Math.abs(h[t]+Math.abs(h[t+1]));if(Math.abs(v[t])<=e||Number.isNaN(v[t])){v[t]=0;break}}if(t===S-2)e=4;else{let n;for(n=S-1;n>=t&&n!==t;n--){let e=(n!==S?Math.abs(v[n]):0)+(n!==t+1?Math.abs(v[n-1]):0);if(Math.abs(h[n])<=_*e){h[n]=0;break}}n===t?e=3:n===S-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=v[S-2];v[S-2]=0;for(let n=S-2;n>=t;n--){let o=R(h[n],e),i=h[n]/o,a=e/o;if(h[n]=o,n!==t&&(e=-a*v[n-1],v[n-1]=i*v[n-1]),c)for(let t=0;t=h[t+1]);){let e=h[t];if(h[t]=h[t+1],h[t+1]=e,c&&te&&o.set(c,n,t.get(c,n)/this.s[n]);let i=this.U,a=i.rows,s=i.columns,u=new E(n,a);for(let c=0;ct&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return E.diag(this.s)}}function z(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=L.checkMatrix(t),e?new B(t).inverse():G(t,E.eye(t.rows))}function G(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=L.checkMatrix(t),e=L.checkMatrix(e),n?new B(t).solve(e):t.isSquare()?new j(t).solve(e):new F(t).solve(e)}function U(t){if((t=E.checkMatrix(t)).isSquare()){let e,n,r,o;if(2===t.columns)return e=t.get(0,0),n=t.get(0,1),r=t.get(1,0),o=t.get(1,1),e*o-n*r;if(3===t.columns){let o,i,a;return o=new I(t,[1,2],[1,2]),i=new I(t,[1,2],[0,2]),a=new I(t,[1,2],[0,1]),e=t.get(0,0),n=t.get(0,1),r=t.get(0,2),e*U(o)-n*U(i)+r*U(a)}return new j(t).determinant}throw Error("determinant can only be calculated for a square matrix")}function W(t,e){let n=[];for(let r=0;r3&&void 0!==arguments[3]?arguments[3]:1e-9;if(t>(arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-9))return new Array(e.rows+1).fill(0);{let t=e.addRow(n,[0]);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};const{thresholdValue:n=1e-9,thresholdError:r=1e-9}=e;let o=(t=E.checkMatrix(t)).rows,i=new E(o,o);for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;t=E.checkMatrix(t);let n=new B(t,{autoTranspose:!0}),r=n.leftSingularVectors,o=n.rightSingularVectors,i=n.diagonal;for(let a=0;ae?i[a]=1/i[a]:i[a]=0;return o.mmul(E.diag(i).mmul(r.transpose()))}function H(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new E(t);let r=!1;if("object"!==typeof e||E.isMatrix(e)||Array.isArray(e)?e=new E(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:o=!0}=n;o&&(t=t.center("column"),r||(e=e.center("column")));const i=t.transpose().mmul(e);for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new E(t);let r=!1;if("object"!==typeof e||E.isMatrix(e)||Array.isArray(e)?e=new E(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:o=!0,scale:i=!0}=n;o&&(t.center("column"),r||e.center("column")),i&&(t.scale("column"),r||e.scale("column"));const a=t.standardDeviation("column",{unbiased:!0}),s=r?a:e.standardDeviation("column",{unbiased:!0}),u=t.transpose().mmul(e);for(let c=0;c1&&void 0!==arguments[1]?arguments[1]:{};const{assumeSymmetric:n=!1}=e;if(!(t=L.checkMatrix(t)).isSquare())throw new Error("Matrix is not a square matrix");let r,o,i=t.columns,a=new E(i,i),s=new Float64Array(i),u=new Float64Array(i),c=t,l=!1;if(l=!!n||t.isSymmetric(),l){for(r=0;r0;s--){for(d=0,a=0,c=0;c0&&(i=-i),e[s]=d*i,a-=o*i,n[s-1]=o-i,u=0;uc){x=0;do{for(x+=1,o=n[c],d=(n[c+1]-o)/(2*e[c]),f=R(d,1),d<0&&(f=-f),n[c]=e[c]/(d+f),n[c+1]=e[c]*(d+f),h=n[c+1],i=o-n[c],a=c+2;a=c;a--)for(v=g,g=p,b=y,o=p*e[a],i=p*d,f=R(d,e[a]),e[a+1]=y*f,y=e[a]/f,p=d/f,d=p*n[a]-y*o,n[a+1]=i+y*(p*o+y*n[a]),u=0;uS*E)}n[c]=n[c]+w,e[c]=0}for(a=0;a=c;s--)n[s]=e.get(s,c-1)/l,a+=n[s]*n[s];for(i=Math.sqrt(a),n[c]>0&&(i=-i),a-=n[c]*i,n[c]=n[c]-i,u=c;u=c;s--)o+=n[s]*e.get(s,u);for(o/=a,s=c;s<=f;s++)e.set(s,u,e.get(s,u)-o*n[s])}for(s=0;s<=f;s++){for(o=0,u=f;u>=c;u--)o+=n[u]*e.get(s,u);for(o/=a,u=c;u<=f;u++)e.set(s,u,e.get(s,u)-o*n[u])}n[c]=l*n[c],e.set(c,c-1,l*i)}}for(s=0;s=d+1;c--)if(0!==e.get(c,c-1)){for(s=c+1;s<=f;s++)n[s]=e.get(s,c-1);for(u=c;u<=f;u++){for(i=0,s=c;s<=f;s++)i+=n[s]*r.get(s,u);for(i=i/n[c]/e.get(c,c-1),s=c;s<=f;s++)r.set(s,u,r.get(s,u)+i*n[s])}}}(i,t,e,a),function(t,e,n,r,o){let i,a,s,u,c,l,d,f,h,p,g,v,m,y,b,x=t-1,w=0,E=t-1,S=Number.EPSILON,M=0,k=0,_=0,A=0,C=0,O=0,I=0,T=0;for(i=0;iE)&&(n[i]=o.get(i,i),e[i]=0),a=Math.max(i-1,0);a=w;){for(u=x;u>w&&(O=Math.abs(o.get(u-1,u-1))+Math.abs(o.get(u,u)),0===O&&(O=k),!(Math.abs(o.get(u,u-1))=0){for(I=_>=0?_+I:_-I,n[x-1]=f+I,n[x]=n[x-1],0!==I&&(n[x]=f-d/I),e[x-1]=0,e[x]=0,f=o.get(x,x-1),O=Math.abs(f)+Math.abs(I),_=f/O,A=I/O,C=Math.sqrt(_*_+A*A),_/=C,A/=C,a=x-1;a0)){for(O=Math.sqrt(O),h=u&&(I=o.get(c,c),C=f-I,O=h-I,_=(C*O-d)/o.get(c+1,c)+o.get(c,c+1),A=o.get(c+1,c+1)-I-C-O,C=o.get(c+2,c+1),O=Math.abs(_)+Math.abs(A)+Math.abs(C),_/=O,A/=O,C/=O,c!==u)&&!(Math.abs(o.get(c,c-1))*(Math.abs(A)+Math.abs(C))c+2&&o.set(i,i-3,0);for(s=c;s<=x-1&&(y=s!==x-1,s!==c&&(_=o.get(s,s-1),A=o.get(s+1,s-1),C=y?o.get(s+2,s-1):0,f=Math.abs(_)+Math.abs(A)+Math.abs(C),0!==f&&(_/=f,A/=f,C/=f)),0!==f);s++)if(O=Math.sqrt(_*_+A*A+C*C),_<0&&(O=-O),0!==O){for(s!==c?o.set(s,s-1,-O*f):u!==c&&o.set(s,s-1,-o.get(s,s-1)),_+=O,f=_/O,h=A/O,I=C/O,A/=_,C/=_,a=s;a=0;x--)if(_=n[x],A=e[x],0===A)for(u=x,o.set(x,x,1),i=x-1;i>=0;i--){for(d=o.get(i,i)-_,C=0,a=u;a<=x;a++)C+=o.get(i,a)*o.get(a,x);if(e[i]<0)I=d,O=C;else if(u=i,0===e[i]?o.set(i,x,0!==d?-C/d:-C/(S*k)):(f=o.get(i,i+1),h=o.get(i+1,i),A=(n[i]-_)*(n[i]-_)+e[i]*e[i],l=(f*O-I*C)/A,o.set(i,x,l),o.set(i+1,x,Math.abs(f)>Math.abs(I)?(-C-d*l)/f:(-O-h*l)/I)),l=Math.abs(o.get(i,x)),S*l*l>1)for(a=i;a<=x;a++)o.set(a,x,o.get(a,x)/l)}else if(A<0)for(u=x-1,Math.abs(o.get(x,x-1))>Math.abs(o.get(x-1,x))?(o.set(x-1,x-1,A/o.get(x,x-1)),o.set(x-1,x,-(o.get(x,x)-_)/o.get(x,x-1))):(b=K(0,-o.get(x-1,x),o.get(x-1,x-1)-_,A),o.set(x-1,x-1,b[0]),o.set(x-1,x,b[1])),o.set(x,x-1,0),o.set(x,x,1),i=x-2;i>=0;i--){for(p=0,g=0,a=u;a<=x;a++)p+=o.get(i,a)*o.get(a,x-1),g+=o.get(i,a)*o.get(a,x);if(d=o.get(i,i)-_,e[i]<0)I=d,C=p,O=g;else if(u=i,0===e[i]?(b=K(-p,-g,d,A),o.set(i,x-1,b[0]),o.set(i,x,b[1])):(f=o.get(i,i+1),h=o.get(i+1,i),v=(n[i]-_)*(n[i]-_)+e[i]*e[i]-A*A,m=2*(n[i]-_)*A,0===v&&0===m&&(v=S*k*(Math.abs(d)+Math.abs(A)+Math.abs(f)+Math.abs(h)+Math.abs(I))),b=K(f*C-I*p+A*g,f*O-I*g-A*p,v,m),o.set(i,x-1,b[0]),o.set(i,x,b[1]),Math.abs(f)>Math.abs(I)+Math.abs(A)?(o.set(i+1,x-1,(-p-d*o.get(i,x-1)+A*o.get(i,x))/f),o.set(i+1,x,(-g-d*o.get(i,x)-A*o.get(i,x-1))/f)):(b=K(-C-h*o.get(i,x-1),-O-h*o.get(i,x),I,A),o.set(i+1,x-1,b[0]),o.set(i+1,x,b[1]))),l=Math.max(Math.abs(o.get(i,x-1)),Math.abs(o.get(i,x))),S*l*l>1)for(a=i;a<=x;a++)o.set(a,x-1,o.get(a,x-1)/l),o.set(a,x,o.get(a,x)/l)}for(i=0;iE)for(a=i;a=w;a--)for(i=w;i<=E;i++){for(I=0,s=w;s<=Math.min(a,E);s++)I+=r.get(i,s)*o.get(s,a);r.set(i,a,I)}}(i,u,s,a,t)}this.n=i,this.e=u,this.d=s,this.V=a}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let t,e,n=this.n,r=this.e,o=this.d,i=new E(n,n);for(t=0;t0?i.set(t,t+1,r[t]):r[t]<0&&i.set(t,t-1,r[t])}return i}}function K(t,e,n,r){let o,i;return Math.abs(n)>Math.abs(r)?(o=r/n,i=n+o*r,[(t+o*e)/i,(e-o*t)/i]):(o=n/r,i=r+o*n,[(o*t+e)/i,(o*e-t)/i])}class ${constructor(t){if(!(t=L.checkMatrix(t)).isSymmetric())throw new Error("Matrix is not symmetric");let e,n,r,o=t,i=o.rows,a=new E(i,i),s=!0;for(n=0;n0,a.set(n,n,Math.sqrt(Math.max(t,0))),r=n+1;r=0;i--)for(o=0;o1&&void 0!==arguments[1]?arguments[1]:{};t=L.checkMatrix(t);let{Y:n}=e;const{scaleScores:r=!1,maxIterations:o=1e3,terminationCriteria:i=1e-10}=e;let a;if(n){if(n=Array.isArray(n)&&"number"===typeof n[0]?E.columnVector(n):L.checkMatrix(n),!n.isColumnVector()||n.rows!==t.rows)throw new Error("Y must be a column vector of length X.rows");a=n}else a=t.getColumnVector(0);let s,u,c,l,d=1;for(let f=0;fi;f++)c=t.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),c=c.div(c.norm()),s=t.mmul(c).div(c.transpose().mmul(c).get(0,0)),f>0&&(d=s.clone().sub(l).pow(2).sum()),l=s.clone(),n?(u=n.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),u=u.div(u.norm()),a=n.mmul(u).div(u.transpose().mmul(u).get(0,0))):a=s;if(n){let e=t.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0));e=e.div(e.norm());let r=t.clone().sub(s.clone().mmul(e.transpose())),o=a.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),i=n.clone().sub(s.clone().mulS(o.get(0,0)).mmul(u.transpose()));this.t=s,this.p=e.transpose(),this.w=c.transpose(),this.q=u,this.u=a,this.s=s.transpose().mmul(s),this.xResidual=r,this.yResidual=i,this.betas=o}else this.w=c.transpose(),this.s=s.transpose().mmul(s).sqrt(),this.t=r?s.clone().div(this.s.get(0,0)):s,this.xResidual=t.sub(s.mmul(c.transpose()))}}},5285:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Graph:()=>w,GraphWithEvent:()=>C,algorithm:()=>r,comparision:()=>i,essence:()=>o,generate:()=>s});var r={};n.r(r),n.d(r,{components:()=>P,dfs:()=>D,dijkstra:()=>z,dijkstraAll:()=>G,findCycles:()=>W,floydWarshall:()=>ot,isAcyclic:()=>tt,postorder:()=>et,preorder:()=>nt,prim:()=>N,tarjan:()=>U,topsort:()=>J});var o={};n.r(o),n.d(o,{hasSelfLoop:()=>bt,isGraph:()=>vt,isNullGraph:()=>yt,isSimpleGraph:()=>mt});var i={};n.r(i),n.d(i,{containAllSameEdges:()=>dt,containAllSameNodes:()=>lt,containSameEdges:()=>at,containSameNodes:()=>it,getSameEdges:()=>ut,getSameNodes:()=>st,isGraphComplement:()=>xt,isGraphContainsAnother:()=>ht,isGraphOptionSame:()=>ct,isGraphSame:()=>ft});var a,s={};function u(t,e){var n=t.get(e)||0;t.set(e,n+1)}function c(t,e){var n=t.get(e);void 0!==n&&((n-=1)>0?t.set(e,n):t.delete(e))}function l(t,e,n,r){var o=String(e),i=String(n);if(!t&&o>i){var s=o;o=i,i=s}return o+a.EDGE_KEY_DELIM+i+a.EDGE_KEY_DELIM+(void 0===r?a.DEFAULT_EDGE_NAME:r)}function d(t,e,n,r){var o=String(e),i=String(n),a={v:e,w:n};if(!t&&o>i){var s=a.v;a.v=a.w,a.w=s}return void 0!==r&&(a.name=r),a}function f(t,e){return l(t,e.v,e.w,e.name)}function h(t){return"function"===typeof t}n.r(s),n.d(s,{getGraphComplement:()=>wt}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM="\x01"}(a||(a={}));var p=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},g=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))};function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return h(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,o;e.checkCompound();for(var i=void 0===n?e.GRAPH_NODE:n,a=e.parent(i);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,i);var s=e.childrenMap.get(i);return s.set(t,!0),null===(o=e.childrenMap)||void 0===o||o.set(i,s),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,o=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return o?Array.from(o.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,o=e.multigraph,i=e.compound,a=new t({directed:r,multigraph:o,compound:i});if(a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),i){a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))}))}return a},this.setDefaultEdgeLabel=function(t){return h(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(f(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(f(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdgeObj=function(t){var n=t.v,r=t.w,o=t.name;return e.removeEdge(n,r,o)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:p(t),edges:g(t),value:t.graph()};return void 0===e.value&&delete e.value,e}(e)},this.nodeInDegree=function(t){var n=e.inEdgesMap.get(t);return n?n.size:0},this.nodeOutDegree=function(t){var n=e.outEdgesMap.get(t);return n?n.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var r=m(m({},x),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,n,r;return e=t,(n=[{key:"setNode",value:function(t,e){var n,r=this.nodesLabelMap,o=this.defaultNodeLabelFn,i=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,c=this.outEdgesMap,l=this.predecessorsMap,d=this.successorsMap;return r.has(t)?(void 0!==e&&r.set(t,e),this):(r.set(t,e||o(t)),i()&&(null===a||void 0===a||a.set(t,this.GRAPH_NODE),null===s||void 0===s||s.set(t,new Map),(null===s||void 0===s?void 0:s.has(this.GRAPH_NODE))||null===s||void 0===s||s.set(this.GRAPH_NODE,new Map),null===s||void 0===s||null===(n=s.get(this.GRAPH_NODE))||void 0===n||n.set(t,!0)),[u,c,l,d].forEach((function(e){return e.set(t,new Map)})),this.nodeCountNum+=1,this)}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var n,r,o,i=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,c=this.successorsMap,l=this.nodesLabelMap;this.isCompound()&&(this.removeFromParentsChildList(t),null===(n=this.parentMap)||void 0===n||n.delete(t),null===(r=this.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(o=this.childrenMap)||void 0===o||o.delete(t));var d=a.get(t),f=s.get(t);Array.from(d.values()).forEach((function(t){return i(t)})),Array.from(f.values()).forEach((function(t){return i(t)})),l.delete(t),a.delete(t),s.delete(t),u.delete(t),c.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,n,r){var o,i,a=d(this.isDirected(),t,e,r),s=f(this.isDirected(),a),c=a.v,l=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,n),this;if(void 0!==r&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(l),this.edgesLabelsMap.set(s,n||this.defaultEdgeLabelFn(c,l,r)),Object.freeze(a),this.edgesMap.set(s,a);var h=this.predecessorsMap.get(l),p=this.successorsMap.get(c);return u(h,c),u(p,l),null===(o=this.inEdgesMap.get(l))||void 0===o||o.set(s,a),null===(i=this.outEdgesMap.get(c))||void 0===i||i.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,n){var r=l(this.isDirected(),t,e,n);if(this.edgesMap.get(r)){var o=d(this.isDirected(),t,e,n),i=o.v,a=o.w;this.edgesLabelsMap.delete(r),this.edgesMap.delete(r);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(i);c(s,i),c(u,a),this.inEdgesMap.get(a).delete(r),this.outEdgesMap.get(i).delete(r),this.edgeCountNum-=1}return this}}])&&b(e.prototype,n),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function S(t,e){for(var n=0;n-1&&this.eventPool[t].splice(n,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r>1])||void 0===a?void 0:a.priority)e.arr[r].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[r].priority," New: ").concat(n));e.arr[r].priority=n,e.innerDecrease(r)}}));const N=function(t,e){var n,r=new w,o=new Map,i=new T;function a(t){var r=t.v===n?t.w:t.v,a=i.priority(r);if(void 0!==a){var s=e(t);s0;){var u;if(n=i.removeMin(),o.has(n))r.setEdge(n,o.get(n));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(n))||void 0===u||u.forEach(a)}return r};const P=function(t){var e=new Set,n=[];return t.nodes().forEach((function(r){for(var o=[],i=[r];i.length>0;){var a,s,u=i.pop();if(!e.has(u))e.add(u),o.push(u),null===(a=t.successors(u))||void 0===a||a.forEach((function(t){return i.push(t)})),null===(s=t.predecessors(u))||void 0===s||s.forEach((function(t){return i.push(t)}))}o.length&&n.push(o)})),n};var L=function t(e,n,r,o,i,a){o.includes(n)||(o.push(n),r||a.push(n),i(n).forEach((function(n){return t(e,n,r,o,i,a)})),r&&a.push(n))};const D=function(t,e,n){var r=Array.isArray(e)?e:[e],o=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);L(t,e,"post"===n,a,o,i)})),i};function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(u){s=!0,o=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(o=s.removeMin(),!(i=a.get(o))||i.distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);var c={};return Array.from(a.entries()).forEach((function(t){var e=j(t,2),n=e[0],r=e[1];return c[String(n)]=r,c})),c};const z=function(t,e,n,r){return B(t,e,n||F,r||function(e){return t.outEdges(e)})};const G=function(t,e,n){var r={};return t.nodes().forEach((function(o){return r[String(o)]=z(t,o,e,n),r})),r};const U=function(t){var e=0,n=[],r=new Map,o=[];function i(a){var s,u={onStack:!0,lowlink:e,index:e};if(r.set(a,u),e+=1,n.push(a),null===(s=t.successors(a))||void 0===s||s.forEach((function(t){var e;if(r.has(t)){if(null===(e=r.get(t))||void 0===e?void 0:e.onStack){var n=r.get(t);u.lowlink=Math.min(u.lowlink,n.index)}}else{i(t);var o=r.get(t);u.lowlink=Math.min(u.lowlink,o.lowlink)}})),u.lowlink===u.index){var c,l=[];do{c=n.pop(),r.get(c).onStack=!1,l.push(c)}while(a!==c);o.push(l)}}return t.nodes().forEach((function(t){r.has(t)||i(t)})),o};const W=function(t){return U(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function V(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}(s),s&&-1===o.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===o[0])n(t,e);else if(s===o[1])n(t,e),t.right2left();else if(s===o[2])n(t,e);else if(s===o[3])n(t,e),t.bottom2top();else if(s===o[4]||s===o[5]){var u=r(t,e),c=u.left,l=u.right;n(c,e),n(l,e),e.isHorizontal?c.right2left():c.bottom2top(),l.translate(c.x-l.x,c.y-l.y),t.x=c.x,t.y=l.y;var d=t.getBoundingBox();e.isHorizontal?d.top<0&&t.translate(0,-d.top):d.left<0&&t.translate(-d.left,0)}var f=e.fixedRoot;return void 0===f&&(f=!0),f&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),function(t,e){if(e.radial){var n=e.isHorizontal?["x","y"]:["y","x"],r=n[0],o=n[1],i={x:1/0,y:1/0},a={x:-1/0,y:-1/0},s=0;t.DFTraverse((function(t){s++;var e=t.x,n=t.y;i.x=Math.min(i.x,e),i.y=Math.min(i.y,n),a.x=Math.max(a.x,e),a.y=Math.max(a.y,n)}));var u=a[o]-i[o];if(0===u)return;var c=2*Math.PI/s;t.DFTraverse((function(e){var n=(e[o]-i[o])/u*(2*Math.PI-c)+c,a=e[r]-t[r];e.x=Math.cos(n)*a,e.y=Math.sin(n)*a}))}}(t,e),t}},function(t,e,n){var r=n(0),o={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function i(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof i)return t;n.data=t;var r=e.getHGap(t),o=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,o),n}r.assign(i.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new i(t,e=r.assign({},o,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),l=c?c.length:0;if(a.children=new Array(l),c&&l)for(var d=0;dn.low&&(n=n.nxt);var s=o+r.prelim+r.w-(a+i.prelim);s>0&&(a+=s,c(t,e,n.index,s));var u=f(r),h=f(i);u<=h&&null!==(r=d(r))&&(o+=r.mod),u>=h&&null!==(i=l(i))&&(a+=i.mod)}!r&&i?function(t,e,n,r){var o=t.c[0].el;o.tl=n;var i=r-n.mod-t.c[0].msel;o.mod+=i,o.prelim-=i,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,i,a):r&&!i&&function(t,e,n,r){var o=t.c[e].er;o.tr=n;var i=r-n.mod-t.c[e].mser;o.mod+=i,o.prelim-=i,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,o)}function c(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var o=e-n;t.c[n+1].shift+=r/o,t.c[e].shift-=r/o,t.c[e].change-=r-r/o}}(t,e,n,r)}function l(t){return 0===t.cs?t.tl:t.c[0]}function d(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function f(t){return t.y+t.h}function h(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,r);var p=n.fromNode(t,r);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=h(f(e.c[0].el),0,null),r=1;rs&&(s=e.depth);var n=e.children,r=n.length,i=new o(e.height,[]);return n.forEach((function(e,n){var o=t(e);i.children.push(o),0===n&&(i.leftChild=o),n===r-1&&(i.rightChild=o)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(u),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(u),a(u,t,e.isHorizontal),t}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var o=n(1),i=n(11),a=n(4),s=n(0),u=["LR","RL","H"],c=u[0],l=function(t){function e(){return t.apply(this,arguments)||this}var n,o;return o=t,(n=e).prototype=Object.create(o.prototype),n.prototype.constructor=n,r(n,o),e.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,o=t.dropCap,s=void 0===o||o,l=t.direction,d=void 0===l?c:l,f=t.align;if(d&&-1===u.indexOf(d))throw new TypeError("Invalid direction: "+d);if(d===u[0])i(e,r,s,f);else if(d===u[1])i(e,r,s,f),e.right2left();else if(d===u[2]){var h=a(e,t),p=h.left,g=h.right;i(p,r,s,f),p.right2left(),i(g,r,s,f);var v=p.getBoundingBox();g.translate(v.width,0),e.x=g.x-e.width/2}return e},e}(o),d={};t.exports=function(t,e){return e=s.assign({},d,e),new l(t,e).execute()}},function(t,e,n){var r=n(0);t.exports=function(t,e,n,o){var i=null;t.eachNode((function(t){!function(t,e,n,o,i){var a=("function"===typeof n?n(t):n)*t.depth;if(!o)try{if(t.id===t.parent.children[0].id)return t.x+=a,void(t.y=e?e.y:0)}catch(c){}if(t.x+=a,e){if(t.y=e.y+r.getHeight(e,t,i),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,u=s.y+r.getHeight(s,t,i);t.y=u>t.y?u:t.y}}else t.y=0}(t,i,e,n,o),i=t}))}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var o=n(1),i=n(13),a=n(2),s=n(0),u=function(t){function e(){return t.apply(this,arguments)||this}var n,o;return o=t,(n=e).prototype=Object.create(o.prototype),n.prototype.constructor=n,r(n,o),e.prototype.execute=function(){return a(this.rootNode,this.options,i)},e}(o),c={};t.exports=function(t,e){return e=s.assign({},c,e),new u(t,e).execute()}},function(t,e,n){var r=n(0);function o(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=o(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function i(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){i(t)}));var r=e[0],o=e[n-1],a=o.y-r.y+o.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),a>t.height)t.y=r.y+a/2-t.height/2;else if(1!==e.length||t.height>s){var u=t.y+(t.height-a)/2-r.y;e.forEach((function(t){t.translate(0,u)}))}else t.y=(r.y+r.height/2+o.y+o.height/2)/2-t.height/2}}var a={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},a,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,o(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o{"use strict";var r=n(96);function o(t,e,n){var o=[0,0,0,0,0,0,0,0,0];return r.mat3.fromTranslation(o,n),r.mat3.multiply(t,o,e)}function i(t,e,n){var o=[0,0,0,0,0,0,0,0,0];return r.mat3.fromRotation(o,n),r.mat3.multiply(t,o,e)}function a(t,e,n){var o=[0,0,0,0,0,0,0,0,0];return r.mat3.fromScaling(o,n),r.mat3.multiply(t,o,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.pd=function(t,e){for(var n,s,u,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],l=0,d=e.length;l{"use strict";n.r(e),n.d(e,{Cache:()=>Ae,assign:()=>Ht,augment:()=>qt,clamp:()=>et,clearAnimationFrame:()=>Vt,clone:()=>Kt,contains:()=>o,debounce:()=>$t,deepMix:()=>te,difference:()=>a,each:()=>h,endsWith:()=>W,every:()=>Y,extend:()=>ee,filter:()=>i,find:()=>y,findIndex:()=>b,firstValue:()=>x,fixedBase:()=>nt,flatten:()=>w,flattenDeep:()=>S,forIn:()=>xt,get:()=>de,getEllipsisText:()=>_e,getRange:()=>_,getType:()=>Nt,getWrapBehavior:()=>K,group:()=>Z,groupBy:()=>H,groupToMap:()=>q,has:()=>wt,hasKey:()=>Et,hasValue:()=>Mt,head:()=>z,identity:()=>we,includes:()=>o,indexOf:()=>ne,isArguments:()=>Pt,isArray:()=>d,isArrayLike:()=>r,isBoolean:()=>Lt,isDate:()=>Dt,isDecimal:()=>ot,isElement:()=>Wt,isEmpty:()=>oe,isEqual:()=>ae,isEqualWith:()=>se,isError:()=>jt,isEven:()=>it,isFinite:()=>Rt,isFunction:()=>c,isInteger:()=>at,isMatch:()=>g,isNegative:()=>st,isNil:()=>l,isNull:()=>Ft,isNumber:()=>rt,isNumberEqual:()=>ct,isObject:()=>f,isObjectLike:()=>v,isOdd:()=>lt,isPlainObject:()=>m,isPositive:()=>dt,isPrototype:()=>zt,isRegExp:()=>Gt,isString:()=>D,isType:()=>u,isUndefined:()=>Ut,keys:()=>p,last:()=>G,lowerCase:()=>_t,lowerFirst:()=>At,map:()=>ue,mapValues:()=>le,max:()=>M,maxBy:()=>ft,measureTextWidth:()=>ke,memoize:()=>Qt,min:()=>k,minBy:()=>ht,mix:()=>Ht,mod:()=>pt,noop:()=>xe,number2color:()=>J,omit:()=>ge,parseRadius:()=>tt,pick:()=>pe,pull:()=>I,pullAt:()=>N,reduce:()=>P,remove:()=>L,requestAnimationFrame:()=>Yt,set:()=>fe,size:()=>Ee,some:()=>V,sortBy:()=>j,startsWith:()=>U,substitute:()=>Ct,throttle:()=>ve,toArray:()=>me,toDegree:()=>vt,toInteger:()=>mt,toRadian:()=>bt,toString:()=>kt,union:()=>F,uniq:()=>R,uniqueId:()=>be,upperCase:()=>Ot,upperFirst:()=>It,values:()=>St,valuesOfKey:()=>B,wrapBehavior:()=>$});const r=function(t){return null!==t&&"function"!==typeof t&&isFinite(t.length)};const o=function(t,e){return!!r(t)&&t.indexOf(e)>-1};const i=function(t,e){if(!r(t))return t;for(var n=[],o=0;o-1;)C.call(t,i,1);return t};var T=Array.prototype.splice;const N=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,o=n-1;n--;){var i=void 0,a=e[n];n!==o&&a===i||(i=a,T.call(t,a,1))}return t};const P=function(t,e,n){if(!d(t)&&!m(t))return t;var r=n;return h(t,(function(t,n){r=e(r,t,n)})),r};const L=function(t,e){var n=[];if(!r(t))return n;for(var o=-1,i=[],a=t.length;++oe[o])return 1;if(t[o]n?n:t};const nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var o=n.substr(r+1).length;return o>20&&(o=20),parseFloat(t.toFixed(o))};const rt=function(t){return u(t,"Number")};const ot=function(t){return rt(t)&&t%1!==0};const it=function(t){return rt(t)&&t%2===0};const at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1===0};const st=function(t){return rt(t)&&t<0};var ut=1e-5;function ct(t,e,n){return void 0===n&&(n=ut),Math.abs(t-e)0},ft=function(t,e){if(d(t)){for(var n,r=-1/0,o=0;or&&(n=i,r=a)}return n}},ht=function(t,e){if(d(t)){for(var n,r=1/0,o=0;oe?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=o=i=null},c},me=function(t){return r(t)?Array.prototype.slice.call(t):[]};var ye={};const be=function(t){return ye[t=t||"g"]?ye[t]+=1:ye[t]=1,t+ye[t]},xe=function(){},we=function(t){return t};function Ee(t){return l(t)?0:r(t)?t.length:Object.keys(t).length}var Se,Me=n(7827);const ke=Qt((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,o=e.fontWeight,i=e.fontStyle,a=e.fontVariant;return Se||(Se=document.createElement("canvas").getContext("2d")),Se.font=[i,a,o,n+"px",r].join(" "),Se.measureText(D(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,Me.__spreadArrays)([t],St(e)).join("")})),_e=function(t,e,n,r){void 0===r&&(r="...");var o,i,a=ke(r,n),s=D(t)?t:kt(t),u=e,c=[];if(ke(t,n)<=e)return t;for(;o=s.substr(0,16),!((i=ke(o,n))+a>u&&i>u);)if(c.push(o),u-=i,!(s=s.substr(16)))return c.join("");for(;o=s.substr(0,1),!((i=ke(o,n))+a>u);)if(c.push(o),u-=i,!(s=s.substr(1)))return c.join("");return""+c.join("")+r};const Ae=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},8665:(t,e,n)=>{var r=n(9317),o={};for(var i in r)r.hasOwnProperty(i)&&(o[r[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,o=t[1]/255,i=t[2]/255,a=Math.min(r,o,i),s=Math.max(r,o,i),u=s-a;return s===a?e=0:r===s?e=(o-i)/u:o===s?e=2+(i-r)/u:i===s&&(e=4+(r-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,o,i,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),l=c-Math.min(a,s,u),d=function(t){return(c-t)/6/l+.5};return 0===l?o=i=0:(i=l/c,e=d(a),n=d(s),r=d(u),a===c?o=r-n:s===c?o=1/3+e-r:u===c&&(o=2/3+n-e),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,o=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-o)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-o-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=o[t];if(e)return e;var n,i,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],l=(i=t,a=c,Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)+Math.pow(i[2]-a[2],2));l.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],o=e[2];return r/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},a.hsl.rgb=function(t){var e,n,r,o,i,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[i=255*u,i,i];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),o=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,i=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,o[c]=255*i;return o},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,o=n,i=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,o*=i<=1?i:2-i,[e,100*(0===r?2*o/(i+o):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,o=Math.floor(e)%6,i=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*i),u=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,o=t[0],i=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-i)*a,n=i*s,[o,100*(n=(n/=(e=(2-i)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,o,i,a,s,u=t[0]/360,c=t[1]/100,l=t[2]/100,d=c+l;switch(d>1&&(c/=d,l/=d),r=6*u-(e=Math.floor(6*u)),0!==(1&e)&&(r=1-r),o=c+r*((n=1-l)-c),e){default:case 6:case 0:i=n,a=o,s=c;break;case 1:i=o,a=n,s=c;break;case 2:i=c,a=n,s=o;break;case 3:i=c,a=o,s=n;break;case 4:i=o,a=c,s=n;break;case 5:i=n,a=c,s=o}return[255*i,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},a.xyz.rgb=function(t){var e,n,r,o=t[0]/100,i=t[1]/100,a=t[2]/100;return n=-.9689*o+1.8758*i+.0415*a,r=.0557*o+-.204*i+1.057*a,e=(e=3.2406*o+-1.5372*i+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,o=t[0];e=t[1]/500+(n=(o+16)/116),r=n-t[2]/200;var i=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=i>.008856?i:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],o=t[2];return(e=360*Math.atan2(o,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+o*o),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],o=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===o&&(i+=60),i},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,o=t[2]/255,i=Math.max(Math.max(n,r),o),a=Math.min(Math.min(n,r),o),s=i-a;return e=s<=0?0:i===n?(r-o)/s%6:i===r?2+(o-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,o=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(o=(n-.5*r)/(1-r)),[t[0],100*r,100*o]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var o,i=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return o=(1-n)*r,[255*(n*i[0]+o),255*(n*i[1]+o),255*(n*i[2]+o)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},6180:(t,e,n)=>{var r=n(8665),o=n(3357),i={};Object.keys(r).forEach((function(t){i[t]={},Object.defineProperty(i[t],"channels",{value:r[t].channels}),Object.defineProperty(i[t],"labels",{value:r[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var r=e[n];i[t][n]=function(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===typeof n)for(var r=n.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=i},9317:t=>{"use strict";t.exports={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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],rebeccapurple:[102,51,153],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]}},3357:(t,e,n)=>{var r=n(8665);function o(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,o=0;o{"use strict";t.exports={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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],rebeccapurple:[102,51,153],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]}},6340:(t,e,n)=>{var r=n(2958),o=n(6122),i=Object.hasOwnProperty,a=Object.create(null);for(var s in r)i.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function c(t,e,n){return Math.min(Math.max(e,t),n)}function l(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,o,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}o&&(a[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);o&&(a[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:i.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=c(a[n],0,255);return a[3]=c(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=o(arguments);return"#"+l(t[0])+l(t[1])+l(t[2])+(t[3]<1?l(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=o(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=o(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=o(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=o(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},922:(t,e,n)=>{"use strict";var r=n(6340),o=n(6180),i=[].slice,a=["keyword","gray","hex"],s={};Object.keys(o).forEach((function(t){s[i.call(o[t].labels).sort().join("")]=t}));var u={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in a&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,l;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"===typeof t){var d=r.get(t);if(null===d)throw new Error("Unable to parse color from string: "+t);this.model=d.model,l=o[this.model].channels,this.color=d.value.slice(0,l),this.valpha="number"===typeof d.value[l]?d.value[l]:1}else if(t.length){this.model=e||"rgb",l=o[this.model].channels;var h=i.call(t,0,l);this.color=f(h,l),this.valpha="number"===typeof t[l]?t[l]:1}else if("number"===typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var p=Object.keys(t);"alpha"in t&&(p.splice(p.indexOf("alpha"),1),this.valpha="number"===typeof t.alpha?t.alpha:0);var g=p.sort().join("");if(!(g in s))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=s[g];var v=o[this.model].labels,m=[];for(n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var n=t.rgb(),r=this.rgb(),o=void 0===e?.5:e,i=2*o-1,a=n.alpha()-r.alpha(),s=((i*a===-1?i:(i+a)/(1+i*a))+1)/2,u=1-s;return c.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue(),n.alpha()*o+r.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===a.indexOf(t)){var e=o[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var n,r="number"===typeof arguments[e]?e:this.valpha;return new c((n=o[this.model][t].raw(this.color),Array.isArray(n)?n:[n]).concat(r),t)},c[t]=function(n){return"number"===typeof n&&(n=f(i.call(arguments),e)),new c(n,t)}}})),t.exports=c},2605:(t,e,n)=>{"use strict";function r(t,e){var n,r=1;function o(){var o,i,a=n.length,s=0,u=0;for(o=0;or,forceCollide:()=>c,forceLink:()=>f,forceManyBody:()=>V,forceRadial:()=>X,forceSimulation:()=>Y,forceX:()=>H,forceY:()=>q});var o=n(8904);function i(t){return function(){return t}}function a(t){return 1e-6*(t()-.5)}function s(t){return t.x+t.vx}function u(t){return t.y+t.vy}function c(t){var e,n,r,c=1,l=1;function d(){for(var t,i,d,h,p,g,v,m=e.length,y=0;yh+l||op+l||id.index){var f=h-s.x-s.vx,m=p-s.y-s.vy,y=f*f+m*m;yt.r&&(t.r=t[e].r)}function h(){if(e){var r,o,i=e.length;for(n=new Array(i),r=0;r[c(t,e,r),t])));for(i=0,o=new Array(u);i{}};function p(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,r,o=new Array(n),i=0;i=0&&e._call.call(null,t),e=e._next;--w}()}finally{w=0,function(){var t,e,n=b,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:b=e);x=t,j(r)}(),_=0}}function D(){var t=C.now(),e=t-k;e>M&&(A-=e,k=t)}function j(t){w||(E&&(E=clearTimeout(E)),t-_>24?(t<1/0&&(E=setTimeout(L,t-C.now()-A)),S&&(S=clearInterval(S))):(S||(k=C.now(),S=setInterval(D,M)),w=1,O(L)))}N.prototype=P.prototype={constructor:N,restart:function(t,e,n){if("function"!==typeof t)throw new TypeError("callback is not a function");n=(null==n?I():+n)+(null==e?0:+e),this._next||x===this||(x?x._next=this:b=this,x=this),this._call=t,this._time=n,j()},stop:function(){this._call&&(this._call=null,this._time=1/0,j())}};const R=1664525,F=1013904223,B=4294967296;function z(t){return t.x}function G(t){return t.y}var U=10,W=Math.PI*(3-Math.sqrt(5));function Y(t){var e,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,s=new Map,u=P(d),c=y("tick","end"),l=function(){let t=1;return()=>(t=(R*t+F)%B)/B}();function d(){f(),c.call("tick",e),n1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var o,i,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function V(){var t,e,n,r,s,u=i(-30),c=1,l=1/0,d=.81;function f(n){var i,a=t.length,s=(0,o.A)(t,z,G).visitAfter(p);for(r=n,i=0;i=l)){(t.data!==e||t.next)&&(0===f&&(g+=(f=a(n))*f),0===h&&(g+=(h=a(n))*h),g{"use strict";n.r(e),n.d(e,{quadtree:()=>r.A});var r=n(8904)},8904:(t,e,n)=>{"use strict";function r(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var o,i,a,s,u,c,l,d,f,h=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(i=(g+m)/2))?g=i:m=i,(l=n>=(a=(v+y)/2))?v=a:y=a,o=h,!(h=h[d=l<<1|c]))return o[d]=p,t;if(s=+t._x.call(null,h.data),u=+t._y.call(null,h.data),e===s&&n===u)return p.next=h,o?o[d]=p:t._root=p,t;do{o=o?o[d]=new Array(4):t._root=new Array(4),(c=e>=(i=(g+m)/2))?g=i:m=i,(l=n>=(a=(v+y)/2))?v=a:y=a}while((d=l<<1|c)===(f=(u>=a)<<1|s>=i));return o[f]=h,o[d]=p,t}function o(t,e,n,r,o){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=o}function i(t){return t[0]}function a(t){return t[1]}function s(t,e,n){var r=new u(null==e?i:e,null==n?a:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function u(t,e,n,r,o,i){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function c(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}n.d(e,{A:()=>s});var l=s.prototype=u.prototype;l.copy=function(){var t,e,n=new u(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=c(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var o=0;o<4;++o)(e=r.source[o])&&(e.length?t.push({source:e,target:r.target[o]=new Array(4)}):r.target[o]=c(e));return n},l.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return r(this.cover(e,n),e,n,t)},l.addAll=function(t){var e,n,o,i,a=t.length,s=new Array(a),u=new Array(a),c=1/0,l=1/0,d=-1/0,f=-1/0;for(n=0;nd&&(d=o),if&&(f=i));if(c>d||l>f)return this;for(this.cover(c,l).cover(d,f),n=0;nt||t>=o||r>e||e>=i;)switch(s=(eh||(a=c.y0)>p||(s=c.x1)=y)<<1|t>=m)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-l],g[g.length-1-l]=c)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),w=b*b+x*x;if(w=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+m)/2))?g=u:m=u,e=h,!(h=h[d=l<<1|c]))return this;if(!h.length)break;(e[d+1&3]||e[d+2&3]||e[d+3&3])&&(n=e,f=d)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(o=h.next)&&delete h.next,r?(o?r.next=o:delete r.next,this):e?(o?e[d]=o:delete e[d],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[f]=h:this._root=h),this):(this._root=o,this)},l.removeAll=function(t){for(var e=0,n=t.length;e{"use strict";n.r(e),n.d(e,{BRIDGE_GRAPH_NAME:()=>s,GraphType:()=>l,HierarchyNodeType:()=>d,InclusionType:()=>c,LAYOUT_CONFIG:()=>r,NodeType:()=>u,ROOT_NAME:()=>a,buildGraph:()=>fa,flatGraph:()=>ha,getEdges:()=>pa,mergeConfig:()=>o});const r={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;var n,o,i,a;const s=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},c=(null===(o=null==t?void 0:t.subScene)||void 0===o?void 0:o.meta)||{},l=(null===(i=null==t?void 0:t.nodeSize)||void 0===i?void 0:i.meta)||{},d=(null===(a=null==t?void 0:t.nodeSize)||void 0===a?void 0:a.node)||{},f=s.nodeSize.bridge;return{graph:{meta:Object.assign(s.graph.meta,u)},subScene:{meta:Object.assign(s.subScene.meta,c)},nodeSize:{meta:Object.assign(s.nodeSize.meta,l),node:Object.assign(s.nodeSize.node,d),bridge:f}}}function i(t){return"\u25ec".concat(t,"\u25ec")}const a=i("ROOT"),s=i("BRIDGE_GRAPH");var u,c,l,d;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(u||(u={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(c||(c={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(l||(l={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(d||(d={}));var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{};function h(t,e){return t(e={exports:{}},e.exports),e.exports}var p=function(t,e){return t===e||t!=t&&e!=e},g=function(t,e){for(var n=t.length;n--;)if(p(t[n][0],e))return n;return-1},v=Array.prototype.splice;function m(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},m.prototype.set=function(t,e){var n=this.__data__,r=g(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var y,b=m,x="object"==typeof f&&f&&f.Object===Object&&f,w="object"==typeof self&&self&&self.Object===Object&&self,E=x||w||Function("return this")(),S=E.Symbol,M=Object.prototype,k=M.hasOwnProperty,_=M.toString,A=S?S.toStringTag:void 0,C=Object.prototype.toString,O=S?S.toStringTag:void 0,I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?function(t){var e=k.call(t,A),n=t[A];try{t[A]=void 0;var r=!0}catch(t){}var o=_.call(t);return r&&(e?t[A]=n:delete t[A]),o}(t):function(t){return C.call(t)}(t)},T=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},N=function(t){if(!T(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},P=E["__core-js_shared__"],L=(y=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",D=Function.prototype.toString,j=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},R=/^\[object .+?Constructor\]$/,F=Function.prototype,B=Object.prototype,z=F.toString,G=B.hasOwnProperty,U=RegExp("^"+z.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=function(t){return!(!T(t)||function(t){return!!L&&L in t}(t))&&(N(t)?U:R).test(j(t))},Y=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return W(n)?n:void 0},V=Y(E,"Map"),X=Y(Object,"create"),H=Object.prototype.hasOwnProperty,q=Object.prototype.hasOwnProperty;function Z(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},xt={};xt["[object Float32Array]"]=xt["[object Float64Array]"]=xt["[object Int8Array]"]=xt["[object Int16Array]"]=xt["[object Int32Array]"]=xt["[object Uint8Array]"]=xt["[object Uint8ClampedArray]"]=xt["[object Uint16Array]"]=xt["[object Uint32Array]"]=!0,xt["[object Arguments]"]=xt["[object Array]"]=xt["[object ArrayBuffer]"]=xt["[object Boolean]"]=xt["[object DataView]"]=xt["[object Date]"]=xt["[object Error]"]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Number]"]=xt["[object Object]"]=xt["[object RegExp]"]=xt["[object Set]"]=xt["[object String]"]=xt["[object WeakMap]"]=!1;var wt=function(t){return function(e){return t(e)}},Et=h((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&x.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),St=Et&&Et.isTypedArray,Mt=St?wt(St):function(t){return ut(t)&&bt(t.length)&&!!xt[I(t)]},kt=Object.prototype.hasOwnProperty,_t=function(t,e){var n=pt(t),r=!n&&ht(t),o=!n&&!r&&vt(t),i=!n&&!r&&!o&&Mt(t),a=n||r||o||i,s=a?function(t,e){for(var n=-1,r=Array(t);++ns))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,h=2&n?new De:void 0;for(i.set(t,e),i.set(e,t);++d0&&r(u)?n>1?t(u,n-1,r,o,i):Vt(i,u):o||(i[i.length]=u)}return i},Zn=Math.max,Kn=function(t,e,n){return e=Zn(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Zn(r.length-e,0),a=Array(i);++o0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}($n),tr=function(t,e){return Jn(Kn(t,e,Oe),t+"")},er=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i-1},or=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r=200){var c=e?null:ir(t);if(c)return ze(c);a=!1,o=Re,u=new De}else u=e?[]:s;t:for(;++ri){var a=o;o=i,i=a}return o+"\x01"+i+"\x01"+(cr.isUndefined(r)?"\0":r)}function gr(t,e){return pr(t,e.v,e.w,e.name)}dr.prototype._nodeCount=0,dr.prototype._edgeCount=0,dr.prototype.isDirected=function(){return this._isDirected},dr.prototype.isMultigraph=function(){return this._isMultigraph},dr.prototype.isCompound=function(){return this._isCompound},dr.prototype.setGraph=function(t){return this._label=t,this},dr.prototype.graph=function(){return this._label},dr.prototype.setDefaultNodeLabel=function(t){return cr.isFunction(t)||(t=cr.constant(t)),this._defaultNodeLabelFn=t,this},dr.prototype.nodeCount=function(){return this._nodeCount},dr.prototype.nodes=function(){return cr.keys(this._nodes)},dr.prototype.sources=function(){var t=this;return cr.filter(this.nodes(),(function(e){return cr.isEmpty(t._in[e])}))},dr.prototype.sinks=function(){var t=this;return cr.filter(this.nodes(),(function(e){return cr.isEmpty(t._out[e])}))},dr.prototype.setNodes=function(t,e){var n=arguments,r=this;return cr.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},dr.prototype.setNode=function(t,e){return cr.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},dr.prototype.node=function(t){return this._nodes[t]},dr.prototype.hasNode=function(t){return cr.has(this._nodes,t)},dr.prototype.removeNode=function(t){var e=this;if(cr.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],cr.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),cr.each(cr.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],cr.each(cr.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},dr.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(cr.isUndefined(e))e="\0";else{for(var n=e+="";!cr.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},dr.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},dr.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},dr.prototype.children=function(t){if(cr.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return cr.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},dr.prototype.predecessors=function(t){var e=this._preds[t];if(e)return cr.keys(e)},dr.prototype.successors=function(t){var e=this._sucs[t];if(e)return cr.keys(e)},dr.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return cr.union(e,this.successors(t))},dr.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},dr.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;cr.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),cr.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function o(t){var i=n.parent(t);return void 0===i||e.hasNode(i)?(r[t]=i,i):i in r?r[i]:o(i)}return this._isCompound&&cr.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},dr.prototype.setDefaultEdgeLabel=function(t){return cr.isFunction(t)||(t=cr.constant(t)),this._defaultEdgeLabelFn=t,this},dr.prototype.edgeCount=function(){return this._edgeCount},dr.prototype.edges=function(){return cr.values(this._edgeObjs)},dr.prototype.setPath=function(t,e){var n=this,r=arguments;return cr.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},dr.prototype.setEdge=function(){var t,e,n,r,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(t=i.v,e=i.w,n=i.name,2===arguments.length&&(r=arguments[1],o=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,cr.isUndefined(n)||(n=""+n);var a=pr(this._isDirected,t,e,n);if(cr.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!cr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(t,e,n);var s=function(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,fr(this._preds[e],t),fr(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},dr.prototype.edge=function(t,e,n){var r=1===arguments.length?gr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n);return this._edgeLabels[r]},dr.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?gr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n);return cr.has(this._edgeLabels,r)},dr.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?gr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n),o=this._edgeObjs[r];return o&&(t=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],hr(this._preds[e],t),hr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},dr.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=cr.values(n);return e?cr.filter(r,(function(t){return t.v===e})):r}},dr.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=cr.values(n);return e?cr.filter(r,(function(t){return t.w===e})):r}},dr.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var vr={Graph:lr,version:"2.1.8"},mr={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yr(t),edges:br(t)};return cr.isUndefined(t.graph())||(e.value=cr.clone(t.graph())),e},read:function(t){var e=new lr(t.options).setGraph(t.value);return cr.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),cr.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function yr(t){return cr.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return cr.isUndefined(n)||(o.value=n),cr.isUndefined(r)||(o.parent=r),o}))}function br(t){return cr.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return cr.isUndefined(e.name)||(r.name=e.name),cr.isUndefined(n)||(r.value=n),r}))}var xr=wr;function wr(){this._arr=[],this._keyIndices={}}wr.prototype.size=function(){return this._arr.length},wr.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},wr.prototype.has=function(t){return cr.has(this._keyIndices,t)},wr.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},wr.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},wr.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!cr.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},wr.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},wr.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},wr.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,o=t;n>1].priority0&&(o=s.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return a}(t,String(e),n||Sr,r||function(e){return t.outEdges(e)})},Sr=cr.constant(1),Mr=function(t){var e=0,n=[],r={},o=[];function i(a){var s=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){cr.has(r,t)?r[t].onStack&&(s.lowlink=Math.min(s.lowlink,r[t].index)):(i(t),s.lowlink=Math.min(s.lowlink,r[t].lowlink))})),s.lowlink===s.index){var u,c=[];do{u=n.pop(),r[u].onStack=!1,c.push(u)}while(a!==u);o.push(c)}}return t.nodes().forEach((function(t){cr.has(r,t)||i(t)})),o},kr=cr.constant(1),_r=Ar;function Ar(t){var e={},n={},r=[];if(cr.each(t.sinks(),(function o(i){if(cr.has(n,i))throw new Cr;cr.has(e,i)||(n[i]=!0,e[i]=!0,cr.each(t.predecessors(i),o),delete n[i],r.push(i))})),cr.size(e)!==t.nodeCount())throw new Cr;return r}function Cr(){}Ar.CycleException=Cr,Cr.prototype=new Error;var Or=function(t,e,n){cr.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],i={};return cr.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Ir(t,e,"post"===n,i,r,o)})),o};function Ir(t,e,n,r,o,i){cr.has(r,e)||(r[e]=!0,n||i.push(e),cr.each(o(e),(function(e){Ir(t,e,n,r,o,i)})),n&&i.push(e))}var Tr,Nr={Graph:vr.Graph,json:mr,alg:{components:function(t){var e,n={},r=[];function o(r){cr.has(n,r)||(n[r]=!0,e.push(r),cr.each(t.successors(r),o),cr.each(t.predecessors(r),o))}return cr.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r},dijkstra:Er,dijkstraAll:function(t,e,n){return cr.transform(t.nodes(),(function(r,o){r[o]=Er(t,o,e,n)}),{})},findCycles:function(t){return cr.filter(Mr(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},o=t.nodes();return o.forEach((function(t){r[t]={},r[t][t]={distance:0},o.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var o=n.v===t?n.w:n.v,i=e(n);r[t][o]={distance:i,predecessor:t}}))})),o.forEach((function(t){var e=r[t];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[t],o=e[n],a=i[n],s=r.distance+o.distance;s0;){if(n=i.removeMin(),cr.has(o,n))r.setEdge(n,o[n]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Mr,topsort:_r},version:vr.version};try{Tr=Nr}catch(r){}Tr||(Tr=window.graphlib);var Pr,Lr=Tr,Dr=function(t,e,n){if(!T(n))return!1;var r=typeof e;return!!("number"==r?Pt(n)&&yt(e,n.length):"string"==r&&e in n)&&p(n[e],t)},jr=Object.prototype,Rr=jr.hasOwnProperty,Fr=tr((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&Dr(e[0],e[1],o)&&(r=1);++n-1?o[i?e[a]:a]:void 0}}((function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:function(t){var e=Yr(t),n=e%1;return e==e?n?e-n:e:0}(n);return o<0&&(o=Vr(r+o,0)),er(t,En(e),o)})),Hr=function(t){return null!=t&&t.length?qn(t,1):[]},qr=function(t,e,n){for(var r=-1,o=t.length;++re},Kr=function(t,e,n){(void 0!==n&&!p(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)},$r=Function.prototype,Qr=Object.prototype,Jr=$r.toString,to=Qr.hasOwnProperty,eo=Jr.call(Object),no=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ro=function(t,e,n,r,o,i,a){var s=no(t,n),u=no(e,n),c=a.get(u);if(c)Kr(t,n,c);else{var l=i?i(s,u,n+"",t,e,a):void 0,d=void 0===l;if(d){var f=pt(u),h=!f&&vt(u),p=!f&&!h&&Mt(u);l=u,f||h||p?pt(s)?l=s:ar(s)?l=Bt(s):h?(d=!1,l=Ft(u,!0)):p?(d=!1,l=pe(u,!0)):l=[]:function(t){if(!ut(t)||"[object Object]"!=I(t))return!1;var e=Xt(t);if(null===e)return!0;var n=to.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Jr.call(n)==eo}(u)||ht(u)?(l=s,ht(s)?l=function(t){return st(t,Rt(t))}(s):T(s)&&!N(s)||(l=ye(u))):d=!1}d&&(a.set(u,l),o(l,u,r,i,a),a.delete(u)),Kr(t,n,l)}},oo=function t(e,n,r,o,i){e!==n&&_e(n,(function(a,s){if(i||(i=new et),T(a))ro(e,n,s,r,t,o,i);else{var u=o?o(no(e,s),a,s+"",e,n,i):void 0;void 0===u&&(u=a),Kr(e,s,u)}}),Rt)},io=function(t){return tr((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&Dr(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++re||i&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!c&&t=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))},vo=tr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Dr(t,e[0],e[1])?e=[]:n>2&&Dr(e[0],e[1],e[2])&&(e=[e[0]]),go(t,qn(e,1),[])})),mo=0;try{Pr={cloneDeep:function(t){return Me(t,5)},constant:ke,defaults:Fr,each:Ne,filter:Sn,find:Xr,flatten:Hr,forEach:Te,forIn:function(t,e){return null==t?t:_e(t,Ie(e),Rt)},has:_n,isUndefined:Cn,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:In,mapValues:function(t,e){var n={};return e=En(e),Ae(t,(function(t,r,o){ot(n,r,e(t,r,o))})),n},max:function(t){return t&&t.length?qr(t,Oe,Zr):void 0},merge:io,min:function(t){return t&&t.length?qr(t,Oe,ao):void 0},minBy:function(t,e){return t&&t.length?qr(t,En(e),ao):void 0},now:function(){return E.Date.now()},pick:co,range:ho,reduce:Pn,sortBy:vo,uniqueId:function(t){var e=++mo;return fn(t)+e},values:ur,zipObject:function(t,e){return function(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r0;--s)if(r=e[s].dequeue()){o=o.concat(ko(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return yo.flatten(yo.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return yo.forEach(t.nodes(),(function o(i){yo.has(r,i)||(r[i]=!0,n[i]=!0,yo.forEach(t.outEdges(i),(function(t){yo.has(n,t.w)?e.push(t):o(t.w)})),delete n[i])})),e}(t);yo.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,yo.uniqueId("rev"))}))},Co=function(t){yo.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))},Oo=Lr.Graph,Io={addDummyNode:To,simplify:function(t){var e=(new Oo).setGraph(t.graph());return yo.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),yo.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Oo({multigraph:t.isMultigraph()}).setGraph(t.graph());return yo.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),yo.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=yo.map(t.nodes(),(function(e){var n={};return yo.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return yo.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=yo.map(t.nodes(),(function(e){var n={};return yo.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return yo.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,o=t.x,i=t.y,a=e.x-o,s=e.y-i,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}},buildLayerMatrix:function(t){var e=yo.map(yo.range(No(t)+1),(function(){return[]}));return yo.forEach(t.nodes(),(function(n){var r=t.node(n),o=r.rank;yo.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=yo.min(yo.map(t.nodes(),(function(e){return t.node(e).rank})));yo.forEach(t.nodes(),(function(n){var r=t.node(n);yo.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=yo.min(yo.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];yo.forEach(t.nodes(),(function(r){var o=t.node(r).rank-e;n[o]||(n[o]=[]),n[o].push(r)}));var r=0,o=t.graph().nodeRankFactor;yo.forEach(n,(function(e,n){yo.isUndefined(e)&&n%o!=0?--r:r&&yo.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),To(t,"border",o,e)},maxRank:No,partition:function(t,e){var n={lhs:[],rhs:[]};return yo.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=yo.now();try{return e()}finally{console.log(t+" time: "+(yo.now()-n)+"ms")}},notime:function(t,e){return e()}};function To(t,e,n,r){var o;do{o=yo.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function No(t){return yo.max(yo.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!yo.isUndefined(n))return n})))}var Po=function(t){t.graph().dummyChains=[],yo.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,i=e.v,a=t.node(i).rank,s=e.w,u=t.node(s).rank,c=e.name,l=t.edge(e),d=l.labelRank;if(u!==a+1){for(t.removeEdge(e),o=0,++a;aa.lim&&(s=a,u=!0);var c=yo.filter(e.edges(),(function(e){return u===ri(t,t.node(e.v),s)&&u!==ri(t,t.node(e.w),s)}));return yo.minBy(c,(function(t){return Wo(e,t)}))}function ni(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Qo(t),Ko(t,e),function(t,e){var n=yo.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Vo(t,n);r=r.slice(1),yo.forEach(r,(function(n){var r=t.node(n).parent,o=e.edge(n,r),i=!1;o||(o=e.edge(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(t,e)}function ri(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Zo.initLowLimValues=Qo,Zo.initCutValues=Ko,Zo.calcCutValue=$o,Zo.leaveEdge=ti,Zo.enterEdge=ei,Zo.exchangeEdges=ni;var oi=Do,ii=oi;function ai(t){qo(t)}var si=function(t){var e=Io.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,o){var i=t.children(r);i&&i.length&&yo.forEach(i,(function(t){n(t,o+1)})),e[r]=o}return yo.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=yo.max(yo.values(n))-1,o=2*r+1;t.graph().nestingRoot=e,yo.forEach(t.edges(),(function(e){t.edge(e).minlen*=o}));var i=function(t){return yo.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;yo.forEach(t.children(),(function(a){ci(t,e,o,i,r,n,a)})),t.graph().nodeRankFactor=o},ui=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,yo.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))};function ci(t,e,n,r,o,i,a){var s=t.children(a);if(s.length){var u=Io.addBorderNode(t,"_bt"),c=Io.addBorderNode(t,"_bb"),l=t.node(a);t.setParent(u,a),l.borderTop=u,t.setParent(c,a),l.borderBottom=c,yo.forEach(s,(function(s){ci(t,e,n,r,o,i,s);var l=t.node(s),d=l.borderTop?l.borderTop:s,f=l.borderBottom?l.borderBottom:s,h=l.borderTop?r:2*r,p=d!==f?1:o-i[a]+1;t.setEdge(u,d,{weight:h,minlen:p,nestingEdge:!0}),t.setEdge(f,c,{weight:h,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,u,{weight:0,minlen:o+i[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function li(t,e,n,r,o,i){var a={width:0,height:0,rank:i,borderType:e},s=o[e][i-1],u=Io.addDummyNode(t,"border",a,n);o[e][i]=u,t.setParent(u,r),s&&t.setEdge(s,u,{weight:1})}var di=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||hi(t)},fi=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){yo.forEach(t.nodes(),(function(e){gi(t.node(e))})),yo.forEach(t.edges(),(function(e){var n=t.edge(e);yo.forEach(n.points,gi),yo.has(n,"y")&&gi(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){yo.forEach(t.nodes(),(function(e){vi(t.node(e))})),yo.forEach(t.edges(),(function(e){var n=t.edge(e);yo.forEach(n.points,vi),yo.has(n,"x")&&vi(n)}))}(t),hi(t))};function hi(t){yo.forEach(t.nodes(),(function(e){pi(t.node(e))})),yo.forEach(t.edges(),(function(e){pi(t.edge(e))}))}function pi(t){var e=t.width;t.width=t.height,t.height=e}function gi(t){t.y=-t.y}function vi(t){var e=t.x;t.x=t.y,t.y=e}var mi=function(t,e){for(var n=0,r=1;r0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*n}))),u}function bi(t,e,n){for(var r;e.length&&(r=yo.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var xi=function t(e,n,r,o){var i=e.children(n),a=e.node(n),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,c={};s&&(i=yo.filter(i,(function(t){return t!==s&&t!==u})));var l=function(t,e){return yo.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=yo.reduce(n,(function(e,n){var r=t.edge(n),o=t.node(n.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);yo.forEach(l,(function(n){if(e.children(n.v).length){var i=t(e,n.v,r,o);c[n.v]=i,yo.has(i,"barycenter")&&(a=n,s=i,yo.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s}));var d=function(t,e){var n={};return yo.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};yo.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),yo.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];yo.isUndefined(e)||yo.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(yo.isUndefined(e.barycenter)||yo.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),yo.forEach(o.in.reverse(),n(o)),yo.forEach(o.out,r(o))}return yo.map(yo.filter(e,(function(t){return!t.merged})),(function(t){return yo.pick(t,["vs","i","barycenter","weight"])}))}(yo.filter(n,(function(t){return!t.indegree})))}(l,r);!function(t,e){yo.forEach(t,(function(t){t.vs=yo.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(d,c);var f=function(t,e){var n,r=Io.partition(t,(function(t){return yo.has(t,"barycenter")})),o=r.lhs,i=yo.sortBy(r.rhs,(function(t){return-t.i})),a=[],s=0,u=0,c=0;o.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),c=bi(a,i,c),yo.forEach(o,(function(t){c+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,c=bi(a,i,c)}));var l={vs:yo.flatten(a,!0)};return u&&(l.barycenter=s/u,l.weight=u),l}(d,o);if(s&&(f.vs=yo.flatten([s,f.vs,u],!0),e.predecessors(s).length)){var h=e.node(e.predecessors(s)[0]),p=e.node(e.predecessors(u)[0]);yo.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+p.order)/(f.weight+2),f.weight+=2}return f},wi=Lr.Graph,Ei=Lr.Graph,Si=function(t){var e=Io.maxRank(t),n=Mi(t,yo.range(1,e+1),"inEdges"),r=Mi(t,yo.range(e-1,-1,-1),"outEdges"),o=function(t){var e={},n=yo.filter(t.nodes(),(function(e){return!t.children(e).length})),r=yo.max(yo.map(n,(function(e){return t.node(e).rank}))),o=yo.map(yo.range(r+1),(function(){return[]})),i=yo.sortBy(n,(function(e){return t.node(e).rank}));return yo.forEach(i,(function n(r){if(!yo.has(e,r)){e[r]=!0;var i=t.node(r);o[i.rank].push(r),yo.forEach(t.successors(r),n)}})),o}(t);_i(t,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){ki(s%2?n:r,s%4>=2),o=Io.buildLayerMatrix(t);var c=mi(t,o);cn){var r=e;e=n,n=r}var o=t[e];o||(t[e]=o={}),o[n]=!0}function Oi(t,e,n){if(e>n){var r=e;e=n,n=r}return yo.has(t[e],n)}var Ii=function(t){var e,n=Io.buildLayerMatrix(t),r=yo.merge(function(t,e){var n={};return yo.reduce(e,(function(e,r){var o=0,i=0,a=e.length,s=yo.last(r);return yo.forEach(r,(function(e,u){var c=function(t,e){if(t.node(e).dummy)return yo.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),l=c?t.node(c).order:a;(c||e===s)&&(yo.forEach(r.slice(i,u+1),(function(e){yo.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(aa)&&Ci(n,e,s)}))}))}return yo.reduce(e,(function(e,n){var o,i=-1,a=0;return yo.forEach(n,(function(s,u){if("border"===t.node(s).dummy){var c=t.predecessors(s);c.length&&(o=t.node(c[0]).order,r(n,a,u,i,o),a=u,i=o)}r(n,a,n.length,o,e.length)})),n})),n}(t,n)),o={};yo.forEach(["u","d"],(function(i){e="u"===i?n:yo.values(n).reverse(),yo.forEach(["l","r"],(function(n){"r"===n&&(e=yo.map(e,(function(t){return yo.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),s=function(t,e,n,r){var o={},i={},a={};return yo.forEach(e,(function(t){yo.forEach(t,(function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),yo.forEach(e,(function(t){var e=-1;yo.forEach(t,(function(t){var s=r(t);if(s.length)for(var u=((s=yo.sortBy(s,(function(t){return a[t]}))).length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var d=s[c];i[t]===t&&eu||c>e[o].lim));for(i=o,o=r;(o=t.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(t,e,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;n!==o.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRank1&&void 0!==arguments[1]?arguments[1]:{};this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=c.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=u.META,this.path=[],this.name=t,this.metaGraph=ea(t,l.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((t=>this.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class Qi{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function Ji(t){return new $i(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function ta(t,e){return new Qi(t,e)}function ea(t,e,n){const r=n||{},o=new Hi.Graph(r);return o.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),o}class na{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Ji(a,this.graphOptions),this.index[a]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=ea(s,l.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const o=e.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const o=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[i,a]=o?[e.w,n.v]:[e.v,n.w],s=this.getChildName(t,i),u={v:o?a:s,w:o?s:a};let c=r.edge(u);c||(c=ta(u.v,u.w),c.inbound=o,r.setEdge(u.v,u.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,o=r.metaGraph,i=this.getBridgeGraph(r.name);return ra(o,t,e,n),ra(i,t,e,n),n}}function ra(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class oa{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new sa(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==u.META)return;const n=e,r=n.node.metaGraph,o=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);o.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new aa(e);o.setEdge(t.v,t.w,n)}));const i=n.node.parentNode;if(!i)return;const a=this.getRenderNodeByName(i.name),s=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{const n=l.edge(e),d=!!r.node(e.w),[f,h]=d?[e.w,e.v]:[e.v,e.w],p=e=>{const n=d?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let g=p(h);g||(g=p(s(d,h,i.name)));const v=s(d,t),m=s(d,h,t);let y=o.node(m);if(!y){let t=o.node(v);if(!t){const e={name:v,type:u.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:c.UNSPECIFIED,inbound:d,attr:{}};t=new ia(e),this.index[v]=t,o.setNode(v,t)}const e={name:m,type:u.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:c.UNSPECIFIED,inbound:d,attr:{}};y=new ia(e),this.index[m]=y,o.setNode(m,y),o.setParent(m,v),t.node.cardinality++}const b=new aa(n);b.adjoiningMetaEdge=g,d?o.setEdge(m,f,b):o.setEdge(f,m,b)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new sa(e,this.hierarchy.graphOptions):new ia(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class ia{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class aa{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class sa extends ia{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=ea(n.name,l.CORE,e)}}function ua(t,e){t.node.isGroupNode&&function(t,e){const n=o(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,o,i,a,s,c;const{height:l,width:d}=t;switch(t.node.type){case u.NODE:Object.assign(t,n.nodeSize.node),t.height=l||n.nodeSize.node.height,t.width=d||n.nodeSize.node.width;break;case u.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case u.META:t.expanded?ua(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e="".concat(t.displayName).length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(o=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===o?void 0:o.width)||1===t.node.type&&(!!(null===(a=null===(i=null==e?void 0:e.nodeSize)||void 0===i?void 0:i.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(c=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===c?void 0:c.width)))}}))}(t,e),t.node.type===u.META&&function(t,e){const n=o(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:i,rankSep:a,edgeSep:s,align:c}=n.graph.meta,l={nodesep:i,ranksep:a,edgesep:s,align:c};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:o,align:i}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:o,align:i});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==u.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};qi(t);let s=1/0,c=1/0,l=-1/0,d=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,o=n.x-r,i=n.x+r;s=ol?i:l;const a=.5*n.height,u=n.y-a,f=n.y+a;c=ud?f:d})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),o=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=ca(t[0],t[1]);for(let n=1;n1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:la(r);n.points[0].x=t}if(null!=o){const t=o.expanded?o.x:la(o);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const i=n.points[n.points.length-2];null!=o&&(n.points[n.points.length-1]=da(i,o));const a=n.points[1];null!=r&&(n.points[0]=da(a,r)),n.points.forEach((t=>{s=t.xl?t.x:l,c=t.yd?t.y:d}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=s,n.y-=c})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=s,t.y-=c}))})),{width:l-s,height:d-c}}(t.coreGraph,l));let d=0;t.coreGraph.nodeCount()>0&&d++;const f=d<=1?0:d;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function ca(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function la(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function da(t,e){const n=e.expanded?e.x:la(e),r=e.y,o=t.x-n,i=t.y-r;let a,s,u=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(i)*u/2>Math.abs(o)*c/2?(i<0&&(c=-c),a=0===i?0:c/2*o/i,s=c/2):(o<0&&(u=-u),a=u/2,s=0===o?0:u/2*i/o),{x:n+a,y:r+s}}function fa(t,e,n){var o,i,a,s;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error("Duplicated ids found: ".concat(u.join(", ")));const c=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),o=new Map,i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(o.has(t))return o.get(t);for(let o=0;ot.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...i(n),n];let o=a(n);e.nodes.push({name:n,path:r,inputs:o,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),l=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0===Object.keys(t).length)return[...new Set(e)];const o=new Map(Object.keys(t).map((e=>[e,t[e]]))),i={};for(let[r,a]of o)n(r,o)?i[r]=a:e=e.concat(r,a);return r(i,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),d=function(t,e){return function(t){return new oa(t)}(function(t,e){const{rankDirection:n,align:r}=e,o=new na({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],o=r.path;let i=t.root;i.depth=Math.max(o.length,i.depth);for(let e=0;e{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],o=[];let s=i(e.nodes[a.v],r),u=i(e.nodes[a.w],o);for(;r[s]===o[u];)if(s--,u--,s<0||u<0)throw Error("No difference found between ancestor paths.");const c=n[r[s+1]],l=r[s],d=o[u];let f=c.metaGraph.edge(l,d);f||(f=ta(l,d),c.metaGraph.setEdge(l,d,f)),f.addBaseEdge(a,t)}))}(o,t),o}(function(t){const e=new Ki;return t.nodes.map((t=>new Zi(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(c,{rankDirection:(null===(i=null===(o=null==n?void 0:n.graph)||void 0===o?void 0:o.meta)||void 0===i?void 0:i.rankDir)||(null==e?void 0:e.rankDirection)||r.graph.meta.rankDir,align:(null===(s=null===(a=null==n?void 0:n.graph)||void 0===a?void 0:a.meta)||void 0===s?void 0:s.align)||r.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const o=t.getRenderNodeByName(r);if(!o)throw new Error("No nodes found: ".concat(r));o.expanded=!0,t.buildSubHierarchy(r)}))}(d,l),ua(d.root,n),ga(d.root)}function ha(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==a&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}function pa(t,e,n,r){var o,i;let s=[];const u=(null===(o=n.find((e=>e.id===t)))||void 0===o?void 0:o.path)||[],c=(null===(i=n.find((t=>t.id===e)))||void 0===i?void 0:i.path)||[],l=[a,...u].slice(0,u.length).reverse(),d=[a,...c].slice(0,c.length);return l.forEach((o=>{const i=n.find((t=>t.id===o));s=s.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),d.filter((t=>!l.includes(t))).forEach((o=>{const i=n.find((t=>t.id===o));s=s.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),s}function ga(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},va(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===u.META?ga(t):va(t)))):[],edges:t.expanded?ma(t):[]});var n}function va(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function ma(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((t=>{let{renderInfoEdge:e}=t;return e.metaEdge})).map((e=>{let{edge:n,renderInfoEdge:r}=e;const o=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,o=e.metaEdge.inbound,i=o?r[r.length-1]:r[0],a=n[o?0:n.length-1],s=t.x-t.width/2,u=t.y-t.height/2,c=i.x-s,l=i.y-u,d=-t.paddingLeft,f=-(t.paddingTop+t.labelHeight);a.x=c+d,a.y=l+f}return n}(t,r);return{adjoiningEdge:r.adjoiningMetaEdge?{w:r.adjoiningMetaEdge.metaEdge.w,v:r.adjoiningMetaEdge.metaEdge.v}:null,inbound:r.metaEdge.inbound,w:n.w,v:n.v,points:o,weight:r.weight,baseEdgeList:r.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}},1857:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ARRAY_TYPE:()=>o,EPSILON:()=>r,RANDOM:()=>i,equals:()=>c,setMatrixArrayType:()=>a,toRadian:()=>u});var r=1e-6,o="undefined"!==typeof Float32Array?Float32Array:Array,i=Math.random;function a(t){o=t}var s=Math.PI/180;function u(t){return t*s}function c(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},96:(t,e,n)=>{"use strict";n.r(e),n.d(e,{glMatrix:()=>c,mat2:()=>r,mat2d:()=>o,mat3:()=>st,mat4:()=>i,quat:()=>s,quat2:()=>u,vec2:()=>yr,vec3:()=>ie,vec4:()=>a});var r={};n.r(r),n.d(r,{LDU:()=>A,add:()=>C,adjoint:()=>y,clone:()=>d,copy:()=>f,create:()=>l,determinant:()=>b,equals:()=>T,exactEquals:()=>I,frob:()=>_,fromRotation:()=>S,fromScaling:()=>M,fromValues:()=>p,identity:()=>h,invert:()=>m,mul:()=>L,multiply:()=>x,multiplyScalar:()=>N,multiplyScalarAndAdd:()=>P,rotate:()=>w,scale:()=>E,set:()=>g,str:()=>k,sub:()=>D,subtract:()=>O,transpose:()=>v});var o={};n.r(o),n.d(o,{add:()=>J,clone:()=>R,copy:()=>F,create:()=>j,determinant:()=>W,equals:()=>ot,exactEquals:()=>rt,frob:()=>Q,fromRotation:()=>q,fromScaling:()=>Z,fromTranslation:()=>K,fromValues:()=>z,identity:()=>B,invert:()=>U,mul:()=>it,multiply:()=>Y,multiplyScalar:()=>et,multiplyScalarAndAdd:()=>nt,rotate:()=>V,scale:()=>X,set:()=>G,str:()=>$,sub:()=>at,subtract:()=>tt,translate:()=>H});var i={};n.r(i),n.d(i,{add:()=>$t,adjoint:()=>vt,clone:()=>ct,copy:()=>lt,create:()=>ut,determinant:()=>mt,equals:()=>ne,exactEquals:()=>ee,frob:()=>Kt,fromQuat:()=>Ft,fromQuat2:()=>Nt,fromRotation:()=>At,fromRotationTranslation:()=>Tt,fromRotationTranslationScale:()=>jt,fromRotationTranslationScaleOrigin:()=>Rt,fromScaling:()=>_t,fromTranslation:()=>kt,fromValues:()=>dt,fromXRotation:()=>Ct,fromYRotation:()=>Ot,fromZRotation:()=>It,frustum:()=>Bt,getRotation:()=>Dt,getScaling:()=>Lt,getTranslation:()=>Pt,identity:()=>ht,invert:()=>gt,lookAt:()=>Ht,mul:()=>re,multiply:()=>yt,multiplyScalar:()=>Jt,multiplyScalarAndAdd:()=>te,ortho:()=>Vt,orthoNO:()=>Yt,orthoZO:()=>Xt,perspective:()=>Gt,perspectiveFromFieldOfView:()=>Wt,perspectiveNO:()=>zt,perspectiveZO:()=>Ut,rotate:()=>wt,rotateX:()=>Et,rotateY:()=>St,rotateZ:()=>Mt,scale:()=>xt,set:()=>ft,str:()=>Zt,sub:()=>oe,subtract:()=>Qt,targetTo:()=>qt,translate:()=>bt,transpose:()=>pt});var a={};n.r(a),n.d(a,{add:()=>de,ceil:()=>ge,clone:()=>se,copy:()=>ce,create:()=>ae,cross:()=>Ie,dist:()=>Ue,distance:()=>Ee,div:()=>Ge,divide:()=>pe,dot:()=>Oe,equals:()=>Fe,exactEquals:()=>Re,floor:()=>ve,forEach:()=>Xe,fromValues:()=>ue,inverse:()=>Ae,len:()=>Ye,length:()=>Me,lerp:()=>Te,max:()=>ye,min:()=>me,mul:()=>ze,multiply:()=>he,negate:()=>_e,normalize:()=>Ce,random:()=>Ne,round:()=>be,scale:()=>xe,scaleAndAdd:()=>we,set:()=>le,sqrDist:()=>We,sqrLen:()=>Ve,squaredDistance:()=>Se,squaredLength:()=>ke,str:()=>je,sub:()=>Be,subtract:()=>fe,transformMat4:()=>Pe,transformQuat:()=>Le,zero:()=>De});var s={};n.r(s),n.d(s,{add:()=>yn,calculateW:()=>nn,clone:()=>pn,conjugate:()=>ln,copy:()=>vn,create:()=>He,dot:()=>wn,equals:()=>On,exactEquals:()=>Cn,exp:()=>rn,fromEuler:()=>fn,fromMat3:()=>dn,fromValues:()=>gn,getAngle:()=>$e,getAxisAngle:()=>Ke,identity:()=>qe,invert:()=>cn,len:()=>Mn,length:()=>Sn,lerp:()=>En,ln:()=>on,mul:()=>bn,multiply:()=>Qe,normalize:()=>An,pow:()=>an,random:()=>un,rotateX:()=>Je,rotateY:()=>tn,rotateZ:()=>en,rotationTo:()=>In,scale:()=>xn,set:()=>mn,setAxes:()=>Nn,setAxisAngle:()=>Ze,slerp:()=>sn,sqlerp:()=>Tn,sqrLen:()=>_n,squaredLength:()=>kn,str:()=>hn});var u={};n.r(u),n.d(u,{add:()=>nr,clone:()=>Ln,conjugate:()=>cr,copy:()=>Gn,create:()=>Pn,dot:()=>ar,equals:()=>mr,exactEquals:()=>vr,fromMat4:()=>zn,fromRotation:()=>Bn,fromRotationTranslation:()=>Rn,fromRotationTranslationValues:()=>jn,fromTranslation:()=>Fn,fromValues:()=>Dn,getDual:()=>Vn,getReal:()=>Yn,getTranslation:()=>qn,identity:()=>Un,invert:()=>ur,len:()=>dr,length:()=>lr,lerp:()=>sr,mul:()=>or,multiply:()=>rr,normalize:()=>pr,rotateAroundAxis:()=>er,rotateByQuatAppend:()=>Jn,rotateByQuatPrepend:()=>tr,rotateX:()=>Kn,rotateY:()=>$n,rotateZ:()=>Qn,scale:()=>ir,set:()=>Wn,setDual:()=>Hn,setReal:()=>Xn,sqrLen:()=>hr,squaredLength:()=>fr,str:()=>gr,translate:()=>Zn});var c=n(1857);function l(){var t=new c.ARRAY_TYPE(4);return c.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function d(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function p(t,e,n,r){var o=new c.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function g(t,e,n,r,o){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t}function v(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function m(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*i-o*r;return a?(a=1/a,t[0]=i*a,t[1]=-r*a,t[2]=-o*a,t[3]=n*a,t):null}function y(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function x(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*s+i*u,t[1]=o*s+a*u,t[2]=r*c+i*l,t[3]=o*c+a*l,t}function w(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=o*u+a*s,t[2]=r*-s+i*u,t[3]=o*-s+a*u,t}function E(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=n[0],u=n[1];return t[0]=r*s,t[1]=o*s,t[2]=i*u,t[3]=a*u,t}function S(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function k(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function _(t){return Math.hypot(t[0],t[1],t[2],t[3])}function A(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]}function C(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function O(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function I(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function T(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=e[0],s=e[1],u=e[2],l=e[3];return Math.abs(n-a)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-u)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(i-l)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}function N(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function P(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}var L=x,D=O;function j(){var t=new c.ARRAY_TYPE(6);return c.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function R(t){var e=new c.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function B(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function z(t,e,n,r,o,i){var a=new c.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=o,a[5]=i,a}function G(t,e,n,r,o,i,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t}function U(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=n*i-r*o;return u?(u=1/u,t[0]=i*u,t[1]=-r*u,t[2]=-o*u,t[3]=n*u,t[4]=(o*s-i*a)*u,t[5]=(r*a-n*s)*u,t):null}function W(t){return t[0]*t[3]-t[1]*t[2]}function Y(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1],d=n[2],f=n[3],h=n[4],p=n[5];return t[0]=r*c+i*l,t[1]=o*c+a*l,t[2]=r*d+i*f,t[3]=o*d+a*f,t[4]=r*h+i*p+s,t[5]=o*h+a*p+u,t}function V(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=Math.sin(n),l=Math.cos(n);return t[0]=r*l+i*c,t[1]=o*l+a*c,t[2]=r*-c+i*l,t[3]=o*-c+a*l,t[4]=s,t[5]=u,t}function X(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r*c,t[1]=o*c,t[2]=i*l,t[3]=a*l,t[4]=s,t[5]=u,t}function H(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=r*c+i*l+s,t[5]=o*c+a*l+u,t}function q(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t}function Z(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function $(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Q(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function J(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t}function tt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}function et(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t}function nt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t}function rt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function ot(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=t[5],u=e[0],l=e[1],d=e[2],f=e[3],h=e[4],p=e[5];return Math.abs(n-u)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(r-l)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-d)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(i-f)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-h)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(s-p)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))}var it=Y,at=tt,st=n(5367);function ut(){var t=new c.ARRAY_TYPE(16);return c.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ct(t){var e=new c.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function dt(t,e,n,r,o,i,a,s,u,l,d,f,h,p,g,v){var m=new c.ARRAY_TYPE(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=o,m[5]=i,m[6]=a,m[7]=s,m[8]=u,m[9]=l,m[10]=d,m[11]=f,m[12]=h,m[13]=p,m[14]=g,m[15]=v,m}function ft(t,e,n,r,o,i,a,s,u,c,l,d,f,h,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=d,t[11]=f,t[12]=h,t[13]=p,t[14]=g,t[15]=v,t}function ht(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pt(t,e){if(t===e){var n=e[1],r=e[2],o=e[3],i=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[11]=e[14],t[12]=o,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gt(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],d=e[9],f=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-o*a,x=n*c-i*a,w=r*u-o*s,E=r*c-i*s,S=o*c-i*u,M=l*g-d*p,k=l*v-f*p,_=l*m-h*p,A=d*v-f*g,C=d*m-h*g,O=f*m-h*v,I=y*O-b*C+x*A+w*_-E*k+S*M;return I?(I=1/I,t[0]=(s*O-u*C+c*A)*I,t[1]=(o*C-r*O-i*A)*I,t[2]=(g*S-v*E+m*w)*I,t[3]=(f*E-d*S-h*w)*I,t[4]=(u*_-a*O-c*k)*I,t[5]=(n*O-o*_+i*k)*I,t[6]=(v*x-p*S-m*b)*I,t[7]=(l*S-f*x+h*b)*I,t[8]=(a*C-s*_+c*M)*I,t[9]=(r*_-n*C-i*M)*I,t[10]=(p*E-g*x+m*y)*I,t[11]=(d*x-l*E-h*y)*I,t[12]=(s*k-a*A-u*M)*I,t[13]=(n*A-r*k+o*M)*I,t[14]=(g*b-p*w-v*y)*I,t[15]=(l*w-d*b+f*y)*I,t):null}function vt(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],d=e[9],f=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(f*m-h*v)-d*(u*m-c*v)+g*(u*h-c*f),t[1]=-(r*(f*m-h*v)-d*(o*m-i*v)+g*(o*h-i*f)),t[2]=r*(u*m-c*v)-s*(o*m-i*v)+g*(o*c-i*u),t[3]=-(r*(u*h-c*f)-s*(o*h-i*f)+d*(o*c-i*u)),t[4]=-(a*(f*m-h*v)-l*(u*m-c*v)+p*(u*h-c*f)),t[5]=n*(f*m-h*v)-l*(o*m-i*v)+p*(o*h-i*f),t[6]=-(n*(u*m-c*v)-a*(o*m-i*v)+p*(o*c-i*u)),t[7]=n*(u*h-c*f)-a*(o*h-i*f)+l*(o*c-i*u),t[8]=a*(d*m-h*g)-l*(s*m-c*g)+p*(s*h-c*d),t[9]=-(n*(d*m-h*g)-l*(r*m-i*g)+p*(r*h-i*d)),t[10]=n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s),t[11]=-(n*(s*h-c*d)-a*(r*h-i*d)+l*(r*c-i*s)),t[12]=-(a*(d*v-f*g)-l*(s*v-u*g)+p*(s*f-u*d)),t[13]=n*(d*v-f*g)-l*(r*v-o*g)+p*(r*f-o*d),t[14]=-(n*(s*v-u*g)-a*(r*v-o*g)+p*(r*u-o*s)),t[15]=n*(s*f-u*d)-a*(r*f-o*d)+l*(r*u-o*s),t}function mt(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],d=t[10],f=t[11],h=t[12],p=t[13],g=t[14],v=t[15];return(e*a-n*i)*(d*v-f*g)-(e*s-r*i)*(l*v-f*p)+(e*u-o*i)*(l*g-d*p)+(n*s-r*a)*(c*v-f*h)-(n*u-o*a)*(c*g-d*h)+(r*u-o*s)*(c*p-l*h)}function yt(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],h=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],E=n[3];return t[0]=b*r+x*s+w*d+E*g,t[1]=b*o+x*u+w*f+E*v,t[2]=b*i+x*c+w*h+E*m,t[3]=b*a+x*l+w*p+E*y,b=n[4],x=n[5],w=n[6],E=n[7],t[4]=b*r+x*s+w*d+E*g,t[5]=b*o+x*u+w*f+E*v,t[6]=b*i+x*c+w*h+E*m,t[7]=b*a+x*l+w*p+E*y,b=n[8],x=n[9],w=n[10],E=n[11],t[8]=b*r+x*s+w*d+E*g,t[9]=b*o+x*u+w*f+E*v,t[10]=b*i+x*c+w*h+E*m,t[11]=b*a+x*l+w*p+E*y,b=n[12],x=n[13],w=n[14],E=n[15],t[12]=b*r+x*s+w*d+E*g,t[13]=b*o+x*u+w*f+E*v,t[14]=b*i+x*c+w*h+E*m,t[15]=b*a+x*l+w*p+E*y,t}function bt(t,e,n){var r,o,i,a,s,u,c,l,d,f,h,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],h=e[10],p=e[11],t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=d,t[9]=f,t[10]=h,t[11]=p,t[12]=r*g+s*v+d*m+e[12],t[13]=o*g+u*v+f*m+e[13],t[14]=i*g+c*v+h*m+e[14],t[15]=a*g+l*v+p*m+e[15]),t}function xt(t,e,n){var r=n[0],o=n[1],i=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,n,r){var o,i,a,s,u,l,d,f,h,p,g,v,m,y,b,x,w,E,S,M,k,_,A,C,O=r[0],I=r[1],T=r[2],N=Math.hypot(O,I,T);return N0?(n[0]=2*(s*a+d*r+u*i-l*o)/f,n[1]=2*(u*a+d*o+l*r-s*i)/f,n[2]=2*(l*a+d*i+s*o-u*r)/f):(n[0]=2*(s*a+d*r+u*i-l*o),n[1]=2*(u*a+d*o+l*r-s*i),n[2]=2*(l*a+d*i+s*o-u*r)),Tt(t,e,n),t}function Pt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Lt(t,e){var n=e[0],r=e[1],o=e[2],i=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(n,r,o),t[1]=Math.hypot(i,a,s),t[2]=Math.hypot(u,c,l),t}function Dt(t,e){var n=new c.ARRAY_TYPE(3);Lt(n,e);var r=1/n[0],o=1/n[1],i=1/n[2],a=e[0]*r,s=e[1]*o,u=e[2]*i,l=e[4]*r,d=e[5]*o,f=e[6]*i,h=e[8]*r,p=e[9]*o,g=e[10]*i,v=a+d+g,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(f-p)/m,t[1]=(h-u)/m,t[2]=(s-l)/m):a>d&&a>g?(m=2*Math.sqrt(1+a-d-g),t[3]=(f-p)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+u)/m):d>g?(m=2*Math.sqrt(1+d-a-g),t[3]=(h-u)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+p)/m):(m=2*Math.sqrt(1+g-a-d),t[3]=(s-l)/m,t[0]=(h+u)/m,t[1]=(f+p)/m,t[2]=.25*m),t}function jt(t,e,n,r){var o=e[0],i=e[1],a=e[2],s=e[3],u=o+o,c=i+i,l=a+a,d=o*u,f=o*c,h=o*l,p=i*c,g=i*l,v=a*l,m=s*u,y=s*c,b=s*l,x=r[0],w=r[1],E=r[2];return t[0]=(1-(p+v))*x,t[1]=(f+b)*x,t[2]=(h-y)*x,t[3]=0,t[4]=(f-b)*w,t[5]=(1-(d+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(h+y)*E,t[9]=(g-m)*E,t[10]=(1-(d+p))*E,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Rt(t,e,n,r,o){var i=e[0],a=e[1],s=e[2],u=e[3],c=i+i,l=a+a,d=s+s,f=i*c,h=i*l,p=i*d,g=a*l,v=a*d,m=s*d,y=u*c,b=u*l,x=u*d,w=r[0],E=r[1],S=r[2],M=o[0],k=o[1],_=o[2],A=(1-(g+m))*w,C=(h+x)*w,O=(p-b)*w,I=(h-x)*E,T=(1-(f+m))*E,N=(v+y)*E,P=(p+b)*S,L=(v-y)*S,D=(1-(f+g))*S;return t[0]=A,t[1]=C,t[2]=O,t[3]=0,t[4]=I,t[5]=T,t[6]=N,t[7]=0,t[8]=P,t[9]=L,t[10]=D,t[11]=0,t[12]=n[0]+M-(A*M+I*k+P*_),t[13]=n[1]+k-(C*M+T*k+L*_),t[14]=n[2]+_-(O*M+N*k+D*_),t[15]=1,t}function Ft(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n+n,s=r+r,u=o+o,c=n*a,l=r*a,d=r*s,f=o*a,h=o*s,p=o*u,g=i*a,v=i*s,m=i*u;return t[0]=1-d-p,t[1]=l+m,t[2]=f-v,t[3]=0,t[4]=l-m,t[5]=1-c-p,t[6]=h+g,t[7]=0,t[8]=f+v,t[9]=h-g,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bt(t,e,n,r,o,i,a){var s=1/(n-e),u=1/(o-r),c=1/(i-a);return t[0]=2*i*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(o+r)*u,t[10]=(a+i)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*i*2*c,t[15]=0,t}function zt(t,e,n,r,o){var i,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(i=1/(r-o),t[10]=(o+r)*i,t[14]=2*o*r*i):(t[10]=-1,t[14]=-2*r),t}var Gt=zt;function Ut(t,e,n,r,o){var i,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(i=1/(r-o),t[10]=o*i,t[14]=o*r*i):(t[10]=-1,t[14]=-r),t}function Wt(t,e,n,r){var o=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(o+i);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(o-i)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function Yt(t,e,n,r,o,i,a){var s=1/(e-n),u=1/(r-o),c=1/(i-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(o+r)*u,t[14]=(a+i)*c,t[15]=1,t}var Vt=Yt;function Xt(t,e,n,r,o,i,a){var s=1/(e-n),u=1/(r-o),c=1/(i-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(o+r)*u,t[14]=i*c,t[15]=1,t}function Ht(t,e,n,r){var o,i,a,s,u,l,d,f,h,p,g=e[0],v=e[1],m=e[2],y=r[0],b=r[1],x=r[2],w=n[0],E=n[1],S=n[2];return Math.abs(g-w)0&&(l*=h=1/Math.sqrt(h),d*=h,f*=h);var p=u*f-c*d,g=c*l-s*f,v=s*d-u*l;return(h=p*p+g*g+v*v)>0&&(p*=h=1/Math.sqrt(h),g*=h,v*=h),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=d*v-f*g,t[5]=f*p-l*v,t[6]=l*g-d*p,t[7]=0,t[8]=l,t[9]=d,t[10]=f,t[11]=0,t[12]=o,t[13]=i,t[14]=a,t[15]=1,t}function Zt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function $t(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Jt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function te(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function ee(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ne(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=t[5],u=t[6],l=t[7],d=t[8],f=t[9],h=t[10],p=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=e[0],x=e[1],w=e[2],E=e[3],S=e[4],M=e[5],k=e[6],_=e[7],A=e[8],C=e[9],O=e[10],I=e[11],T=e[12],N=e[13],P=e[14],L=e[15];return Math.abs(n-b)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(o-w)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(i-E)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(a-S)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-M)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(u-k)<=c.EPSILON*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(l-_)<=c.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(d-A)<=c.EPSILON*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-C)<=c.EPSILON*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-O)<=c.EPSILON*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(p-I)<=c.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-T)<=c.EPSILON*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(v-N)<=c.EPSILON*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(m-P)<=c.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(y-L)<=c.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))}var re=yt,oe=Qt,ie=n(591);function ae(){var t=new c.ARRAY_TYPE(4);return c.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,n,r){var o=new c.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function le(t,e,n,r,o){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t}function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function fe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function he(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function pe(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function ge(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ve(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function me(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function ye(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function xe(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function we(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function Ee(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],i=e[3]-t[3];return Math.hypot(n,r,o,i)}function Se(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],i=e[3]-t[3];return n*n+r*r+o*o+i*i}function Me(t){var e=t[0],n=t[1],r=t[2],o=t[3];return Math.hypot(e,n,r,o)}function ke(t){var e=t[0],n=t[1],r=t[2],o=t[3];return e*e+n*n+r*r+o*o}function _e(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Ae(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Ce(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*n+r*r+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=o*a,t[3]=i*a,t}function Oe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ie(t,e,n,r){var o=n[0]*r[1]-n[1]*r[0],i=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],l=e[0],d=e[1],f=e[2],h=e[3];return t[0]=d*c-f*u+h*s,t[1]=-l*c+f*a-h*i,t[2]=l*u-d*a+h*o,t[3]=-l*s+d*i-f*o,t}function Te(t,e,n,r){var o=e[0],i=e[1],a=e[2],s=e[3];return t[0]=o+r*(n[0]-o),t[1]=i+r*(n[1]-i),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function Ne(t,e){var n,r,o,i,a,s;e=e||1;do{a=(n=2*c.RANDOM()-1)*n+(r=2*c.RANDOM()-1)*r}while(a>=1);do{s=(o=2*c.RANDOM()-1)*o+(i=2*c.RANDOM()-1)*i}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*o*u,t[3]=e*i*u,t}function Pe(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3];return t[0]=n[0]*r+n[4]*o+n[8]*i+n[12]*a,t[1]=n[1]*r+n[5]*o+n[9]*i+n[13]*a,t[2]=n[2]*r+n[6]*o+n[10]*i+n[14]*a,t[3]=n[3]*r+n[7]*o+n[11]*i+n[15]*a,t}function Le(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*i-u*o,d=c*o+u*r-a*i,f=c*i+a*o-s*r,h=-a*r-s*o-u*i;return t[0]=l*c+h*-a+d*-u-f*-s,t[1]=d*c+h*-s+f*-a-l*-u,t[2]=f*c+h*-u+l*-s-d*-a,t[3]=e[3],t}function De(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function je(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Re(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Fe(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=e[0],s=e[1],u=e[2],l=e[3];return Math.abs(n-a)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-u)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(i-l)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}var Be=fe,ze=he,Ge=pe,Ue=Ee,We=Se,Ye=Me,Ve=ke,Xe=function(){var t=ae();return function(e,n,r,o,i,a){var s,u;for(n||(n=4),r||(r=0),u=o?Math.min(o*n+r,e.length):e.length,s=r;sc.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function $e(t,e){var n=wn(t,e);return Math.acos(2*n*n-1)}function Qe(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+o*c-i*u,t[1]=o*l+a*u+i*s-r*c,t[2]=i*l+a*c+r*u-o*s,t[3]=a*l-r*s-o*u-i*c,t}function Je(t,e,n){n*=.5;var r=e[0],o=e[1],i=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=o*u+i*s,t[2]=i*u-o*s,t[3]=a*u-r*s,t}function tn(t,e,n){n*=.5;var r=e[0],o=e[1],i=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-i*s,t[1]=o*u+a*s,t[2]=i*u+r*s,t[3]=a*u-o*s,t}function en(t,e,n){n*=.5;var r=e[0],o=e[1],i=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=o*u-r*s,t[2]=i*u+a*s,t[3]=a*u-i*s,t}function nn(t,e){var n=e[0],r=e[1],o=e[2];return t[0]=n,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-o*o)),t}function rn(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=Math.sqrt(n*n+r*r+o*o),s=Math.exp(i),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=o*u,t[3]=s*Math.cos(a),t}function on(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=Math.sqrt(n*n+r*r+o*o),s=a>0?Math.atan2(a,i)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=o*s,t[3]=.5*Math.log(n*n+r*r+o*o+i*i),t}function an(t,e,n){return on(t,e),xn(t,t,n),rn(t,t),t}function sn(t,e,n,r){var o,i,a,s,u,l=e[0],d=e[1],f=e[2],h=e[3],p=n[0],g=n[1],v=n[2],m=n[3];return(i=l*p+d*g+f*v+h*m)<0&&(i=-i,p=-p,g=-g,v=-v,m=-m),1-i>c.EPSILON?(o=Math.acos(i),a=Math.sin(o),s=Math.sin((1-r)*o)/a,u=Math.sin(r*o)/a):(s=1-r,u=r),t[0]=s*l+u*p,t[1]=s*d+u*g,t[2]=s*f+u*v,t[3]=s*h+u*m,t}function un(t){var e=c.RANDOM(),n=c.RANDOM(),r=c.RANDOM(),o=Math.sqrt(1-e),i=Math.sqrt(e);return t[0]=o*Math.sin(2*Math.PI*n),t[1]=o*Math.cos(2*Math.PI*n),t[2]=i*Math.sin(2*Math.PI*r),t[3]=i*Math.cos(2*Math.PI*r),t}function cn(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*n+r*r+o*o+i*i,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-o*s,t[3]=i*s,t}function ln(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function dn(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var o=0;e[4]>e[0]&&(o=1),e[8]>e[3*o+o]&&(o=2);var i=(o+1)%3,a=(o+2)%3;n=Math.sqrt(e[3*o+o]-e[3*i+i]-e[3*a+a]+1),t[o]=.5*n,n=.5/n,t[3]=(e[3*i+a]-e[3*a+i])*n,t[i]=(e[3*i+o]+e[3*o+i])*n,t[a]=(e[3*a+o]+e[3*o+a])*n}return t}function fn(t,e,n,r){var o=.5*Math.PI/180;e*=o,n*=o,r*=o;var i=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=i*u*l-a*s*c,t[1]=a*s*l+i*u*c,t[2]=a*u*c-i*s*l,t[3]=a*u*l+i*s*c,t}function hn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var pn=se,gn=ue,vn=ce,mn=le,yn=de,bn=Qe,xn=xe,wn=Oe,En=Te,Sn=Me,Mn=Sn,kn=ke,_n=kn,An=Ce,Cn=Re,On=Fe,In=function(){var t=ie.create(),e=ie.fromValues(1,0,0),n=ie.fromValues(0,1,0);return function(r,o,i){var a=ie.dot(o,i);return a<-.999999?(ie.cross(t,e,o),ie.len(t)<1e-6&&ie.cross(t,n,o),ie.normalize(t,t),Ze(r,t,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(ie.cross(t,o,i),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+a,An(r,r))}}(),Tn=function(){var t=He(),e=He();return function(n,r,o,i,a,s){return sn(t,r,a,s),sn(e,o,i,s),sn(n,t,e,2*s*(1-s)),n}}(),Nn=function(){var t=st.create();return function(e,n,r,o){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],An(e,dn(e,t))}}();function Pn(){var t=new c.ARRAY_TYPE(8);return c.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function Ln(t){var e=new c.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Dn(t,e,n,r,o,i,a,s){var u=new c.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=n,u[3]=r,u[4]=o,u[5]=i,u[6]=a,u[7]=s,u}function jn(t,e,n,r,o,i,a){var s=new c.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=n,s[3]=r;var u=.5*o,l=.5*i,d=.5*a;return s[4]=u*r+l*n-d*e,s[5]=l*r+d*t-u*n,s[6]=d*r+u*e-l*t,s[7]=-u*t-l*e-d*n,s}function Rn(t,e,n){var r=.5*n[0],o=.5*n[1],i=.5*n[2],a=e[0],s=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=c,t[4]=r*c+o*u-i*s,t[5]=o*c+i*a-r*u,t[6]=i*c+r*s-o*a,t[7]=-r*a-o*s-i*u,t}function Fn(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Bn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function zn(t,e){var n=He();Dt(n,e);var r=new c.ARRAY_TYPE(3);return Pt(r,e),Rn(t,n,r),t}function Gn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Un(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Wn(t,e,n,r,o,i,a,s,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=s,t[7]=u,t}var Yn=vn;function Vn(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Xn=vn;function Hn(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function qn(t,e){var n=e[4],r=e[5],o=e[6],i=e[7],a=-e[0],s=-e[1],u=-e[2],c=e[3];return t[0]=2*(n*c+i*a+r*u-o*s),t[1]=2*(r*c+i*s+o*a-n*u),t[2]=2*(o*c+i*u+n*s-r*a),t}function Zn(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=.5*n[0],u=.5*n[1],c=.5*n[2],l=e[4],d=e[5],f=e[6],h=e[7];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=a*s+o*c-i*u+l,t[5]=a*u+i*s-r*c+d,t[6]=a*c+r*u-o*s+f,t[7]=-r*s-o*u-i*c+h,t}function Kn(t,e,n){var r=-e[0],o=-e[1],i=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=s*a+l*r+u*i-c*o,f=u*a+l*o+c*r-s*i,h=c*a+l*i+s*o-u*r,p=l*a-s*r-u*o-c*i;return Je(t,e,n),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+p*r+f*i-h*o,t[5]=f*a+p*o+h*r-d*i,t[6]=h*a+p*i+d*o-f*r,t[7]=p*a-d*r-f*o-h*i,t}function $n(t,e,n){var r=-e[0],o=-e[1],i=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=s*a+l*r+u*i-c*o,f=u*a+l*o+c*r-s*i,h=c*a+l*i+s*o-u*r,p=l*a-s*r-u*o-c*i;return tn(t,e,n),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+p*r+f*i-h*o,t[5]=f*a+p*o+h*r-d*i,t[6]=h*a+p*i+d*o-f*r,t[7]=p*a-d*r-f*o-h*i,t}function Qn(t,e,n){var r=-e[0],o=-e[1],i=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=s*a+l*r+u*i-c*o,f=u*a+l*o+c*r-s*i,h=c*a+l*i+s*o-u*r,p=l*a-s*r-u*o-c*i;return en(t,e,n),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+p*r+f*i-h*o,t[5]=f*a+p*o+h*r-d*i,t[6]=h*a+p*i+d*o-f*r,t[7]=p*a-d*r-f*o-h*i,t}function Jn(t,e,n){var r=n[0],o=n[1],i=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=e[3];return t[0]=s*a+l*r+u*i-c*o,t[1]=u*a+l*o+c*r-s*i,t[2]=c*a+l*i+s*o-u*r,t[3]=l*a-s*r-u*o-c*i,s=e[4],u=e[5],c=e[6],l=e[7],t[4]=s*a+l*r+u*i-c*o,t[5]=u*a+l*o+c*r-s*i,t[6]=c*a+l*i+s*o-u*r,t[7]=l*a-s*r-u*o-c*i,t}function tr(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+o*c-i*u,t[1]=o*l+a*u+i*s-r*c,t[2]=i*l+a*c+r*u-o*s,t[3]=a*l-r*s-o*u-i*c,s=n[4],u=n[5],c=n[6],l=n[7],t[4]=r*l+a*s+o*c-i*u,t[5]=o*l+a*u+i*s-r*c,t[6]=i*l+a*c+r*u-o*s,t[7]=a*l-r*s-o*u-i*c,t}function er(t,e,n,r){if(Math.abs(r)0){n=Math.sqrt(n);var r=e[0]/n,o=e[1]/n,i=e[2]/n,a=e[3]/n,s=e[4],u=e[5],c=e[6],l=e[7],d=r*s+o*u+i*c+a*l;t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=(s-r*d)/n,t[5]=(u-o*d)/n,t[6]=(c-i*d)/n,t[7]=(l-a*d)/n}return t}function gr(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function vr(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function mr(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=t[5],u=t[6],l=t[7],d=e[0],f=e[1],h=e[2],p=e[3],g=e[4],v=e[5],m=e[6],y=e[7];return Math.abs(n-d)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(r-f)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(o-h)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(i-p)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=c.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(l-y)<=c.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var yr=n(3784)},5367:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>C,adjoint:()=>h,clone:()=>a,copy:()=>s,create:()=>o,determinant:()=>p,equals:()=>P,exactEquals:()=>N,frob:()=>A,fromMat2d:()=>E,fromMat4:()=>i,fromQuat:()=>S,fromRotation:()=>x,fromScaling:()=>w,fromTranslation:()=>b,fromValues:()=>u,identity:()=>l,invert:()=>f,mul:()=>L,multiply:()=>g,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>T,normalFromMat4:()=>M,projection:()=>k,rotate:()=>m,scale:()=>y,set:()=>c,str:()=>_,sub:()=>D,subtract:()=>O,translate:()=>v,transpose:()=>d});var r=n(1857);function o(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,n,o,i,a,s,u,c){var l=new r.ARRAY_TYPE(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=o,l[4]=i,l[5]=a,l[6]=s,l[7]=u,l[8]=c,l}function c(t,e,n,r,o,i,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function l(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function d(t,e){if(t===e){var n=e[1],r=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],d=l*a-s*c,f=-l*i+s*u,h=c*i-a*u,p=n*d+r*f+o*h;return p?(p=1/p,t[0]=d*p,t[1]=(-l*r+o*c)*p,t[2]=(s*r-o*a)*p,t[3]=f*p,t[4]=(l*n-o*u)*p,t[5]=(-s*n+o*i)*p,t[6]=h*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*i)*p,t):null}function h(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=o*c-r*l,t[2]=r*s-o*a,t[3]=s*u-i*l,t[4]=n*l-o*u,t[5]=o*i-n*s,t[6]=i*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*i,t}function p(t){var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*i-a*u)+n*(-c*o+a*s)+r*(u*o-i*s)}function g(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=n[0],h=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=f*r+h*a+p*c,t[1]=f*o+h*s+p*l,t[2]=f*i+h*u+p*d,t[3]=g*r+v*a+m*c,t[4]=g*o+v*s+m*l,t[5]=g*i+v*u+m*d,t[6]=y*r+b*a+x*c,t[7]=y*o+b*s+x*l,t[8]=y*i+b*u+x*d,t}function v(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=n[0],h=n[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+h*a+c,t[7]=f*o+h*s+l,t[8]=f*i+h*u+d,t}function m(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=Math.sin(n),h=Math.cos(n);return t[0]=h*r+f*a,t[1]=h*o+f*s,t[2]=h*i+f*u,t[3]=h*a-f*r,t[4]=h*s-f*o,t[5]=h*u-f*i,t[6]=c,t[7]=l,t[8]=d,t}function y(t,e,n){var r=n[0],o=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n+n,s=r+r,u=o+o,c=n*a,l=r*a,d=r*s,f=o*a,h=o*s,p=o*u,g=i*a,v=i*s,m=i*u;return t[0]=1-d-p,t[3]=l-m,t[6]=f+v,t[1]=l+m,t[4]=1-c-p,t[7]=h-g,t[2]=f-v,t[5]=h+g,t[8]=1-c-d,t}function M(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],d=e[9],f=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-o*a,x=n*c-i*a,w=r*u-o*s,E=r*c-i*s,S=o*c-i*u,M=l*g-d*p,k=l*v-f*p,_=l*m-h*p,A=d*v-f*g,C=d*m-h*g,O=f*m-h*v,I=y*O-b*C+x*A+w*_-E*k+S*M;return I?(I=1/I,t[0]=(s*O-u*C+c*A)*I,t[1]=(u*_-a*O-c*k)*I,t[2]=(a*C-s*_+c*M)*I,t[3]=(o*C-r*O-i*A)*I,t[4]=(n*O-o*_+i*k)*I,t[5]=(r*_-n*C-i*M)*I,t[6]=(g*S-v*E+m*w)*I,t[7]=(v*x-p*S-m*b)*I,t[8]=(p*E-g*x+m*y)*I,t):null}function k(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function _(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function A(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function C(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function O(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function I(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function T(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function N(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function P(t,e){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],d=t[8],f=e[0],h=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-h)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(i-p)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(c-y)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(l-b)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(d-x)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))}var L=g,D=O},3784:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>c,angle:()=>j,ceil:()=>h,clone:()=>i,copy:()=>s,create:()=>o,cross:()=>C,dist:()=>V,distance:()=>x,div:()=>Y,divide:()=>f,dot:()=>A,equals:()=>z,exactEquals:()=>B,floor:()=>p,forEach:()=>q,fromValues:()=>a,inverse:()=>k,len:()=>G,length:()=>E,lerp:()=>O,max:()=>v,min:()=>g,mul:()=>W,multiply:()=>d,negate:()=>M,normalize:()=>_,random:()=>I,rotate:()=>D,round:()=>m,scale:()=>y,scaleAndAdd:()=>b,set:()=>u,sqrDist:()=>X,sqrLen:()=>H,squaredDistance:()=>w,squaredLength:()=>S,str:()=>F,sub:()=>U,subtract:()=>l,transformMat2:()=>T,transformMat2d:()=>N,transformMat3:()=>P,transformMat4:()=>L,zero:()=>R});var r=n(1857);function o(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function i(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function l(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function d(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function h(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function m(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function E(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function M(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _(t,e){var n=e[0],r=e[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]}function C(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function O(t,e,n,r){var o=e[0],i=e[1];return t[0]=o+r*(n[0]-o),t[1]=i+r*(n[1]-i),t}function I(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function T(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o,t[1]=n[1]*r+n[3]*o,t}function N(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o+n[4],t[1]=n[1]*r+n[3]*o+n[5],t}function P(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[3]*o+n[6],t[1]=n[1]*r+n[4]*o+n[7],t}function L(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[4]*o+n[12],t[1]=n[1]*r+n[5]*o+n[13],t}function D(t,e,n,r){var o=e[0]-n[0],i=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=o*s-i*a+n[0],t[1]=o*a+i*s+n[1],t}function j(t,e){var n=t[0],r=t[1],o=e[0],i=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(o*o+i*i),s=a&&(n*o+r*i)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function R(t){return t[0]=0,t[1]=0,t}function F(t){return"vec2("+t[0]+", "+t[1]+")"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){var n=t[0],o=t[1],i=e[0],a=e[1];return Math.abs(n-i)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(a))}var G=E,U=l,W=d,Y=f,V=x,X=w,H=S,q=function(){var t=o();return function(e,n,r,o,i,a){var s,u;for(n||(n=2),r||(r=0),u=o?Math.min(o*n+r,e.length):e.length,s=r;s{"use strict";n.r(e),n.d(e,{add:()=>l,angle:()=>B,bezier:()=>T,ceil:()=>p,clone:()=>i,copy:()=>u,create:()=>o,cross:()=>C,dist:()=>H,distance:()=>w,div:()=>X,divide:()=>h,dot:()=>A,equals:()=>W,exactEquals:()=>U,floor:()=>g,forEach:()=>$,fromValues:()=>s,hermite:()=>I,inverse:()=>k,len:()=>Z,length:()=>a,lerp:()=>O,max:()=>m,min:()=>v,mul:()=>V,multiply:()=>f,negate:()=>M,normalize:()=>_,random:()=>N,rotateX:()=>j,rotateY:()=>R,rotateZ:()=>F,round:()=>y,scale:()=>b,scaleAndAdd:()=>x,set:()=>c,sqrDist:()=>q,sqrLen:()=>K,squaredDistance:()=>E,squaredLength:()=>S,str:()=>G,sub:()=>Y,subtract:()=>d,transformMat3:()=>L,transformMat4:()=>P,transformQuat:()=>D,zero:()=>z});var r=n(1857);function o(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function i(t){var e=new r.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function s(t,e,n){var o=new r.ARRAY_TYPE(3);return o[0]=t,o[1]=e,o[2]=n,o}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function d(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function f(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function h(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function v(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function x(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return Math.hypot(n,r,o)}function E(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return n*n+r*r+o*o}function S(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function M(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function _(t,e){var n=e[0],r=e[1],o=e[2],i=n*n+r*r+o*o;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function C(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[0],s=n[1],u=n[2];return t[0]=o*u-i*s,t[1]=i*a-r*u,t[2]=r*s-o*a,t}function O(t,e,n,r){var o=e[0],i=e[1],a=e[2];return t[0]=o+r*(n[0]-o),t[1]=i+r*(n[1]-i),t[2]=a+r*(n[2]-a),t}function I(t,e,n,r,o,i){var a=i*i,s=a*(2*i-3)+1,u=a*(i-2)+i,c=a*(i-1),l=a*(3-2*i);return t[0]=e[0]*s+n[0]*u+r[0]*c+o[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+o[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+o[2]*l,t}function T(t,e,n,r,o,i){var a=1-i,s=a*a,u=i*i,c=s*a,l=3*i*s,d=3*u*a,f=u*i;return t[0]=e[0]*c+n[0]*l+r[0]*d+o[0]*f,t[1]=e[1]*c+n[1]*l+r[1]*d+o[1]*f,t[2]=e[2]*c+n[2]*l+r[2]*d+o[2]*f,t}function N(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,o=2*r.RANDOM()-1,i=Math.sqrt(1-o*o)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=o*e,t}function P(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[3]*r+n[7]*o+n[11]*i+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*o+n[8]*i+n[12])/a,t[1]=(n[1]*r+n[5]*o+n[9]*i+n[13])/a,t[2]=(n[2]*r+n[6]*o+n[10]*i+n[14])/a,t}function L(t,e,n){var r=e[0],o=e[1],i=e[2];return t[0]=r*n[0]+o*n[3]+i*n[6],t[1]=r*n[1]+o*n[4]+i*n[7],t[2]=r*n[2]+o*n[5]+i*n[8],t}function D(t,e,n){var r=n[0],o=n[1],i=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=o*c-i*u,d=i*s-r*c,f=r*u-o*s,h=o*f-i*d,p=i*l-r*f,g=r*d-o*l,v=2*a;return l*=v,d*=v,f*=v,h*=2,p*=2,g*=2,t[0]=s+l+h,t[1]=u+d+p,t[2]=c+f+g,t}function j(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[0],i[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),i[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function R(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),i[1]=o[1],i[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function F(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),i[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),i[2]=o[2],t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function B(t,e){var n=t[0],r=t[1],o=t[2],i=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+o*o)*Math.sqrt(i*i+a*a+s*s),c=u&&A(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function z(t){return t[0]=0,t[1]=0,t[2]=0,t}function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function W(t,e){var n=t[0],o=t[1],i=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(o-s)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Y=d,V=f,X=h,H=w,q=E,Z=a,K=S,$=function(){var t=o();return function(e,n,r,o,i,a){var s,u;for(n||(n=3),r||(r=0),u=o?Math.min(o*n+r,e.length):e.length,s=r;s{var e=[],n=[];function r(t,r){if(r=r||{},void 0===t)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var o,i=!0===r.prepend?"prepend":"append",a=void 0!==r.container?r.container:document.querySelector("head"),s=e.indexOf(a);return-1===s&&(s=e.push(a)-1,n[s]={}),void 0!==n[s]&&void 0!==n[s][i]?o=n[s][i]:(o=n[s][i]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===i?a.insertBefore(o,a.childNodes[0]):a.appendChild(o)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),o.styleSheet?o.styleSheet.cssText+=t:o.textContent+=t,o}t.exports=r,t.exports.insertCss=r},4635:(t,e,n)=>{var r=n(4759).Symbol;t.exports=r},2022:(t,e,n)=>{var r=n(4635),o=n(1581),i=n(5336),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},8183:(t,e,n)=>{var r=n(2022),o=n(5776),i=n(9248),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},5639:t=>{t.exports=function(t){return function(e){return t(e)}}},6658:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2253:(t,e,n)=>{var r=n(2621)(Object.getPrototypeOf,Object);t.exports=r},1581:(t,e,n)=>{var r=n(4635),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(u){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},2479:(t,e,n)=>{t=n.nmd(t);var r=n(6658),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=s},5336:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2621:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},4759:(t,e,n)=>{var r=n(6658),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},2279:t=>{var e=Array.isArray;t.exports=e},5776:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},9853:(t,e,n)=>{var r=n(2022),o=n(9248);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},9248:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},5461:(t,e,n)=>{var r=n(2022),o=n(2253),i=n(9248),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},1641:(t,e,n)=>{var r=n(8183),o=n(5639),i=n(2479),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},8345:(t,e,n)=>{"use strict";var r=n(9950),o=n(5340);function i(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n